]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/stepmake/help2man-rules.make
51073c20b1e183aad51a215d54a13c73fa053159
[lilypond.git] / stepmake / stepmake / help2man-rules.make
1 # We must invoke the generated $(outdir)/help2man script instead of
2 # the help2man.pl source, which means that the buildscripts directory
3 # must be built first.
4 #
5 # From the perlrun man-page:
6 #
7 #       If the #! line does not contain the word "perl", the
8 #       program named after the #! is executed instead of the Perl
9 #       interpreter.  This is slightly bizarre, but it helps
10 #
11 # Indeed it is.  Perl sucks.
12 #
13 # Two screenfulls explaining that the otherwise standard #! is broken
14 # for perl, and arguing that this broken magic is better in some
15 # cases.  Four more explaining what a line comment is, and that it may
16 # be parsed, same here.
17
18 HELP2MAN_COMMAND = $(PERL) $(top-build-dir)/buildscripts/$(outbase)/help2man $< > $@
19
20 ifeq ($(strip $(CROSS)),no)
21 $(outdir)/%.1: $(outdir)/%
22         $(HELP2MAN_COMMAND)
23 else
24 # When cross building, some manpages will not build because the
25 # executable does not run.  We assume the manpages to be generated
26 # during a previous compile for the build host, with config=for-build,
27 # in the directory $(outdir)-for-build.
28 $(outdir)/%.1: $(outdir:%=%-for-build)/%.1
29         cp $< $@
30 endif
31
32 ifneq ($(outdir),./out)
33 $(outdir)/%.1: out/%.1
34         cp $< $@
35 endif