Add support for 'make help' in subdirectories
authorSimon Marlow <marlowsd@gmail.com>
Tue, 16 Jun 2009 08:53:41 +0000 (08:53 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 16 Jun 2009 08:53:41 +0000 (08:53 +0000)
Including help for directory-specific targets, such as 'make 1' in ghc

compiler/Makefile
ghc/Makefile
libraries/Makefile
mk/sub-makefile.mk

index aaecaf1..7618f68 100644 (file)
@@ -26,3 +26,12 @@ include $(TOP)/mk/sub-makefile.mk
 3:
        +$(TOPMAKE) stage=3 all_ghc_stage3 compiler_stage3_NO_BUILD_DEPS=YES OMIT_PHASE_1=YES OMIT_PHASE_2=YES OMIT_PHASE_3=YES
 
 3:
        +$(TOPMAKE) stage=3 all_ghc_stage3 compiler_stage3_NO_BUILD_DEPS=YES OMIT_PHASE_1=YES OMIT_PHASE_2=YES OMIT_PHASE_3=YES
 
+.PHONY: extra-help
+help : extra-help
+extra-help :
+       @echo "  make 1"
+       @echo "  make 2"
+       @echo "  make 3"
+       @echo
+       @echo "     Build the stage 1, 2 or 3 GHC respectively, omitting dependencies"
+       @echo "     and initial phases for speed."
index ea15e9d..7e6b416 100644 (file)
@@ -26,3 +26,12 @@ include $(TOP)/mk/sub-makefile.mk
 3:
        +$(TOPMAKE) stage=3 all_ghc_stage3 compiler_stage3_NO_BUILD_DEPS=YES
 
 3:
        +$(TOPMAKE) stage=3 all_ghc_stage3 compiler_stage3_NO_BUILD_DEPS=YES
 
+.PHONY: extra-help
+help : extra-help
+extra-help :
+       @echo "  make 1"
+       @echo "  make 2"
+       @echo "  make 3"
+       @echo
+       @echo "     Build the stage 1, 2 or 3 GHC respectively, omitting dependencies"
+       @echo "     and initial phases for speed."
index 238a73b..98cc8bf 100644 (file)
@@ -5,3 +5,11 @@ include $(TOP)/mk/sub-makefile.mk
 .PHONY: 1
 1 :
        +$(TOPMAKE) stage1_libs
 .PHONY: 1
 1 :
        +$(TOPMAKE) stage1_libs
+
+.PHONY: extra-help
+help : extra-help
+extra-help :
+       @echo "  make 1"
+       @echo
+       @echo "     Build all libraries that are built by the stage1 GHC"
+       @echo
index a1d1e9b..989c0c9 100644 (file)
@@ -30,7 +30,16 @@ STD_TARGETS = all clean distclean maintainer_clean install html ps pdf
 $(STD_TARGETS): 
        +$(TOPMAKE) $@_$(dir)
 
 $(STD_TARGETS): 
        +$(TOPMAKE) $@_$(dir)
 
-OTHERTARGETS=$(filter-out fast $(STD_TARGETS) $(SPEC_TARGETS),$(MAKECMDGOALS))
+OTHERTARGETS=$(filter-out fast help $(STD_TARGETS) $(SPEC_TARGETS),$(MAKECMDGOALS))
 .PHONY: $(OTHERTARGETS)
 $(OTHERTARGETS):
        +$(TOPMAKE) $(dir)/$@
 .PHONY: $(OTHERTARGETS)
 $(OTHERTARGETS):
        +$(TOPMAKE) $(dir)/$@
+
+.PHONY: help
+help : sub-help
+
+.PHONY: sub-help
+sub-help :
+       @echo "You are in subdirectory \"$(dir)\"."
+       @echo "Useful targets in this directory:"
+       @cat $(TOP)/SUBMAKEHELP