summaryrefslogtreecommitdiff
path: root/mk/sub-makefile.mk
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-06-16 08:53:41 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-06-16 08:53:41 +0000
commitf684f630a90eea64a13542c3bb0a1ab54a5067b7 (patch)
tree78dad3c53b00b6154a5898aee88b27bd007545af /mk/sub-makefile.mk
parent2dfd2ac773482f26e393a199e9d04fc9c23d5794 (diff)
downloadhaskell-f684f630a90eea64a13542c3bb0a1ab54a5067b7.tar.gz
Add support for 'make help' in subdirectories
Including help for directory-specific targets, such as 'make 1' in ghc
Diffstat (limited to 'mk/sub-makefile.mk')
-rw-r--r--mk/sub-makefile.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/mk/sub-makefile.mk b/mk/sub-makefile.mk
index a1d1e9b608..989c0c91b9 100644
--- a/mk/sub-makefile.mk
+++ b/mk/sub-makefile.mk
@@ -30,7 +30,16 @@ STD_TARGETS = all clean distclean maintainer_clean install html ps pdf
$(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: help
+help : sub-help
+
+.PHONY: sub-help
+sub-help :
+ @echo "You are in subdirectory \"$(dir)\"."
+ @echo "Useful targets in this directory:"
+ @cat $(TOP)/SUBMAKEHELP