Move gengetopt targets to own Makefile.
authorAndre Noll <maan@systemlinux.org>
Sat, 17 Jan 2009 18:59:35 +0000 (19:59 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 17 Jan 2009 18:59:35 +0000 (19:59 +0100)
Makefile.in
ggo/Makefile.ggo [new file with mode: 0644]

index baae37b..fc0ffa4 100644 (file)
@@ -5,7 +5,8 @@ BINDIR := @bindir@
 VARDIR := /var/paraslash
 PKGDATADIR := @datarootdir@/@PACKAGE_NAME@
 MANDIR := @datarootdir@/man/man1
-
+PACKAGE_VERSION := @PACKAGE_VERSION@
+PACKAGE_STRING := @PACKAGE_STRING@
 install_sh := @install_sh@
 
 build_date := $(shell date)
@@ -64,11 +65,11 @@ gengetopts := $(wildcard $(ggo_dir)/*.ggo)
 gengetopts_c := $(patsubst %/,, $(gengetopts:.ggo=.cmdline.c))
 gengetopts_h := $(patsubst %/,, $(gengetopts:.ggo=.cmdline.h))
 autocrap := config.h.in configure
-tarball_pfx := @PACKAGE_TARNAME@-@PACKAGE_VERSION@
+tarball_pfx := @PACKAGE_TARNAME@-$(PACKAGE_VERSION)
 tarball_delete = web versions pics .changelog_before_cvs .changelog_cvs .gitignore
 tarball_delete := $(patsubst %,$(tarball_pfx)/%,$(tarball_delete))
 tarball_add := $(gengetopts_c) $(gengetopts_h) $(autocrap)
-tarball := @PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2
+tarball := @PACKAGE_TARNAME@-$(PACKAGE_VERSION).tar.bz2
 
 .PHONY: clean distclean maintainer-clean install man tarball
 all: $(BINARIES) $(man_pages)
@@ -78,58 +79,7 @@ tarball: $(tarball)
 *.o: para.h config.h gcc-compat.h
 
 include Makefile.deps
-
-module_ggo_opts := --set-version="(@PACKAGE_STRING@, $(codename))"
-
-grab_client.cmdline.h grab_client.cmdline.c: $(ggo_dir)/grab_client.ggo
-       gengetopt $(module_ggo_opts) \
-               -S \
-               --set-package=grab \
-               --no-handle-help \
-               --no-handle-error \
-               --no-handle-version \
-               --arg-struct-name=grab_client_args_info \
-               --file-name=$(subst .ggo,,$(<F)).cmdline \
-               --func-name $(subst .ggo,,$(<F))_cmdline_parser < $<
-
-%_recv.cmdline.h %_recv.cmdline.c: $(ggo_dir)/%_recv.ggo
-       gengetopt $(module_ggo_opts) \
-               --set-package=$(subst .ggo,,$(<F)) \
-               --arg-struct-name=$(subst .ggo,,$(<F))_args_info \
-               --file-name=$(subst .ggo,,$(<F)).cmdline \
-               --func-name $(subst .ggo,,$(<F))_cmdline_parser < $<
-
-%_filter.cmdline.h %_filter.cmdline.c: $(ggo_dir)/%_filter.ggo
-       gengetopt $(module_ggo_opts) \
-               --set-package=$(subst .ggo,,$(<F)) \
-               --arg-struct-name=$(subst .ggo,,$(<F))_args_info \
-               --file-name=$(subst .ggo,,$(<F)).cmdline \
-               --func-name $(subst _filter.ggo,,$(<F))_cmdline_parser < $<
-%_write.cmdline.h %_write.cmdline.c: $(ggo_dir)/%_write.ggo
-       gengetopt -S $(module_ggo_opts) \
-               --set-package=$(subst .ggo,,$(<F)) \
-               --arg-struct-name=$(subst .ggo,,$(<F))_args_info \
-               --file-name=$(subst .ggo,,$(<F)).cmdline \
-               --func-name $(subst _write.ggo,,$(<F))_cmdline_parser < $<
-
-%.cmdline.h %.cmdline.c: $(ggo_dir)/%.ggo
-       case $(<F) in client.ggo) O="--unamed-opts=command";; \
-               audioc.ggo) O="--unamed-opts=command";; \
-               fsck.ggo) O="--unamed-opts=table";; \
-               afh.ggo) O="--unamed-opts=audio_file";; \
-               recv.ggo) O="--no-handle-help";; \
-               filter.ggo) O="--no-handle-help";; \
-               write.ggo) O="--no-handle-help";; \
-               audiod.ggo) O="--no-handle-help";; \
-       esac; \
-       if test $(<F) != fsck.ggo; then O="$$O --conf-parser "; fi; \
-       gengetopt $$O \
-               --no-handle-version \
-               --file-name=$(*F).cmdline \
-               --func-name $(*F)_cmdline_parser \
-               --arg-struct-name=$(*F)_args_info \
-               --set-package="para_$(subst .cmdline,,$(*F))" \
-               --set-version="@PACKAGE_VERSION@"  < $<
+include $(ggo_dir)/Makefile.ggo
 
 %_command_list.c %_command_list.h: %.cmd
        ./command_util.sh c < $< >$@
@@ -249,7 +199,7 @@ install: all man
        $(install_sh) -m 644 $(man_pages) $(MANDIR)
        mkdir -p $(VARDIR) >/dev/null 2>&1 || true # not fatal, so don't complain
 
-@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.bz2: $(tarball_add)
+@PACKAGE_TARNAME@-$(PACKAGE_VERSION).tar.bz2: $(tarball_add)
        rm -rf $(tarball_pfx).tar.bz2 $(tarball_pfx)
        git archive --format=tar --prefix=$(tarball_pfx)/ HEAD \
                | tar --delete $(tarball_delete) > $(tarball_pfx).tar
diff --git a/ggo/Makefile.ggo b/ggo/Makefile.ggo
new file mode 100644 (file)
index 0000000..e1b232e
--- /dev/null
@@ -0,0 +1,52 @@
+module_ggo_opts := --set-version="($(PACKAGE_STRING), $(codename))"
+
+grab_client.cmdline.h grab_client.cmdline.c: $(ggo_dir)/grab_client.ggo
+       gengetopt $(module_ggo_opts) \
+               -S \
+               --set-package=grab \
+               --no-handle-help \
+               --no-handle-error \
+               --no-handle-version \
+               --arg-struct-name=grab_client_args_info \
+               --file-name=$(subst .ggo,,$(<F)).cmdline \
+               --func-name $(subst .ggo,,$(<F))_cmdline_parser < $<
+
+%_recv.cmdline.h %_recv.cmdline.c: $(ggo_dir)/%_recv.ggo
+       gengetopt $(module_ggo_opts) \
+               --set-package=$(subst .ggo,,$(<F)) \
+               --arg-struct-name=$(subst .ggo,,$(<F))_args_info \
+               --file-name=$(subst .ggo,,$(<F)).cmdline \
+               --func-name $(subst .ggo,,$(<F))_cmdline_parser < $<
+
+%_filter.cmdline.h %_filter.cmdline.c: $(ggo_dir)/%_filter.ggo
+       gengetopt $(module_ggo_opts) \
+               --set-package=$(subst .ggo,,$(<F)) \
+               --arg-struct-name=$(subst .ggo,,$(<F))_args_info \
+               --file-name=$(subst .ggo,,$(<F)).cmdline \
+               --func-name $(subst _filter.ggo,,$(<F))_cmdline_parser < $<
+%_write.cmdline.h %_write.cmdline.c: $(ggo_dir)/%_write.ggo
+       gengetopt -S $(module_ggo_opts) \
+               --set-package=$(subst .ggo,,$(<F)) \
+               --arg-struct-name=$(subst .ggo,,$(<F))_args_info \
+               --file-name=$(subst .ggo,,$(<F)).cmdline \
+               --func-name $(subst _write.ggo,,$(<F))_cmdline_parser < $<
+
+%.cmdline.h %.cmdline.c: $(ggo_dir)/%.ggo
+       case $(<F) in client.ggo) O="--unamed-opts=command";; \
+               audioc.ggo) O="--unamed-opts=command";; \
+               fsck.ggo) O="--unamed-opts=table";; \
+               afh.ggo) O="--unamed-opts=audio_file";; \
+               recv.ggo) O="--no-handle-help";; \
+               filter.ggo) O="--no-handle-help";; \
+               write.ggo) O="--no-handle-help";; \
+               audiod.ggo) O="--no-handle-help";; \
+       esac; \
+       if test $(<F) != fsck.ggo; then O="$$O --conf-parser "; fi; \
+       gengetopt $$O \
+               --no-handle-version \
+               --file-name=$(*F).cmdline \
+               --func-name $(*F)_cmdline_parser \
+               --arg-struct-name=$(*F)_args_info \
+               --set-package="para_$(subst .cmdline,,$(*F))" \
+               --set-version="$(PACKAGE_VERSION)"  < $<
+