alsa: Improve help text of --device.
[paraslash.git] / m4 / gengetopt / makefile
index 79e101a3e4e88f3e55b096b90780615b82b2e602..ada70d198b496abc98fb5ed462180f81d4c0d99a 100644 (file)
@@ -25,3 +25,14 @@ $(m4depdir)/%.m4d: $(m4_ggo_dir)/%.m4 | $(m4depdir)
 $(ggo_dir)/%.ggo: $(m4_ggo_dir)/%.m4 $(m4_ggo_dir)/header.m4 | $(ggo_dir)
        @[ -z "$(Q)" ] || echo 'M4 $<'
        $(Q) m4 -I $(m4_ggo_dir) $< > $@
+
+$(help2man_dir)/para_%: $(ggo_dir)/%.ggo | $(help2man_dir)
+       @[ -z "$(Q)" ] || echo 'G2X $<'
+       $(Q) printf "#!/bin/sh\nif [ \"\$$1\" = '--version' ]; then \
+                       $(GENGETOPT) $(ggo_opts) --show-version < $<; \
+               elif [ \"\$$1\" = '--help' ]; then \
+                       $(GENGETOPT)  $(ggo_opts) --show-detailed-help < $<; \
+               else \
+                       exit 1; \
+               fi\n" > $@.tmp
+       $(Q) chmod 755 $@.tmp && mv $@.tmp $@