Improve help/man page of para_recv.
[paraslash.git] / Makefile.in
1 prefix := @prefix@
2 exec_prefix := @exec_prefix@
3
4 BINDIR := @bindir@
5 VARDIR := /var/paraslash
6 PKGDATADIR := @datarootdir@/@PACKAGE_NAME@
7 MANDIR := @datarootdir@/man/man1
8
9 install_sh := @install_sh@
10
11 build_date := $(shell date)
12 uname_s := $(shell uname -s 2>/dev/null || echo "UNKNOWN_OS")
13 uname_rs := $(shell uname -rs)
14 cc_version := $(shell $(CC) --version | head -n 1)
15 codename := elliptic inheritance
16
17 DEBUG_CPPFLAGS += -Wno-sign-compare -g -Wunused -Wundef -W
18 DEBUG_CPPFLAGS += -Wredundant-decls
19 # produces false positives
20 # DEBUG_CPPFLAGS += -Wunreachable-code
21 # DEBUG_CPPFLAGS += -Wwrite-strings
22
23 # invalid option for gcc-3.3.3
24 # DEBUG_CPPFLAGS += -Wextra
25 # DEBUG_CPPFLAGS += -Wold-style-definition
26 # DEBUG_CPPFLAGS += -Wdeclaration-after-statement
27
28 # many warnings about trivial stuff
29 # CPPFLAGS += -Wconversion
30
31 ifeq ($(uname_s),Linux)
32 CPPFLAGS += -fdata-sections -ffunction-sections
33 LDFLAGS += -Wl,--gc-sections
34 CPPFLAGS += -Wstrict-prototypes
35 CPPFLAGS += -Wshadow
36 endif
37 CPPFLAGS += -Os
38 CPPFLAGS += -Wall
39 CPPFLAGS += -Wuninitialized
40 CPPFLAGS += -Wchar-subscripts
41 CPPFLAGS += -Wformat-security
42 CPPFLAGS += -DBINDIR='"$(BINDIR)"'
43 CPPFLAGS += -DBUILD_DATE='"$(build_date)"'
44 CPPFLAGS += -DUNAME_RS='"$(uname_rs)"'
45 CPPFLAGS += -DCODENAME='"$(codename)"'
46 CPPFLAGS += -DCC_VERSION='"$(cc_version)"'
47 CPPFLAGS += -Werror-implicit-function-declaration
48 CPPFLAGS += -Wmissing-format-attribute
49 CPPFLAGS += -Wmissing-noreturn
50 CPPFLAGS += -Wunused-macros
51 CPPFLAGS += -Wbad-function-cast
52 CPPFLAGS += -DMAIN_INPUT_FILE_IS_$(*F)
53 CPPFLAGS += @SSL_CPPFLAGS@
54 CPPFLAGS += @ncurses_cppflags@
55 CPPFLAGS += @arch_cppflags@
56
57 BINARIES = para_server para_client para_audioc para_recv \
58 para_filter para_write para_fsck para_afh @extra_binaries@
59 man_binaries := $(BINARIES)
60 man_pages := $(patsubst %, man/man1/%.1, $(man_binaries))
61 man_pages_in := $(patsubst %, web/%.man.in.html, $(man_binaries))
62 gengetopts := $(wildcard *.ggo)
63 gengetopts_c := $(gengetopts:.ggo=.cmdline.c)
64 gengetopts_h := $(gengetopts:.ggo=.cmdline.h)
65 autocrap := config.h.in configure
66 tarball_pfx := @PACKAGE_TARNAME@-@PACKAGE_VERSION@
67 tarball_delete = web versions pics .changelog_before_cvs .changelog_cvs .gitignore
68 tarball_delete := $(patsubst %,$(tarball_pfx)/%,$(tarball_delete))
69 tarball_add := $(gengetopts_c) $(gengetopts_h) $(autocrap)
70 tarball := @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2
71
72 .PHONY: clean distclean maintainer-clean install man tarball
73 all: $(BINARIES) $(man_pages)
74 man: $(man_pages)
75 tarball: $(tarball)
76
77 *.o: para.h config.h gcc-compat.h
78
79 include Makefile.deps
80
81 module_ggo_opts := --set-version="(@PACKAGE_STRING@, $(codename))"
82
83 grab_client.cmdline.h grab_client.cmdline.c: grab_client.ggo
84 gengetopt $(module_ggo_opts) \
85 -S \
86 --set-package=grab \
87 --no-handle-help \
88 --no-handle-error \
89 --no-handle-version \
90 --arg-struct-name=grab_client_args_info \
91 --file-name=$(subst .ggo,,$<).cmdline \
92 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
93
94 %_recv.cmdline.h %_recv.cmdline.c: %_recv.ggo
95 gengetopt $(module_ggo_opts) \
96 --set-package=$(subst .ggo,,$<) \
97 --arg-struct-name=$(subst .ggo,,$<)_args_info \
98 --file-name=$(subst .ggo,,$<).cmdline \
99 --func-name $(subst .ggo,,$<)_cmdline_parser < $<
100
101 %_filter.cmdline.h %_filter.cmdline.c: %_filter.ggo
102 gengetopt $(module_ggo_opts) \
103 --set-package=$(subst .ggo,,$<) \
104 --arg-struct-name=$(subst .ggo,,$<)_args_info \
105 --file-name=$(subst .ggo,,$<).cmdline \
106 --func-name $(subst _filter.ggo,,$<)_cmdline_parser < $<
107 %_write.cmdline.h %_write.cmdline.c: %_write.ggo
108 gengetopt -S $(module_ggo_opts) \
109 --set-package=$(subst .ggo,,$<) \
110 --arg-struct-name=$(subst .ggo,,$<)_args_info \
111 --file-name=$(subst .ggo,,$<).cmdline \
112 --func-name $(subst _write.ggo,,$<)_cmdline_parser < $<
113
114 %.cmdline.h %.cmdline.c: %.ggo
115 case $< in client.ggo) O="--unamed-opts=command";; \
116 audioc.ggo) O="--unamed-opts=command";; \
117 fsck.ggo) O="--unamed-opts=table";; \
118 afh.ggo) O="--unamed-opts=audio_file";; \
119 recv.ggo) O="--no-handle-help";; \
120 filter.ggo) O="--no-handle-help";; \
121 write.ggo) O="--no-handle-help";; \
122 esac; \
123 if test $< != fsck.ggo; then O="$$O --conf-parser "; fi; \
124 gengetopt $$O \
125 --no-handle-version \
126 --file-name=$(*F).cmdline \
127 --func-name $(*F)_cmdline_parser \
128 --arg-struct-name=$(*F)_args_info \
129 --set-package="para_$(subst .cmdline,,$(*F))" \
130 --set-version="@PACKAGE_VERSION@" < $<
131
132 %_command_list.c %_command_list.h: %.cmd
133 ./command_util.sh c < $< >$@
134 ./command_util.sh h < $< >$(@:%.c=%.h)
135
136 %_command_list.man: %.cmd
137 ./command_util.sh man < $< > $@
138
139 server_command_lists = server_command_list.man afs_command_list.man
140 man/man1/para_server.1: para_server $(server_command_lists)
141 mkdir -p man/man1
142 opts="-h --detailed-help -N `for i in $(server_command_lists); do printf "%s\n" "-i $$i"; done`"; \
143 help2man $$opts ./para_server > $@
144
145 man/man1/para_audiod.1: para_audiod audiod_command_list.man
146 mkdir -p man/man1
147 help2man -h --detailed-help -N -i audiod_command_list.man ./para_audiod > $@
148
149 man/man1/para_filter.1: para_filter
150 mkdir -p man/man1
151 help2man -h --detailed-help -N ./$< > $@
152
153 man/man1/para_write.1: para_write
154 mkdir -p man/man1
155 help2man -h --detailed-help -N ./$< > $@
156
157 man/man1/para_recv.1: para_recv
158 mkdir -p man/man1
159 help2man -h --detailed-help -N ./$< > $@
160
161 man/man1/%.1: %
162 mkdir -p man/man1
163 help2man -N ./$< > $@
164
165 man/html/%.html: man/man1/%.1
166 mkdir -p man/html
167 man2html $< > $@
168
169 web/%.man.in.html: man/man1/%.1
170 man2html $< | sed -e '/^<\/BODY>/,$$d' -e '1,/<\/HEAD><BODY>/d' > $@
171
172
173 ortp_recv.o: ortp_recv.c
174 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
175
176 ortp_send.o: ortp_send.c
177 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
178
179 oggdec_filter.o: oggdec_filter.c
180 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
181 ogg_afh.o: ogg_afh.c
182 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
183
184 mp3dec_filter.o: mp3dec_filter.c
185 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
186
187 aacdec_filter.o: aacdec_filter.c
188 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
189
190 aac_common.o: aac_common.c
191 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
192
193 aac_afh.o: aac_afh.c
194 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
195
196 %.cmdline.o: %.cmdline.c
197 $(CC) -c $(CPPFLAGS) $<
198
199 %.o: %.c
200 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
201
202 para_recv: @recv_objs@
203 $(CC) $(LDFLAGS) @recv_objs@ -o $@ @recv_ldflags@
204
205 para_filter: @filter_objs@
206 $(CC) $(LDFLAGS) @filter_objs@ -o $@ @filter_ldflags@
207
208 para_client: @client_objs@
209 $(CC) $(LDFLAGS) -o $@ @client_objs@ @client_ldflags@
210
211 para_gui: @gui_objs@
212 $(CC) $(LDFLAGS) -o $@ @gui_objs@ -lncurses
213
214 para_audiod: @audiod_objs@
215 $(CC) $(LDFLAGS) -o $@ @audiod_objs@ @audiod_ldflags@
216
217 para_audioc: @audioc_objs@
218 $(CC) $(LDFLAGS) -o $@ @audioc_objs@ @audioc_ldflags@
219
220 para_fade: @fade_objs@
221 $(CC) $(LDFLAGS) -o $@ @fade_objs@
222
223 para_server: @server_objs@
224 $(CC) $(LDFLAGS) -o $@ @server_objs@ @server_ldflags@
225
226 para_fsck: @fsck_objs@
227 $(CC) $(LDFLAGS) -o $@ @fsck_objs@ @fsck_ldflags@
228
229 para_write: @write_objs@
230 $(CC) $(LDFLAGS) -o $@ @write_objs@ @write_ldflags@
231
232 para_afh: @afh_objs@
233 $(CC) $(LDFLAGS) -o $@ @afh_objs@ @afh_ldflags@
234
235 clean:
236 rm -f *.o $(BINARIES)
237 rm -rf man
238 distclean: clean
239 rm -f Makefile autoscan.log config.status config.log && \
240 rm -rf web/sync/* autom4te.cache aclocal.m4
241 rm -f GPATH GRTAGS GSYMS GTAGS
242
243 maintainer-clean: distclean
244 rm -f $(gengetopts_c) $(gengetopts_h) *.tar.bz2 \
245 config.h configure \
246 config.h.in skencil/*.pdf skencil/*.ps
247 rm -f *_command_list.* *.man man/man1/*
248 rm -rf web_sync
249
250 install: all man
251 mkdir -p $(BINDIR) $(MANDIR)
252 $(install_sh) -s -m 755 $(BINARIES) $(BINDIR)
253 $(install_sh) -m 644 $(man_pages) $(MANDIR)
254 mkdir -p $(VARDIR) >/dev/null 2>&1 || true # not fatal, so don't complain
255
256 @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: $(tarball_add)
257 rm -rf $(tarball_pfx).tar.bz2 $(tarball_pfx)
258 git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
259 | tar --delete $(tarball_delete) > $(tarball_pfx).tar
260 mkdir $(tarball_pfx)
261 cp -r $(tarball_add) $(tarball_pfx)
262 tar rf $(tarball_pfx).tar $(tarball_pfx)/*
263 rm -rf $(tarball_pfx)
264 bzip2 -9 $(tarball_pfx).tar
265 rm -f $(tarball_pfx).tar
266 ls -l $(tarball_pfx).tar.bz2
267 %.ps: %.sk
268 sk2ps $< > $@
269 %.pdf: %.ps
270 ps2pdf - - < $< > $@
271