root/rat/trunk/Makefile.in @ 4142

Revision 4142, 8.0 KB (checked in by turam, 6 years ago)

Clean rat-kill

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#
2# Makefile for the RAT project. This requires GNU make on many systems.
3#
4# $Id$
5#
6# Configure substitutes variables here... #####################################
7
8DEFS    = @DEFS@ -DHIDE_SOURCE_STRINGS
9CFLAGS  = @CFLAGS@ $(DEFS)
10LIBS    = @LIBS@ @MATHLIBS@
11LDLIBS  =
12INCLUDE = @COMMON_INC@ @AUD_INC@ @TCL_INC@ @TK_INC@ @G728_INC@
13CC      = @CC@
14AR      = ar
15RANLIB  = @RANLIB@
16ECHO    = echo
17STRIP   = strip
18
19VERSION = @VERSION@
20RATVER  = rat-$(VERSION)
21
22AUD_OBJ  = @AUD_OBJ@
23AUD_INC  = @AUD_INC@
24AUD_LIB  = @AUD_LIB@
25
26TCL_LIB    = @TCL_LIB@
27TK_LIB     = @TK_LIB@
28X_CFLAGS   = @X_CFLAGS@
29X_LIB      = @X_PRE_LIBS@ @X_LIBS@ -lX11 -lXext @X_EXTRA_LIBS@   
30COMMON_LIB = @COMMON_LIB@
31EXTRA_OBJ  = @EXTRA_OBJ@
32EXTERNAL_DEP = @EXTERNAL_DEP@
33
34G728_CODEC_OBJ = @G728_CODEC_OBJ@
35G728_LIB       = @G728_LIB@
36
37WBS_CODEC_OBJ = codec_wbs.o cx_wbs.o
38
39prefix      = @prefix@
40exec_prefix = @exec_prefix@
41bindir      = @bindir@
42mandir      = @mandir@
43sysconfdir  = @sysconfdir@
44
45# Nothing below here set by configure #########################################
46
47AUDIO_OBJS   = $(AUD_OBJ) auddev_null.o audio_fmt.o audio_util.o \
48               auddev_trans.o auddev.o
49
50CODEC_OBJS   = codec.o codec_state.o codec_dvi.o codec_gsm.o \
51               codec_l8.o codec_l16.o codec_g711.o codec_g726.o codec_lpc.o \
52               codec_types.o codec_vdvi.o \
53               cx_g726.o cx_g726_16.o cx_g726_24.o cx_g726_32.o cx_g726_40.o \
54               cx_gsm.o cx_lpc.o cx_vdvi.o cx_dvi.o \
55               converter.o convert_util.o convert_extra.o convert_linear.o \
56               convert_sinc.o bitstream.o @G728_CODEC_OBJ@ $(WBS_CODEC_OBJ)
57
58SNDFILE_OBJS = sndfile.o sndfile_au.o sndfile_raw.o sndfile_wav.o
59
60MEDIALIBS    = libuclaudio.a libuclcodec.a libuclsndfile.a
61
62CHANNEL_OBJS = channel.o channel_types.o cc_vanilla.o cc_rdncy.o cc_layered.o
63
64TOY_OBJS     = render_3D.o repair.o
65
66MEDIA_OBJS   = ts.o playout.o net.o source.o session.o \
67               main_engine.o mbus_engine.o audio.o cushion.o mix.o \
68               parameters.o transmit.o playout_calc.o \
69               ui_send_rtp.o ui_send_audio.o ui_send_prefs.o ui_send_stats.o \
70               transcoder.o rtp_dump.o rtp_callback.o settings.o \
71               pdb.o pktbuf.o tonegen.o voxlet.o fatal_error.o $(EXTRA_OBJ)
72
73UI_OBJS      = tcltk.o mbus_ui.o main_ui.o fatal_error.o
74
75CTRL_OBJS    = main_control.o mbus_control.o codec_compat.o fatal_error.o \
76               process.o cmd_parser.o
77
78TCL_OBJS     = ui_audiotool.o ui_transcoder.o
79
80TCL_SRCS     = $(TCL_OBJS:%.o=%.c)
81
82ALL_OBJS     = $(AUDIO_OBJS) $(CODEC_OBJS) $(SNDFILE_OBJS) $(CHANNEL_OBJS) \
83               $(TOY_OBJS) $(MEDIA_OBJS) $(UI_OBJS) $(CTRL_OBJS)
84
85ALL_SRCS     = $(ALL_OBJS:%.o=%.c)
86
87INSTALL_OBJS = ui_installer.o installer.o binaries.o
88
89all: version.h sdr2.plugin.S02.audio.rtp.-.$(RATVER) $(RATVER).spec $(RATVER) $(RATVER)-ui $(RATVER)-media $(RATVER)-kill rat Makefile
90
91libuclaudio.a: $(AUDIO_OBJS)
92        $(AR) r $@ $(AUDIO_OBJS)
93        $(RANLIB) $@
94
95libuclcodec.a: $(CODEC_OBJS)
96        $(AR) r $@ $(CODEC_OBJS)
97        $(RANLIB) $@
98
99libuclsndfile.a: $(SNDFILE_OBJS)
100        $(AR) r $@ $(SNDFILE_OBJS)
101        $(RANLIB) $@
102
103$(RATVER)-kill: rat-kill.o
104        $(CC) $(CFLAGS) rat-kill.o $(COMMON_LIB) $(LIBS) -o $(RATVER)-kill
105
106$(RATVER)-media: $(CHANNEL_OBJS) $(TOY_OBJS) $(MEDIA_OBJS) $(MEDIALIBS) $(EXTERNAL_DEP)
107        $(CC) $(CFLAGS) $(CHANNEL_OBJS) $(TOY_OBJS) $(MEDIA_OBJS) $(MEDIALIBS) $(COMMON_LIB) $(AUD_LIB) $(LIBS) $(G728_LIB) -o $(RATVER)-media
108
109$(RATVER)-ui: $(TCL_OBJS) $(UI_OBJS) $(EXTERNAL_DEP)
110        $(CC) $(CFLAGS) $(TCL_OBJS) $(UI_OBJS) $(COMMON_LIB)  $(TCL_LIB) $(TK_LIB) $(X_LIB) $(LIBS) -o $(RATVER)-ui
111
112$(RATVER): $(CTRL_OBJS) $(EXTERNAL_DEP)
113        $(CC) $(CFLAGS) $(CTRL_OBJS) $(COMMON_LIB) $(LIBS) -o $(RATVER)
114
115.c.o:
116        $(CC) $(CFLAGS) $(X_CFLAGS) $(INCLUDE) -c $<
117
118$(TCL_OBJS): $(TCL_SRCS)
119
120ui_transcoder.c: ui_transcoder.tcl tcl2c/tcl2c
121        cat ui_transcoder.tcl | tcl2c/tcl2c ui_transcoder > ui_transcoder.c
122
123ui_audiotool.c: uicomponent_bargraph.tcl uicomponent_chart.tcl uicomponent_help.tcl asfilebox.tcl ui_audiotool.tcl tcl2c/tcl2c
124        cat uicomponent_bargraph.tcl uicomponent_chart.tcl uicomponent_help.tcl asfilebox.tcl ui_audiotool.tcl | tcl2c/tcl2c ui_audiotool > ui_audiotool.c
125
126ui_installer.c: ui_installer.tcl tcl2c/tcl2c
127        cat ui_installer.tcl | tcl2c/tcl2c ui_installer > ui_installer.c
128
129tcl2c/tcl2c: tcl2c/tcl2c.c
130        $(CC) -o tcl2c/tcl2c tcl2c/tcl2c.c
131
132version.h: VERSION
133        @${ECHO} "Generating version.h"
134        @sed -e 's/.*/#define RAT_VERSION "&"/' VERSION > version.h
135
136sdr2.plugin.S02.audio.rtp.-.rat-$(VERSION): sdr2.plugin.in
137        @${ECHO} "Generating sdr plugin"
138        @${ECHO} "# Generated automatically from sdr2.plugin.in" > $@
139        @${ECHO} "# DO NOT EDIT THIS FILE" >> $@
140        @sed -e 's/VERSION/$(VERSION)/g' sdr2.plugin.in >> $@
141
142rat-$(VERSION).spec: rat.spec
143        @${ECHO} "Generating RPM spec file"
144        @${ECHO} "# Generated automatically from rat.spec"  > $@
145        @${ECHO} "# DO NOT EDIT THIS FILE"                 >> $@
146        @cat rat.spec | sed s/VERSION/$(VERSION)/g       >> $@
147
148rat: VERSION Makefile
149        @${ECHO} "Generating rat shell script"
150        @${ECHO} "#!/bin/sh" > $@
151        @${ECHO} "# Generated automatically from RAT Makefile.  Edit there." >> $@
152        @${ECHO} 'PATH=$${PATH}:.' >> $@
153        @${ECHO} "exec rat-$(VERSION)" '$$*' >> $@
154        @chmod a+x rat
155
156clean:
157        -rm -f $(CTRL_OBJS) $(AUDIO_OBJS) $(CODEC_OBJS) $(SNDFILE_OBJS) $(CHANNEL_OBJS) $(TOY_OBJS) $(MEDIA_OBJS) $(UI_OBJS) $(TCL_OBJS)
158        -rm -f $(MEDIALIBS)
159        -rm -f rat-kill.o
160        -rm -f tcl_libs.c ui_audiotool.c ui_transcoder.c ui_installer.c version.h
161        -rm -f tcl2c/tcl2c sdr2.plugin.S02.audio.rtp.-.$(RATVER) $(RATVER).spec
162        -rm -f bin2c bin2c.o binaries.c rat-kill.o $(INSTALL_OBJS) $(RATVER)-installer
163        -rm -f rat $(RATVER)-media $(RATVER)-ui $(RATVER)-kill $(RATVER)
164
165distclean: clean
166        -rm -rf config.cache config.log config.status ratconf.h Makefile
167        -rm -rf core core-$(RATVER)-media core-$(RATVER)-ui
168
169install: all
170        ./install-sh -m 555 -c rat             $(bindir)
171        ./install-sh -m 555 -c $(RATVER)       $(bindir)
172        ./install-sh -m 555 -c $(RATVER)-kill  $(bindir)/rat-kill
173        ./install-sh -m 555 -c $(RATVER)-media $(bindir)
174        ./install-sh -m 555 -c $(RATVER)-ui    $(bindir)
175        ./install-sh -m 444 -c man/man1/rat.1  $(mandir)/man1/rat.1
176        ./install-sh -m 444 -c sdr2.plugin.S02.audio.rtp.-.$(RATVER) $(sysconfdir)/sdr/plugins
177
178installer: $(RATVER)-installer
179        mkdir release
180        mkdir release/$(RATVER)
181        cp $(RATVER)-installer README.* MODS COPYRIGHT INSTALL.TXT VERSION release/$(RATVER)
182        cd release && tar cvf $(RATVER)-$(OSTYPE).tar $(RATVER) && gzip -9 $(RATVER)-$(OSTYPE).tar
183        mv release/$(RATVER)-$(OSTYPE).tar.gz .
184        rm -rf release
185
186$(RATVER)-installer: $(INSTALL_OBJS)
187        $(CC) $(CFLAGS) $(INSTALL_OBJS)  $(TCL_LIB) $(TK_LIB) $(X_LIB) $(LIBS) -o $(RATVER)-installer
188
189binaries.c: $(RATVER)-$(OSTYPE).tar.gz bin2c
190        ./bin2c $(RATVER)-$(OSTYPE).tar.gz > binaries.c
191
192bin2c: bin2c.o
193        $(CC) bin2c.o -o bin2c
194
195etags:
196        etags ../common/src/*.[ch] *.[ch]
197
198ctags:
199        ctags ../common/src/*.[ch] *.[ch]
200
201release:
202        cvs tag release-`cat VERSION | sed "s/\./-/g"`
203
204$(RATVER)-$(OSTYPE).tar.gz: $(RATVER) $(RATVER)-ui $(RATVER)-media rat
205        tar cf $(RATVER)-$(OSTYPE).tar README.* MODS COPYRIGHT INSTALL.TXT VERSION $(RATVER) $(RATVER)-ui $(RATVER)-media sdr2.plugin.S02.audio.rtp.-.rat-$(VERSION) rat
206        rm -f $(RATVER)-$(OSTYPE).tar.gz
207        gzip -9 $(RATVER)-$(OSTYPE).tar
208
209tgz: $(RATVER)-$(OSTYPE).tar.gz
210
211rpm: clean tgz
212        @${ECHO} "Building $(RATVER).rpm -- this almost certainly needs to run as root on RedHat Linux"
213#       install -m 644 $(RATVER)-$(OSTYPE).tar.gz /usr/src/redhat/SOURCES/rat-4.1.2.tar.gz
214        install -m 644 AccessGrid-rat.spec /usr/src/redhat/SPECS/AccessGrid-rat.spec
215        install -m 644 $(RATVER)-$(OSTYPE).tar.gz /usr/src/redhat/SOURCES/$(RATVER)-$(OSTYPE).tar.gz
216        rpm -bb $(RATVER).spec
217
218agrpm: clean
219        @${ECHO} "Building AG $(RATVER).rpm -- this almost certainly needs to run as root on RedHat Linux"
220        ( cd ../.. ; ln -s ag-rat $(RATVER) ; tar cvfh /usr/src/redhat/SOURCES/$(RATVER).tar.gz $(RATVER) ; rm $(RATVER) )
221        install -m 644 AccessGrid-rat.spec /usr/src/redhat/SPECS/AccessGrid-rat.spec
222        rpm -ba AccessGrid-rat.spec
223
224Makefile: Makefile.in VERSION
225        $(error "Run configure again, the following file(s) are newer than Makefile: $?")
226
227depend:
228        makedepend $(X_CFLAGS) $(INCLUDE) $(ALL_SRCS)
229# DO NOT DELETE THIS LINE
Note: See TracBrowser for help on using the browser.