Make the "show" target work anywhere in the build tree
authorIan Lynagh <igloo@earth.li>
Wed, 16 Jun 2010 12:29:10 +0000 (12:29 +0000)
committerIan Lynagh <igloo@earth.li>
Wed, 16 Jun 2010 12:29:10 +0000 (12:29 +0000)
SUBMAKEHELP
mk/sub-makefile.mk

index e680ef2..e109d89 100644 (file)
      
      Make documentation in this directory (if any)
 
+  make show VALUE=var
+
+     Show the value of $(var)
+
   make <file>
 
      Bring a particular file up to date, e.g. make dist/build/Module.o
index caeefa6..b69122d 100644 (file)
@@ -36,13 +36,17 @@ endif
 .NOTPARALLEL:
 
 STD_TARGETS = all clean distclean maintainer_clean install html ps pdf
+DIRECTORY_INDEPENDENT_TARGETS = show
 
 # The + tells make that we're recursively invoking make, otherwise 'make -j2'
 # goes wrong.
 $(STD_TARGETS): 
        +$(TOPMAKE) $@_$(dir) $(EXTRA_MAKE_OPTS)
 
-OTHERTARGETS=$(filter-out fast help $(STD_TARGETS) $(SPEC_TARGETS),$(MAKECMDGOALS))
+$(DIRECTORY_INDEPENDENT_TARGETS):
+       +$(TOPMAKE) $@ $(EXTRA_MAKE_OPTS)
+
+OTHERTARGETS=$(filter-out fast help show $(STD_TARGETS) $(SPEC_TARGETS),$(MAKECMDGOALS))
 .PHONY: $(OTHERTARGETS)
 $(OTHERTARGETS):
        +$(TOPMAKE) $(dir)/$@ $(EXTRA_MAKE_OPTS)