Improve help/man page of para_write.
[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 filter.ggo) O="--no-handle-help";; \
120 write.ggo) O="--no-handle-help";; \
121 esac; \
122 if test $< != fsck.ggo; then O="$$O --conf-parser "; fi; \
123 gengetopt $$O \
124 --no-handle-version \
125 --file-name=$(*F).cmdline \
126 --func-name $(*F)_cmdline_parser \
127 --arg-struct-name=$(*F)_args_info \
128 --set-package="para_$(subst .cmdline,,$(*F))" \
129 --set-version="@PACKAGE_VERSION@" < $<
130
131 %_command_list.c %_command_list.h: %.cmd
132 ./command_util.sh c < $< >$@
133 ./command_util.sh h < $< >$(@:%.c=%.h)
134
135 %_command_list.man: %.cmd
136 ./command_util.sh man < $< > $@
137
138 server_command_lists = server_command_list.man afs_command_list.man
139 man/man1/para_server.1: para_server $(server_command_lists)
140 mkdir -p man/man1
141 opts="-h --detailed-help -N `for i in $(server_command_lists); do printf "%s\n" "-i $$i"; done`"; \
142 help2man $$opts ./para_server > $@
143
144 man/man1/para_audiod.1: para_audiod audiod_command_list.man
145 mkdir -p man/man1
146 help2man -h --detailed-help -N -i audiod_command_list.man ./para_audiod > $@
147
148 man/man1/para_filter.1: para_filter
149 mkdir -p man/man1
150 help2man -h --detailed-help -N ./$< > $@
151
152 man/man1/para_write.1: para_write
153 mkdir -p man/man1
154 help2man -h --detailed-help -N ./$< > $@
155
156 man/man1/%.1: %
157 mkdir -p man/man1
158 help2man -N ./$< > $@
159
160 man/html/%.html: man/man1/%.1
161 mkdir -p man/html
162 man2html $< > $@
163
164 web/%.man.in.html: man/man1/%.1
165 man2html $< | sed -e '/^<\/BODY>/,$$d' -e '1,/<\/HEAD><BODY>/d' > $@
166
167
168 ortp_recv.o: ortp_recv.c
169 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
170
171 ortp_send.o: ortp_send.c
172 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @ortp_cppflags@ $<
173
174 oggdec_filter.o: oggdec_filter.c
175 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
176 ogg_afh.o: ogg_afh.c
177 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @oggvorbis_cppflags@ $<
178
179 mp3dec_filter.o: mp3dec_filter.c
180 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
181
182 aacdec_filter.o: aacdec_filter.c
183 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
184
185 aac_common.o: aac_common.c
186 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
187
188 aac_afh.o: aac_afh.c
189 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
190
191 %.cmdline.o: %.cmdline.c
192 $(CC) -c $(CPPFLAGS) $<
193
194 %.o: %.c
195 $(CC) -c $(CPPFLAGS) $(DEBUG_CPPFLAGS) $<
196
197 para_recv: @recv_objs@
198 $(CC) $(LDFLAGS) @recv_objs@ -o $@ @recv_ldflags@
199
200 para_filter: @filter_objs@
201 $(CC) $(LDFLAGS) @filter_objs@ -o $@ @filter_ldflags@
202
203 para_client: @client_objs@
204 $(CC) $(LDFLAGS) -o $@ @client_objs@ @client_ldflags@
205
206 para_gui: @gui_objs@
207 $(CC) $(LDFLAGS) -o $@ @gui_objs@ -lncurses
208
209 para_audiod: @audiod_objs@
210 $(CC) $(LDFLAGS) -o $@ @audiod_objs@ @audiod_ldflags@
211
212 para_audioc: @audioc_objs@
213 $(CC) $(LDFLAGS) -o $@ @audioc_objs@ @audioc_ldflags@
214
215 para_fade: @fade_objs@
216 $(CC) $(LDFLAGS) -o $@ @fade_objs@
217
218 para_server: @server_objs@
219 $(CC) $(LDFLAGS) -o $@ @server_objs@ @server_ldflags@
220
221 para_fsck: @fsck_objs@
222 $(CC) $(LDFLAGS) -o $@ @fsck_objs@ @fsck_ldflags@
223
224 para_write: @write_objs@
225 $(CC) $(LDFLAGS) -o $@ @write_objs@ @write_ldflags@
226
227 para_afh: @afh_objs@
228 $(CC) $(LDFLAGS) -o $@ @afh_objs@ @afh_ldflags@
229
230 clean:
231 rm -f *.o $(BINARIES)
232 rm -rf man
233 distclean: clean
234 rm -f Makefile autoscan.log config.status config.log && \
235 rm -rf web/sync/* autom4te.cache aclocal.m4
236 rm -f GPATH GRTAGS GSYMS GTAGS
237
238 maintainer-clean: distclean
239 rm -f $(gengetopts_c) $(gengetopts_h) *.tar.bz2 \
240 config.h configure \
241 config.h.in skencil/*.pdf skencil/*.ps
242 rm -f *_command_list.* *.man man/man1/*
243 rm -rf web_sync
244
245 install: all man
246 mkdir -p $(BINDIR) $(MANDIR)
247 $(install_sh) -s -m 755 $(BINARIES) $(BINDIR)
248 $(install_sh) -m 644 $(man_pages) $(MANDIR)
249 mkdir -p $(VARDIR) >/dev/null 2>&1 || true # not fatal, so don't complain
250
251 @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: $(tarball_add)
252 rm -rf $(tarball_pfx).tar.bz2 $(tarball_pfx)
253 git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
254 | tar --delete $(tarball_delete) > $(tarball_pfx).tar
255 mkdir $(tarball_pfx)
256 cp -r $(tarball_add) $(tarball_pfx)
257 tar rf $(tarball_pfx).tar $(tarball_pfx)/*
258 rm -rf $(tarball_pfx)
259 bzip2 -9 $(tarball_pfx).tar
260 rm -f $(tarball_pfx).tar
261 ls -l $(tarball_pfx).tar.bz2
262 %.ps: %.sk
263 sk2ps $< > $@
264 %.pdf: %.ps
265 ps2pdf - - < $< > $@
266