]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/help2man-rules.make
bf059e4a682f0208063a1d729f97f7c016b91bd6
[lilypond.git] / stepmake / stepmake / help2man-rules.make
1 ifneq ($(outdir),./out)
2 $(outdir)/%.1: out/%.1
3         cp $< $@
4 endif
5
6 # We must invoke the generated $(outdir)/help2man script instead of
7 # the help2man.pl source, which means that the buildscripts directory
8 # must be built first.
9 #
10 # From the perlrun man-page:
11 #
12 #       If the #! line does not contain the word "perl", the
13 #       program named after the #! is executed instead of the Perl
14 #       interpreter.  This is slightly bizarre, but it helps
15 #
16 # Indeed it is.  Perl sucks.
17 #
18 # Two screenfulls explaining that the otherwise standard #! is broken
19 # for perl, and arguing that this broken magic is better in some
20 # cases.  Four more explaining what a line comment is, and that it may
21 # be parsed, same here.
22
23 HELP2MAN_COMMAND = $(PERL) $(builddir)/buildscripts/$(outbase)/help2man $< > $@
24
25 $(outdir)/%.1: $(outdir)/%
26         @echo "generating man page from $< --help"
27         @echo "$(HELP2MAN_COMMAND)"
28         @$(HELP2MAN_COMMAND) || \
29         (echo ""; echo "Apparently the man pages failed to build. This is";\
30         echo "no problem, since they don't contain any information anyway.";\
31         echo "Please run make again, and be prepared for NO manual pages.")