1 COPYRIGHT = Copyright (c) 1997-2006 by Andre Noll
2 DISCLAIMER = This is free software with ABSOLUTELY NO WARRANTY. See COPYING for details.
5 exec_prefix = @exec_prefix@
8 VARDIR = /var/paraslash
9 PKGDATADIR = @datarootdir@/@PACKAGE_NAME@
10 FONTDIR = $(PKGDATADIR)/fonts
11 PICDIR = $(PKGDATADIR)/pics
12 MANDIR = @datarootdir@/man/man1
14 install_sh = @install_sh@
16 build_date = $(shell date)
17 system = $(shell uname -rs)
18 cc_version = $(shell $(CC) --version | head -n 1)
19 codename = inductive resonance
21 DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
23 DEBUG_CPPFLAGS += -Wredundant-decls
25 # produces false positives
26 # DEBUG_CPPFLAGS += -Wunreachable-code
28 #CPPFLAGS += -Wwrite-strings
30 # invalid option for gcc-3.3.5
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
51 BINARIES = para_server para_client para_gui para_audioc para_recv para_filter para_write @extra_binaries@
53 FONTS := $(wildcard fonts/*.png)
54 PICS := $(wildcard pics/paraslash/*.jpg)
55 MANS := $(wildcard doc/man/man1/*.1)
56 gengetopts := $(wildcard *.ggo)
57 gengetopts_c := $(gengetopts:.ggo=.cmdline.c)
58 gengetopts_h := $(gengetopts:.ggo=.cmdline.h)
59 all_c_files := $(wildcard *.c)
60 c_sources := $(filter-out $(gengetopts_c), $(all_c_files))
61 grutatxt := COPYING NEWS README.mysql CREDITS INSTALL README \
63 grutatxt_html := $(grutatxt:=.html)
64 html_in := $(wildcard web/*.in.html)
65 gen_html := $(subst web/,web/sync/,$(html_in))
66 gen_html := $(gen_html:.in.html=.html)
67 gruta_in := $(grutatxt:=.in.html)
68 gruta_in := $(patsubst %,web/%,$(gruta_in))
69 gruta_html := $(grutatxt:=.html)
70 gruta_html := $(patsubst %,web/sync/%,$(gruta_html))
71 shots := gui-2005-11-12.png para_audiod-startup.txt
72 shots += para_krell-2005-02.png para_server-startup.txt
73 shots += para_slider-2004-12.png sdl_gui.jpg para_krell-2005-02.png
74 shots := $(patsubst %,web/sync/%,$(shots))
75 web_pics := web/sync/paraslash.png web/sync/paraslash.ico
76 web_misc := overview.pdf versions/paraslash-git.tar.bz2 PUBLIC_KEY key.anonymous para.css doc
77 web_misc := $(patsubst %,web/sync/%,$(web_misc))
79 autocrap := config.h.in configure
81 tarball_pfx := @PACKAGE_TARNAME@-@PACKAGE_VERSION@
83 tarball_delete = web versions pics/screenshots pics/web .changelog_before_cvs \
85 tarball_delete := $(patsubst %,$(tarball_pfx)/%,$(tarball_delete))
86 tarball_add := $(gengetopts_c) $(gengetopts_h) $(autocrap)
88 .PHONY: clean distclean maintainer-clean install html www tags ChangeLog doxygen gruta
90 www: $(gen_html) $(gruta_html) $(web_pics) $(web_misc) $(shots) tags doxygen doc
91 gruta: $(gen_html) $(gruta_html)
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
101 *.o: para.h config.h gcc-compat.h
103 include Makefile.deps
105 V := ($(TGZ_PREFIX)@PACKAGE_STRING@, $(codename))\n$(COPYRIGHT)\n$(DISCLAIMER)
106 module_ggo_opts := --set-version="(@PACKAGE_STRING@, $(codename))"
108 grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
109 gengetopt $(module_ggo_opts) \
114 --no-handle-version \
115 --arg-struct-name=grab_client_args_info \
116 --file-name=$(subst .ggo,,$<).cmdline \
117 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
119 %_recv.cmdline.h %_recv.cmdline.c: %_recv.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 .ggo,,$<)_cmdline_parser < $<
126 %_filter.cmdline.h %_filter.cmdline.c: %_filter.ggo
127 gengetopt $(module_ggo_opts) \
128 --set-package=$(subst .ggo,,$<) \
129 --arg-struct-name=$(subst .ggo,,$<)_args_info \
130 --file-name=$(subst .ggo,,$<).cmdline \
131 --func-name $(subst _filter.ggo,,$<)_cmdline_parser < $<
132 %_write.cmdline.h %_write.cmdline.c: %_write.ggo
133 gengetopt -S $(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 _write.ggo,,$<)_cmdline_parser < $<
139 %.cmdline.h %.cmdline.c: %.ggo
140 case $< in client.ggo) O="--unamed-opts=command";; \
141 audioc.ggo) O="--unamed-opts=command";; \
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="$V" < $<
151 server_command_list.c: server.cmd server_command_list.h
152 echo '#include "server.h"' > $@
153 echo '#include "user_list.h"' >> $@
154 echo '#include "server_command_list.h"' >> $@
155 echo 'struct server_command cmd_struct[] = {' >>$@
156 ./command_util.sh array < $< >>$@
157 echo '{.name = NULL}};' >> $@
158 server_command_list.h: server.cmd
159 echo 'extern struct server_command cmd_struct[];' > $@
160 ./command_util.sh proto < $< >> $@
162 mysql_selector_command_list.c: mysql_selector.cmd mysql_selector_command_list.h
163 echo '#include "server.h"' > $@
164 echo '#include "user_list.h"' >> $@
165 echo '#include "mysql_selector_command_list.h"' >> $@
166 echo 'struct server_command cmds[] = {' >>$@
167 ./command_util.sh array < $< >>$@
168 echo '{.name = NULL}};' >> $@
169 mysql_selector_command_list.h: mysql_selector.cmd
170 echo 'extern struct server_command cmds[];' > $@
171 ./command_util.sh proto < $< >> $@
173 random_selector_command_list.c: random_selector.cmd random_selector_command_list.h
174 echo '#include "server.h"' > $@
175 echo '#include "user_list.h"' >> $@
176 echo '#include "random_selector_command_list.h"' >> $@
177 echo 'struct server_command random_selector_cmds[] = {' >>$@
178 ./command_util.sh array < $< >>$@
179 echo '{.name = NULL}};' >> $@
180 random_selector_command_list.h: random_selector.cmd
181 echo 'extern struct server_command random_selector_cmds[];' > $@
182 ./command_util.sh proto < $< >> $@
184 playlist_selector_command_list.c: playlist_selector.cmd playlist_selector_command_list.h
185 echo '#include "server.h"' > $@
186 echo '#include "user_list.h"' >> $@
187 echo '#include "playlist_selector_command_list.h"' >> $@
188 echo 'struct server_command playlist_selector_cmds[] = {' >>$@
189 ./command_util.sh array < $< >>$@
190 echo '{.name = NULL}};' >> $@
191 playlist_selector_command_list.h: playlist_selector.cmd
192 echo 'extern struct server_command playlist_selector_cmds[];' > $@
193 ./command_util.sh proto < $< >> $@
195 ortp_recv.o: ortp_recv.c
196 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
198 ortp_send.o: ortp_send.c
199 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
202 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
204 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
207 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
210 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
212 aac_common.o: aac_common.c
213 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
216 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
218 para_recv: @recv_objs@
219 $(CC) @recv_objs@ -o $@ @recv_ldflags@
222 $(CC) -c -Wall -o $@ -g @GLIB_CFLAGS@ @GTK_CFLAGS@ $<
225 $(CC) -Wall -O -g -fPIC @GTK_CFLAGS@ -c -o $@ krell.c
227 mysql_selector.o: mysql_selector.c
228 $(CC) -Wall -O -g @mysql_cppflags@ -c -o $@ $<
230 %.cmdline.o: %.cmdline.c
231 $(CC) -c $(CPPFLAGS) $<
233 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
235 para_filter: @filter_objs@
236 $(CC) @filter_objs@ -o $@ @filter_ldflags@
238 para_slider: $(slider_objs)
239 $(CC) $(slider_objs) -o $@ @GTK_LIBS@ @GLIB_LIBS@ -lzmw
241 para_client: @client_objs@
242 $(CC) -o $@ @client_objs@ @client_ldflags@
245 $(CC) -o $@ @gui_objs@ -lncurses
247 para_audiod: @audiod_objs@
248 $(CC) -o $@ @audiod_objs@ @audiod_ldflags@
250 para_audioc: @audioc_objs@
251 $(CC) -o $@ @audioc_objs@
253 para_dbadm: $(dbadm_objs)
254 $(CC) -o $@ $(dbadm_objs) -lncurses -lmenu
256 para_fade: $(fade_objs)
257 $(CC) -o $@ $(fade_objs)
259 para_server: @server_objs@
260 $(CC) -o $@ @server_objs@ @server_ldflags@
262 para_sdl_gui: $(sdl_gui_objs)
263 $(CC) -o $@ $(sdl_gui_objs) -lSDL_image
265 para_write: @write_objs@
266 $(CC) -o $@ @write_objs@ @write_ldflags@
268 para_krell.so: $(krell_objs)
269 $(CC) -Wall -fPIC @GTK_CFLAGS@ krell.o -o $@ @GTK_LIBS@ -shared
272 rm -f *.o $(BINARIES) *_command_list.*
275 rm -f Makefile autoscan.log config.status config.log && \
276 rm -rf web/sync/* autom4te.cache aclocal.m4
277 rm -f GPATH GRTAGS GSYMS GTAGS
279 maintainer-clean: distclean
280 rm -f $(gengetopts_c) $(gengetopts_h) *.tar.bz2 \
281 $(grutatxt_html) ChangeLog* config.h configure \
282 config.h.in skencil/*.pdf skencil/*.ps
287 mkdir -p $(BINDIR) && \
288 $(install_sh) -s -m 755 $(BINARIES) $(BINDIR) && \
289 mkdir -p $(FONTDIR) && \
290 $(install_sh) -m 644 $(FONTS) $(FONTDIR) && \
291 mkdir -p $(PICDIR) && \
292 $(install_sh) -m 644 $(PICS) $(PICDIR) && \
293 mkdir -p $(MANDIR) && \
294 $(install_sh) -m 644 $(MANS) $(MANDIR) \
295 mkdir -p $(VARDIR) > /dev/null 2>&1 || exit 0
297 @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: $(tarball_add) doc
298 rm -f $(tarball_pfx).tar.bz2
299 git-archive --format=tar --prefix=$(tarball_pfx)/ HEAD | tar --delete $(tarball_delete) > $(tarball_pfx).tar
301 cp -r $(tarball_add) $(tarball_pfx)
302 tar c doc/man | (cd $(tarball_pfx); tar x)
303 tar rf $(tarball_pfx).tar $(tarball_pfx)/*
304 rm -rf $(tarball_pfx)
305 bzip2 -9 $(tarball_pfx).tar
306 rm -f $(tarball_pfx).tar
307 ls -l $(tarball_pfx).tar.bz2
310 para_util changelog > $@
312 grutatxt -nb < $< > $@
314 rm -rf web/sync/HTML && gtags && htags -nF && mv HTML web/sync
317 web/header2.html: web/header.html
318 sed -e 's|href="|href="\.\.\/\.\./|g' \
319 -e 's|SRC="|SRC="\.\.\/\.\./|g' $< > $@
320 doxygen: web/header2.html
321 mkdir -p web/sync/doxygen
327 web/sync/%.html: web/%.in.html web/header.html web/footer.html web/sync
328 cat web/header.html $< web/footer.html > $@
329 web/sync/%.png: pics/web/%.png web/sync
331 web/sync/%.ico: pics/web/%.ico web/sync
333 web/sync/para.css: web/para.css web/sync
335 web/sync/versions/paraslash-git.tar.bz2: paraslash-git.tar.bz2 web/sync
336 cp -a versions web/sync && cp $< $@
337 web/sync/overview.pdf: skencil/overview.pdf web/sync
341 web/sync/%: pics/screenshots/%
343 skencil/%.ps: skencil/%.sk