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