overview.sk: update to 0.2.13
[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
105 *.o: para.h config.h gcc-compat.h
106
107 include Makefile.deps
108
109 V := ($(TGZ_PREFIX)@PACKAGE_STRING@, $(codename))\n$(COPYRIGHT)\n$(DISCLAIMER)
110 module_ggo_opts := --set-version="(@PACKAGE_STRING@, $(codename))"
111
112 grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
113 gengetopt $(module_ggo_opts) \
114 -S \
115 --set-package=grab \
116 --no-handle-help \
117 --no-handle-error \
118 --no-handle-version \
119 --arg-struct-name=grab_client_args_info \
120 --file-name=$(subst .ggo,,$<).cmdline \
121 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
122
123 %_recv.cmdline.h %_recv.cmdline.c: %_recv.ggo
124 gengetopt $(module_ggo_opts) \
125 --set-package=$(subst .ggo,,$<) \
126 --arg-struct-name=$(subst .ggo,,$<)_args_info \
127 --file-name=$(subst .ggo,,$<).cmdline \
128 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
129
130 %_filter.cmdline.h %_filter.cmdline.c: %_filter.ggo
131 gengetopt $(module_ggo_opts) \
132 --set-package=$(subst .ggo,,$<) \
133 --arg-struct-name=$(subst .ggo,,$<)_args_info \
134 --file-name=$(subst .ggo,,$<).cmdline \
135 --func-name $(subst _filter.ggo,,$<)_cmdline_parser < $<
136 %_write.cmdline.h %_write.cmdline.c: %_write.ggo
137 gengetopt -S $(module_ggo_opts) \
138 --set-package=$(subst .ggo,,$<) \
139 --arg-struct-name=$(subst .ggo,,$<)_args_info \
140 --file-name=$(subst .ggo,,$<).cmdline \
141 --func-name $(subst _write.ggo,,$<)_cmdline_parser < $<
142
143 %.cmdline.h %.cmdline.c: %.ggo
144 case $< in client.ggo) O="--unamed-opts=command --arg-struct-name=$(subst .ggo,,$<)_args_info";; \
145 audioc.ggo) O="--unamed-opts=command";; \
146 esac; \
147 gengetopt $$O --conf-parser --file-name=$(*F).cmdline --set-package="para_$(subst .cmdline,,$(*F))" --set-version="$V" < $<
148
149 aacdec.o: aacdec.c
150 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
151
152 aac_common.o: aac_common.c
153 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
154
155 aac_afh.o: aac_afh.c
156 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
157
158 para_recv: @recv_objs@
159 $(CC) @recv_objs@ -o $@ @recv_ldflags@
160
161 slider.o: slider.c
162 $(CC) -c -Wall -o $@ -g @GLIB_CFLAGS@ @GTK_CFLAGS@ $<
163
164 krell.o: krell.c
165 $(CC) -Wall -O -g -fPIC @GTK_CFLAGS@ -c -o $@ krell.c
166
167 mysql_selector.o: mysql_selector.c
168 $(CC) -Wall -O -g @mysql_cppflags@ -c -o $@ $<
169
170 %.cmdline.o: %.cmdline.c
171 $(CC) -c $(CPPFLAGS) $<
172 %.o: %.c
173 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
174
175 para_filter: @filter_objs@
176 $(CC) @filter_objs@ -o $@ @filter_ldflags@
177
178 para_slider: $(slider_objs)
179 $(CC) $(slider_objs) -o $@ @GTK_LIBS@ @GLIB_LIBS@ -lzmw
180
181 para_client: @client_objs@
182 $(CC) -o $@ @client_objs@ @client_ldflags@
183
184 para_gui: @gui_objs@
185 $(CC) -o $@ @gui_objs@ -lncurses
186
187 para_audiod: @audiod_objs@
188 $(CC) -o $@ @audiod_objs@ @audiod_ldflags@
189
190 para_audioc: @audioc_objs@
191 $(CC) -o $@ @audioc_objs@
192
193 para_dbadm: $(dbadm_objs)
194 $(CC) -o $@ $(dbadm_objs) -lncurses -lmenu
195
196 para_fade: $(fade_objs)
197 $(CC) -o $@ $(fade_objs)
198
199 para_server: @server_objs@
200 $(CC) -o $@ @server_objs@ @server_ldflags@
201
202 para_sdl_gui: $(sdl_gui_objs)
203 $(CC) -o $@ $(sdl_gui_objs) -lSDL_image
204
205 para_write: @write_objs@
206 $(CC) -o $@ @write_objs@ @write_ldflags@
207
208 para_krell.so: $(krell_objs)
209 $(CC) -Wall -fPIC @GTK_CFLAGS@ krell.o -o $@ @GTK_LIBS@ -shared
210
211 clean:
212 rm -f *.o $(BINARIES)
213
214 distclean: clean
215 rm -f Makefile autoscan.log config.status config.log && \
216 rm -rf web/sync/* autom4te.cache aclocal.m4
217 rm -f GPATH GRTAGS GSYMS GTAGS
218
219 maintainer-clean: distclean
220 rm -f $(gengetopts_c) $(gengetopts_h) *.tar.bz2 \
221 $(grutatxt_html) ChangeLog* config.h configure \
222 config.h.in skencil/*.pdf skencil/*.ps
223 rm -rf doc
224
225 install: all
226 umask 022 && \
227 mkdir -p $(BINDIR) $(VARDIR) && \
228 $(install_sh) -s -m 755 $(BINARIES) $(BINDIR) && \
229 mkdir -p $(FONTDIR) && \
230 $(install_sh) -m 644 $(FONTS) $(FONTDIR) && \
231 mkdir -p $(PICDIR) && \
232 $(install_sh) -m 644 $(PICS) $(PICDIR) && \
233 mkdir -p $(MANDIR) && \
234 $(install_sh) -m 644 $(MANS) $(MANDIR)
235
236 @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: $(tarball_add) doc
237 rm -f $(tarball_pfx).tar.bz2
238 git-tar-tree HEAD $(tarball_pfx) | tar --delete $(tarball_delete) > $(tarball_pfx).tar
239 mkdir $(tarball_pfx)
240 cp -r $(tarball_add) $(tarball_pfx)
241 tar c doc/man | (cd $(tarball_pfx); tar x)
242 tar rf $(tarball_pfx).tar $(tarball_pfx)/*
243 rm -rf $(tarball_pfx)
244 bzip2 -9 $(tarball_pfx).tar
245 rm -f $(tarball_pfx).tar
246 ls -l $(tarball_pfx).tar.bz2
247
248 ChangeLog:
249 para_util changelog > $@
250 web/%.in.html: %
251 grutatxt -nb < $< > $@
252 tags:
253 rm -rf web/sync/HTML && gtags && htags -nF && mv HTML web/sync
254 doc:
255 para_util doc
256 web/header2.html: web/header.html
257 sed -e 's|href="|href="\.\.\/\.\./|g' \
258 -e 's|SRC="|SRC="\.\.\/\.\./|g' $< > $@
259 doxygen: web/header2.html
260 mkdir -p web/sync/doxygen
261 doxygen
262 web/sync/doc: doc
263 cp -a $< $@
264 web/sync/doxygen:
265 mkdir -p $@
266 web/sync/%.html: web/%.in.html web/header.html web/footer.html web/sync
267 cat web/header.html $< web/footer.html > $@
268 web/sync/%.png: pics/web/%.png web/sync
269 cp $< $@
270 web/sync/%.ico: pics/web/%.ico web/sync
271 cp $< $@
272 web/sync/demo-script: scripts/demo-script web/sync
273 cp $< $@
274 web/sync/para.css: web/para.css web/sync
275 cp $< $@
276 web/sync/versions/paraslash-git.tar.bz2: paraslash-git.tar.bz2 web/sync
277 cp -a versions web/sync && cp $< $@
278 web/sync/overview.pdf: skencil/overview.pdf web/sync
279 cp $< $@
280 web/sync/%: %
281 cp -a $< $@
282 web/sync/%: pics/screenshots/%
283 cp $< $@
284 skencil/%.ps: skencil/%.sk
285 sk2ps $< > $@
286 %.pdf: %.ps
287 ps2pdf - - < $< > $@