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