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