]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/stepmake/help2man-rules.make
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / stepmake / stepmake / help2man-rules.make
index 10b668d36a5e820685341b6efa7a0f024b7e10a7..e0498b01488c23ad051e55442967df27183471b0 100644 (file)
@@ -1,10 +1,5 @@
-ifneq ($(outdir),./out)
-$(outdir)/%.1: out/%.1
-       cp $< $@
-endif
-
 # We must invoke the generated $(outdir)/help2man script instead of
-# the help2man.pl source, which means that the buildscripts directory
+# the help2man.pl source, which means that the scripts/build directory
 # must be built first.
 #
 # From the perlrun man-page:
@@ -20,7 +15,24 @@ endif
 # cases.  Four more explaining what a line comment is, and that it may
 # be parsed, same here.
 
-HELP2MAN_COMMAND = $(PERL) $(builddir)/buildscripts/$(outbase)/help2man $< > $@
+HELP2MAN_COMMAND = $(buildscript-dir)/help2man $< > $@
 
-$(outdir)/%.1: $(outdir)/%
+ifeq ($(strip $(CROSS)),no)
+$(outdir)/%.1: $(outdir)/% $(buildscript-dir)/help2man
        $(HELP2MAN_COMMAND)
+else
+# When cross building, some manpages will not build because the
+# executable does not run.  We assume the manpages to be generated
+# during a previous compile for the build host, with config=for-build,
+# in the directory $(outdir)-for-build.
+$(outdir)/%.1: $(outdir:%=%-for-build)/%.1
+       cp $< $@
+endif
+
+ifneq ($(outdir),./out)
+$(outdir)/%.1: out/%.1
+       cp $< $@
+endif
+
+$(buildscript-dir)/help2man:
+       $(MAKE) -C $(depth)/scripts/build