Remove old audio file selector code.
[paraslash.git] / Makefile.in
1 prefix = @prefix@
2 exec_prefix = @exec_prefix@
3
4 BINDIR = @bindir@
5 VARDIR = /var/paraslash
6 PKGDATADIR = @datarootdir@/@PACKAGE_NAME@
7 FONTDIR = $(PKGDATADIR)/fonts
8 PICDIR = $(PKGDATADIR)/pics
9 MANDIR = @datarootdir@/man/man1
10
11 install_sh = @install_sh@
12
13 build_date = $(shell date)
14 system = $(shell uname -rs)
15 cc_version = $(shell $(CC) --version | head -n 1)
16 codename = isotropic threshold
17
18 DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
19 DEBUG_CPPFLAGS += -Wredundant-decls
20 # produces false positives
21 # DEBUG_CPPFLAGS += -Wunreachable-code
22 # DEBUG_CPPFLAGS += -Wwrite-strings
23
24 # invalid option for gcc-3.3.3
25 # DEBUG_CPPFLAGS += -Wextra
26 # DEBUG_CPPFLAGS += -Wold-style-definition
27
28 # many warnings about trivial stuff
29 # CPPFLAGS += -Wconversion
30
31 LDFLAGS += -Wl,--gc-sections
32
33 CPPFLAGS += -Os
34 CPPFLAGS += -Wall
35 CPPFLAGS += -Wuninitialized
36 CPPFLAGS += -Wstrict-prototypes
37 CPPFLAGS += -Wchar-subscripts
38 CPPFLAGS += -Wformat-security
39 CPPFLAGS += -DBINDIR='"$(BINDIR)"'
40 CPPFLAGS += -DFONTDIR='"$(PKGDATADIR)/fonts"'
41 CPPFLAGS += -DPICDIR='"$(PKGDATADIR)/pics"'
42 CPPFLAGS += -DBUILD_DATE='"$(build_date)"'
43 CPPFLAGS += -DSYSTEM='"$(system)"'
44 CPPFLAGS += -DCODENAME='"$(codename)"'
45 CPPFLAGS += -DCC_VERSION='"$(cc_version)"'
46 CPPFLAGS += -Werror-implicit-function-declaration
47 CPPFLAGS += -Wmissing-format-attribute
48 CPPFLAGS += -Wunused-macros
49 CPPFLAGS += -Wshadow
50 CPPFLAGS += -Wbad-function-cast
51 CPPFLAGS += -fdata-sections -ffunction-sections
52 CPPFLAGS += -DMAIN_INPUT_FILE_IS_$(*F)
53 CPPFLAGS += @SSL_CPPFLAGS@
54 CPPFLAGS += @ncurses_cppflags@
55
56 BINARIES = para_server para_client para_audioc para_recv \
57 para_filter para_write para_fsck @extra_binaries@
58 man_binaries := $(filter-out para_dbadm para_slider para_krell.so, $(BINARIES))
59 man_pages := $(patsubst %, man/man1/%.1, $(man_binaries))
60 man_pages_html := $(patsubst %, man/html/%.html, $(man_binaries))
61 FONTS := $(wildcard fonts/*.png)
62 PICS := $(wildcard pics/paraslash/*.jpg)
63 gengetopts := $(wildcard *.ggo)
64 gengetopts_c := $(gengetopts:.ggo=.cmdline.c)
65 gengetopts_h := $(gengetopts:.ggo=.cmdline.h)
66 grutatxt := NEWS CREDITS INSTALL README FEATURES
67 grutatxt_html := $(grutatxt:=.html)
68 html_in := $(wildcard web/*.in.html)
69 gen_html := $(subst web/,web/sync/,$(html_in))
70 gen_html := $(gen_html:.in.html=.html)
71 gruta_in := $(grutatxt:=.in.html)
72 gruta_in := $(patsubst %,web/%,$(gruta_in))
73 gruta_html := $(grutatxt:=.html)
74 gruta_html := $(patsubst %,web/sync/%,$(gruta_html))
75 shots := gui-2005-11-12.png para_audiod-startup.txt para_krell-2005-02.png \
76 para_server-startup.txt para_slider-2004-12.png sdl_gui.jpg \
77 para_krell-2005-02.png
78 shots := $(patsubst %,web/sync/%,$(shots))
79 web_pics := web/sync/paraslash.png web/sync/paraslash.ico
80 web_misc := overview.pdf versions/@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2 PUBLIC_KEY \
81 key.anonymous para.css
82 web_misc := $(patsubst %,web/sync/%,$(web_misc))
83 web_man := web/sync/man
84 autocrap := config.h.in configure
85 tarball_pfx := @PACKAGE_TARNAME@-@PACKAGE_VERSION@
86 tarball_delete = web versions pics/screenshots pics/web .changelog_before_cvs \
87 .changelog_cvs
88 tarball_delete := $(patsubst %,$(tarball_pfx)/%,$(tarball_delete))
89 tarball_add := $(gengetopts_c) $(gengetopts_h) $(autocrap)
90
91 .PHONY: clean distclean maintainer-clean install html www tags doxygen gruta \
92 man html_man
93 all: $(BINARIES)
94 www: $(gen_html) $(gruta_html) $(web_pics) $(web_misc) $(shots) $(web_man) \
95 tags doxygen
96 gruta: $(gen_html) $(gruta_html)
97 man: $(man_pages)
98 html_man: $(man_pages_html)
99
100 sdl_gui_objs = sdl_gui.cmdline.o SFont.o sdl_gui.o gui_common.o exec.o \
101 close_on_fork.o string.o stat.o fd.o
102 dbadm_objs = dbadm.o exec.o close_on_fork.o string.o
103 fade_objs = fade.cmdline.o fade.o exec.o close_on_fork.o string.o fd.o
104 krell_objs = krell.o string.o
105 slider_objs = slider.o string.o
106 fsck_objs = osl.o rbtree.o fsck.o string.o sha1.o fsck.cmdline.o
107
108 *.o: para.h config.h gcc-compat.h
109
110 include Makefile.deps
111
112 module_ggo_opts := --set-version="(@PACKAGE_STRING@, $(codename))"
113
114 grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
115 gengetopt $(module_ggo_opts) \
116 -S \
117 --set-package=grab \
118 --no-handle-help \
119 --no-handle-error \
120 --no-handle-version \
121 --arg-struct-name=grab_client_args_info \
122 --file-name=$(subst .ggo,,$<).cmdline \
123 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
124
125 %_recv.cmdline.h %_recv.cmdline.c: %_recv.ggo
126 gengetopt $(module_ggo_opts) \
127 --set-package=$(subst .ggo,,$<) \
128 --arg-struct-name=$(subst .ggo,,$<)_args_info \
129 --file-name=$(subst .ggo,,$<).cmdline \
130 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
131
132 %_filter.cmdline.h %_filter.cmdline.c: %_filter.ggo
133 gengetopt $(module_ggo_opts) \
134 --set-package=$(subst .ggo,,$<) \
135 --arg-struct-name=$(subst .ggo,,$<)_args_info \
136 --file-name=$(subst .ggo,,$<).cmdline \
137 --func-name $(subst _filter.ggo,,$<)_cmdline_parser < $<
138 %_write.cmdline.h %_write.cmdline.c: %_write.ggo
139 gengetopt -S $(module_ggo_opts) \
140 --set-package=$(subst .ggo,,$<) \
141 --arg-struct-name=$(subst .ggo,,$<)_args_info \
142 --file-name=$(subst .ggo,,$<).cmdline \
143 --func-name $(subst _write.ggo,,$<)_cmdline_parser < $<
144
145 %.cmdline.h %.cmdline.c: %.ggo
146 case $< in client.ggo) O="--unamed-opts=command";; \
147 audioc.ggo) O="--unamed-opts=command";; \
148 fsck.ggo) O="--unamed-opts=table";; \
149 esac; \
150 echo "$O"; if test $< != fsck.ggo; then O="$$O --conf-parser "; fi; \
151 gengetopt $$O \
152 --no-handle-version \
153 --file-name=$(*F).cmdline \
154 --func-name $(*F)_cmdline_parser \
155 --arg-struct-name=$(*F)_args_info \
156 --set-package="para_$(subst .cmdline,,$(*F))" \
157 --set-version="@PACKAGE_VERSION@" < $<
158
159 %_command_list.c %_command_list.h: %.cmd
160 ./command_util.sh c < $< >$@
161 ./command_util.sh h < $< >$(@:%.c=%.h)
162
163 %_command_list.man: %.cmd
164 ./command_util.sh man < $< > $@
165
166 server_command_lists = server_command_list.man afs_command_list.man
167 man/man1/para_server.1: para_server $(server_command_lists)
168 mkdir -p man/man1
169 opts="-N `for i in $(server_command_lists); do echo "-i $$i"; done`"; \
170 help2man $$opts ./para_server > $@
171
172 man/man1/para_audiod.1: para_audiod audiod_command_list.man
173 mkdir -p man/man1
174 help2man -N -i audiod_command_list.man ./para_audiod > $@
175
176 man/man1/%.1: %
177 mkdir -p man/man1
178 help2man -N ./$< > $@
179
180 man/html/%.html: man/man1/%.1
181 mkdir -p man/html
182 man2html $< > $@
183
184
185
186 ortp_recv.o: ortp_recv.c
187 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
188
189 ortp_send.o: ortp_send.c
190 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
191
192 oggdec.o: oggdec.c
193 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
194 ogg_afh.o: ogg_afh.c
195 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
196
197 mp3dec.o: mp3dec.c
198 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
199
200 aacdec.o: aacdec.c
201 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
202
203 aac_common.o: aac_common.c
204 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
205
206 aac_afh.o: aac_afh.c
207 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
208
209 slider.o: slider.c
210 $(CC) -c -Wall -o $@ -g @GLIB_CFLAGS@ @GTK_CFLAGS@ $<
211
212 krell.o: krell.c
213 $(CC) -Wall -O -g -fPIC @GTK_CFLAGS@ -c -o $@ krell.c
214
215 %.cmdline.o: %.cmdline.c
216 $(CC) -c $(CPPFLAGS) $<
217
218 %.o: %.c
219 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
220
221 para_recv: @recv_objs@
222 $(CC) $(LDFLAGS) @recv_objs@ -o $@ @recv_ldflags@
223
224 para_filter: @filter_objs@
225 $(CC) $(LDFLAGS) @filter_objs@ -o $@ @filter_ldflags@
226
227 para_slider: $(slider_objs)
228 $(CC) $(LDFLAGS) $(slider_objs) -o $@ @GTK_LIBS@ @GLIB_LIBS@ -lzmw
229
230 para_client: @client_objs@
231 $(CC) $(LDFLAGS) -o $@ @client_objs@ @client_ldflags@
232
233 para_gui: @gui_objs@
234 $(CC) $(LDFLAGS) -o $@ @gui_objs@ -lncurses
235
236 para_audiod: @audiod_objs@
237 $(CC) $(LDFLAGS) -o $@ @audiod_objs@ @audiod_ldflags@
238
239 para_audioc: @audioc_objs@
240 $(CC) $(LDFLAGS) -o $@ @audioc_objs@ @audioc_ldflags@
241
242 para_dbadm: $(dbadm_objs)
243 $(CC) $(LDFLAGS) -o $@ $(dbadm_objs) -lncurses -lmenu
244
245 para_fade: $(fade_objs)
246 $(CC) $(LDFLAGS) -o $@ $(fade_objs)
247
248 para_server: @server_objs@
249 $(CC) $(LDFLAGS) -o $@ @server_objs@ @server_ldflags@
250
251 para_fsck: @fsck_objs@
252 $(CC) $(LDFLAGS) -o $@ @fsck_objs@ @fsck_ldflags@
253
254 para_sdl_gui: $(sdl_gui_objs)
255 $(CC) $(LDFLAGS) -o $@ $(sdl_gui_objs) -lSDL_image
256
257 para_write: @write_objs@
258 $(CC) $(LDFLAGS) -o $@ @write_objs@ @write_ldflags@
259
260 para_krell.so: $(krell_objs)
261 $(CC) -Wall -fPIC @GTK_CFLAGS@ krell.o -o $@ @GTK_LIBS@ -shared
262
263 clean:
264 rm -f *.o $(BINARIES)
265 distclean: clean
266 rm -f Makefile autoscan.log config.status config.log && \
267 rm -rf web/sync/* autom4te.cache aclocal.m4
268 rm -f GPATH GRTAGS GSYMS GTAGS
269
270 maintainer-clean: distclean
271 rm -f $(gengetopts_c) $(gengetopts_h) *.tar.bz2 \
272 $(grutatxt_html) config.h configure \
273 config.h.in skencil/*.pdf skencil/*.ps
274 rm -f *_command_list.* *.man man/man1/* man/html/*
275
276
277 install: all man
278 mkdir -p $(BINDIR) $(FONTDIR) $(PICDIR) $(MANDIR)
279 $(install_sh) -s -m 755 $(BINARIES) $(BINDIR)
280 $(install_sh) -m 644 $(FONTS) $(FONTDIR)
281 $(install_sh) -m 644 $(PICS) $(PICDIR)
282 $(install_sh) -m 644 $(man_pages) $(MANDIR)
283 mkdir -p $(VARDIR) >/dev/null 2>&1 || true # not fatal, so don't complain
284
285 @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: $(tarball_add) $(man_pages)
286 rm -rf $(tarball_pfx).tar.bz2 $(tarball_pfx)
287 git-archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
288 | tar --delete $(tarball_delete) > $(tarball_pfx).tar
289 mkdir $(tarball_pfx)
290 cp -r $(tarball_add) $(tarball_pfx)
291 mkdir -p $(tarball_pfx)/man/man1
292 cp -r $(man_pages) $(tarball_pfx)/man/man1
293 tar rf $(tarball_pfx).tar $(tarball_pfx)/*
294 rm -rf $(tarball_pfx)
295 bzip2 -9 $(tarball_pfx).tar
296 rm -f $(tarball_pfx).tar
297 ls -l $(tarball_pfx).tar.bz2
298
299 web/%.in.html: %
300 grutatxt -nb < $< > $@
301 tags:
302 rm -rf web/sync/HTML && gtags && htags -nF && mv HTML web/sync
303 web/header2.html: web/header.html
304 sed -e 's|href="|href="\.\.\/\.\./|g' \
305 -e 's|SRC="|SRC="\.\.\/\.\./|g' $< > $@
306 doxygen: web/header2.html
307 mkdir -p web/sync/doxygen
308 doxygen
309 web/sync/man: html_man
310 mkdir -p $@
311 cp -a $(man_pages_html) $@
312 web/sync/%.html: web/%.in.html web/header.html web/footer.html web/sync
313 cat web/header.html $< web/footer.html > $@
314 web/sync/%.png: pics/web/%.png web/sync
315 cp $< $@
316 web/sync/%.ico: pics/web/%.ico web/sync
317 cp $< $@
318 web/sync/para.css: web/para.css web/sync
319 cp $< $@
320 web/sync/versions/@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2 web/sync
321 cp -a versions web/sync && cp $< $@
322 web/sync/overview.pdf: skencil/overview.pdf web/sync
323 cp $< $@
324 web/sync/%: %
325 cp -a $< $@
326 web/sync/%: pics/screenshots/%
327 cp $< $@
328 skencil/%.ps: skencil/%.sk
329 sk2ps $< > $@
330 %.pdf: %.ps
331 ps2pdf - - < $< > $@