]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/stepmake/help2man-rules.make
* stepmake/stepmake/*:
[lilypond.git] / stepmake / stepmake / help2man-rules.make
index bf059e4a682f0208063a1d729f97f7c016b91bd6..51073c20b1e183aad51a215d54a13c73fa053159 100644 (file)
@@ -1,8 +1,3 @@
-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
 # must be built first.
@@ -20,12 +15,21 @@ 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 = $(PERL) $(top-build-dir)/buildscripts/$(outbase)/help2man $< > $@
 
+ifeq ($(strip $(CROSS)),no)
 $(outdir)/%.1: $(outdir)/%
-       @echo "generating man page from $< --help"
-       @echo "$(HELP2MAN_COMMAND)"
-       @$(HELP2MAN_COMMAND) || \
-       (echo ""; echo "Apparently the man pages failed to build. This is";\
-       echo "no problem, since they don't contain any information anyway.";\
-       echo "Please run make again, and be prepared for NO manual pages.")
+       $(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