09ccf503864f0d5d4d499e61bf4b41d2777ca735
[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
93 all: $(BINARIES)
94 www: $(gen_html) $(gruta_html) $(web_pics) $(web_misc) $(shots) tags doxygen doc
95
96 client_objs = client.cmdline.o client.o net.o string.o crypt.o
97 sdl_gui_objs = sdl_gui.cmdline.o SFont.o sdl_gui.o gui_common.o exec.o \
98 close_on_fork.o string.o stat.o fd.o
99 dbadm_objs = dbadm.o exec.o close_on_fork.o string.o
100 fade_objs = fade.cmdline.o fade.o exec.o close_on_fork.o string.o fd.o
101 krell_objs = krell.o string.o
102 slider_objs = slider.o string.o
103 audioc_objs = audioc.cmdline.o audioc.o string.o net.o fd.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 --set-package=grab \
115 --no-handle-help \
116 --no-handle-error \
117 --no-handle-version \
118 --arg-struct-name=grab_client_args_info \
119 --file-name=$(subst .ggo,,$<).cmdline \
120 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
121
122 %_recv.cmdline.h %_recv.cmdline.c: %_recv.ggo
123 gengetopt $(module_ggo_opts) \
124 --set-package=$(subst .ggo,,$<) \
125 --arg-struct-name=$(subst .ggo,,$<)_args_info \
126 --file-name=$(subst .ggo,,$<).cmdline \
127 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
128
129 %_filter.cmdline.h %_filter.cmdline.c: %_filter.ggo
130 gengetopt $(module_ggo_opts) \
131 --set-package=$(subst .ggo,,$<) \
132 --arg-struct-name=$(subst .ggo,,$<)_args_info \
133 --file-name=$(subst .ggo,,$<).cmdline \
134 --func-name $(subst _filter.ggo,,$<)_cmdline_parser < $<
135
136 %.cmdline.h %.cmdline.c: %.ggo
137 case $< in client.ggo) O="--unamed-opts=command";; \
138 audioc.ggo) O="--unamed-opts=command";; \
139 esac; \
140 gengetopt $$O --conf-parser --file-name=$(*F).cmdline --set-package="para_$(subst .cmdline,,$(*F))" --set-version="$V" < $<
141
142 para_recv: @recv_objs@
143 $(CC) @recv_objs@ -o $@ @recv_ldflags@
144
145 slider.o: slider.c
146 $(CC) -c -Wall -o $@ -g @GLIB_CFLAGS@ @GTK_CFLAGS@ $<
147
148 krell.o: krell.c
149 $(CC) -Wall -O -g -fPIC @GTK_CFLAGS@ -c -o $@ krell.c
150
151 mysql_selector.o: mysql_selector.c
152 $(CC) -Wall -O -g @mysql_cppflags@ -c -o $@ $<
153
154 %.cmdline.o: %.cmdline.c
155 $(CC) -c $(CPPFLAGS) $<
156 %.o: %.c
157 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
158
159 para_filter: @filter_objs@
160 $(CC) @filter_objs@ -o $@ @filter_ldflags@
161
162 para_slider: $(slider_objs)
163 $(CC) $(slider_objs) -o $@ @GTK_LIBS@ @GLIB_LIBS@ -lzmw
164
165 para_client: $(client_objs)
166 $(CC) -o $@ $(client_objs) $(SSL_LDFLAGS) $(SSL_LIBS)
167
168 para_gui: @gui_objs@
169 $(CC) -o $@ @gui_objs@ -lncurses
170
171 para_audiod: @audiod_objs@
172 $(CC) -o $@ @audiod_objs@ @audiod_ldflags@
173
174 para_audioc: $(audioc_objs)
175 $(CC) -o $@ $(audioc_objs)
176
177 para_dbadm: $(dbadm_objs)
178 $(CC) -o $@ $(dbadm_objs) -lncurses -lmenu
179
180 para_fade: $(fade_objs)
181 $(CC) -o $@ $(fade_objs)
182
183 para_server: @server_objs@
184 $(CC) -o $@ @server_objs@ @server_ldflags@
185
186 para_sdl_gui: $(sdl_gui_objs)
187 $(CC) -o $@ $(sdl_gui_objs) -lSDL_image
188
189 para_write: @write_objs@
190 $(CC) -o $@ @write_objs@ @write_ldflags@
191
192 para_krell.so: $(krell_objs)
193 $(CC) -Wall -fPIC @GTK_CFLAGS@ krell.o -o $@ @GTK_LIBS@ -shared
194
195 clean:
196 rm -f *.o $(BINARIES)
197
198 distclean: clean
199 rm -f Makefile autoscan.log config.status config.log && \
200 rm -rf web/sync/* autom4te.cache aclocal.m4
201 rm -f GPATH GRTAGS GSYMS GTAGS
202
203 maintainer-clean: distclean
204 rm -f $(gengetopts_c) $(gengetopts_h) *.tar.bz2 \
205 $(grutatxt_html) ChangeLog* config.h configure \
206 config.h.in skencil/*.pdf skencil/*.ps
207 rm -rf doc
208
209 install: all
210 umask 022 && \
211 mkdir -p $(BINDIR) $(VARDIR) && \
212 $(install_sh) -s -m 755 $(BINARIES) $(BINDIR) && \
213 mkdir -p $(FONTDIR) && \
214 $(install_sh) -m 644 $(FONTS) $(FONTDIR) && \
215 mkdir -p $(PICDIR) && \
216 $(install_sh) -m 644 $(PICS) $(PICDIR) && \
217 mkdir -p $(MANDIR) && \
218 $(install_sh) -m 644 $(MANS) $(MANDIR)
219
220 @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: $(tarball_add) doc
221 rm -f $(tarball_pfx).tar.bz2
222 git-tar-tree HEAD $(tarball_pfx) | tar --delete $(tarball_delete) > $(tarball_pfx).tar
223 mkdir $(tarball_pfx)
224 cp -r $(tarball_add) $(tarball_pfx)
225 tar c doc/man | (cd $(tarball_pfx); tar x)
226 tar rf $(tarball_pfx).tar $(tarball_pfx)/*
227 rm -rf $(tarball_pfx)
228 bzip2 -9 $(tarball_pfx).tar
229 rm -f $(tarball_pfx).tar
230 ls -l $(tarball_pfx).tar.bz2
231
232 ChangeLog:
233 para_util changelog > $@
234 web/%.in.html: %
235 grutatxt -nb < $< > $@
236 tags:
237 rm -rf web/sync/HTML && gtags && htags -nF && mv HTML web/sync
238 doc:
239 para_util doc
240 web/header2.html: web/header.html
241 sed -e 's|href="|href="\.\.\/\.\./|g' \
242 -e 's|SRC="|SRC="\.\.\/\.\./|g' $< > $@
243 doxygen: web/header2.html
244 mkdir -p web/sync/doxygen
245 doxygen
246 web/sync/doc: doc
247 cp -a $< $@
248 web/sync/doxygen:
249 mkdir -p $@
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 -a $< $@
266 web/sync/%: pics/screenshots/%
267 cp $< $@
268 skencil/%.ps: skencil/%.sk
269 sk2ps $< > $@
270 %.pdf: %.ps
271 ps2pdf - - < $< > $@