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