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