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