X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=stepmake%2Fstepmake%2Fhelp2man-rules.make;h=9e2f042128d0fd8a6d00ae6a6698d7f7b14fb2af;hb=121b05751a34e19400dfc5e380fed1d0bff5029e;hp=0f4559ae30091295e042a86327806d3fc6d09a5d;hpb=6d641c68de8b3ea29f95ee0c3ea5aaeb3ca7a098;p=lilypond.git diff --git a/stepmake/stepmake/help2man-rules.make b/stepmake/stepmake/help2man-rules.make index 0f4559ae30..9e2f042128 100644 --- a/stepmake/stepmake/help2man-rules.make +++ b/stepmake/stepmake/help2man-rules.make @@ -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,18 +15,29 @@ 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 $< > $@ +ifeq ($(PYTHON),$(TARGET_PYTHON)) +HELP2MAN_COMMAND = $(buildscript-dir)/help2man $< > $@ +else +HELP2MAN_COMMAND = $(buildscript-dir)/help2man "env $$(basename $$(head -1 $<)) $<" > $@ +endif -ifeq ($(cross),)) -$(outdir)/%.1: $(outdir)/% +ifeq ($(strip $(CROSS)),no) +$(outdir)/%.1: $(outdir)/% $(buildscript-dir)/help2man + echo $(buildscript-dir)/help2man $(HELP2MAN_COMMAND) else -# When cross building, some manpages will not build because the executable -# does not run. We don not want to disable building manpages, because -# the cross build process may generate them using a native executable. -$(outdir)/%.1: $(outdir)/% - $(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.") +# 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