Merge branch 'master' into next
[paraslash.git] / ggo / makefile
1 module_ggo_opts := --set-version="($(PACKAGE_STRING), $(codename))"
2
3 %_recv.cmdline.h %_recv.cmdline.c: $(ggo_dir)/%_recv.ggo
4 gengetopt $(module_ggo_opts) \
5 --set-package=$(subst .ggo,,$(<F)) \
6 --arg-struct-name=$(subst .ggo,,$(<F))_args_info \
7 --file-name=$(subst .ggo,,$(<F)).cmdline \
8 --func-name $(subst .ggo,,$(<F))_cmdline_parser < $<
9
10 %_filter.cmdline.h %_filter.cmdline.c: $(ggo_dir)/%_filter.ggo
11 gengetopt $(module_ggo_opts) \
12 --set-package=$(subst .ggo,,$(<F)) \
13 --arg-struct-name=$(subst .ggo,,$(<F))_args_info \
14 --file-name=$(subst .ggo,,$(<F)).cmdline \
15 --func-name $(subst _filter.ggo,,$(<F))_cmdline_parser < $<
16 %_write.cmdline.h %_write.cmdline.c: $(ggo_dir)/%_write.ggo
17 gengetopt -S $(module_ggo_opts) \
18 --set-package=$(subst .ggo,,$(<F)) \
19 --arg-struct-name=$(subst .ggo,,$(<F))_args_info \
20 --file-name=$(subst .ggo,,$(<F)).cmdline \
21 --func-name $(subst _write.ggo,,$(<F))_cmdline_parser < $<
22
23 define ggo-opts
24 $(if $(filter recv filter write audiod,$(*F)), --no-handle-help) \
25 $(if $(filter afh,$(*F)), --unamed-opts=audio_file) \
26 $(if $(filter client audioc,$(*F)), --unamed-opts=command) \
27 $(if $(filter fsck,$(*F)), --unamed-opts=table, --conf-parser)\
28 --no-handle-version \
29 --file-name=$(*F).cmdline \
30 --func-name $(*F)_cmdline_parser \
31 --arg-struct-name=$(*F)_args_info \
32 --set-package="para_$(*F)" \
33 --set-version="$(PACKAGE_VERSION)"
34 endef
35
36 %.cmdline.h %.cmdline.c: $(ggo_dir)/%.ggo
37 gengetopt $(ggo-opts) < $<
38
39 $(ggo_dir)/server.ggo $(ggo_dir)/audiod.ggo: \
40 $(ggo_dir)/loglevel.m4 $(ggo_dir)/color.m4 \
41 $(ggo_dir)/config_file.m4 $(ggo_dir)/logfile.m4 \
42 $(ggo_dir)/daemon.m4 $(ggo_dir)/user.m4 \
43 $(ggo_dir)/group.m4
44
45 $(ggo_dir)/afh.ggo: $(ggo_dir)/loglevel.m4
46 $(ggo_dir)/audioc.ggo: $(ggo_dir)/loglevel.m4
47 $(ggo_dir)/filter.ggo: $(ggo_dir)/loglevel.m4
48 $(ggo_dir)/fsck.ggo: $(ggo_dir)/loglevel.m4
49 $(ggo_dir)/gui.ggo: $(ggo_dir)/loglevel.m4
50 $(ggo_dir)/recv.ggo: $(ggo_dir)/loglevel.m4
51 $(ggo_dir)/write.ggo: $(ggo_dir)/loglevel.m4
52 $(ggo_dir)/client.ggo: $(ggo_dir)/loglevel.m4 $(ggo_dir)/config_file.m4
53
54 $(ggo_dir)/%.ggo: $(ggo_dir)/%.m4 $(ggo_dir)/header.m4
55 cd $(ggo_dir); m4 $(<F) > $(@F)