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