diff options
-rw-r--r-- | subdirs.mk | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2,6 +2,11 @@ export dir_symbol += - +USE_ABSOLUTE_TOPDIR ?= 0 +ifneq ($(USE_ABSOLUTE_TOPDIR),0) + TOPDIR_FOR_SUBDIR=$(shell pwd) +endif + nullstring := space := $(nullstring) # keep it to assign space @@ -9,6 +14,10 @@ subdirs: $(SUBDIRS) $(SUBDIRS): echo $(subst $(space),,$(dir_symbol))'|' $@ $(MAKECMDGOALS) +ifeq ($(USE_ABSOLUTE_TOPDIR),0) $(MAKE) -C $@ $(MAKECMDGOALS) +else + TOPDIR="$(TOPDIR_FOR_SUBDIR)" $(MAKE) -C $@ $(MAKECMDGOALS) +endif .PHONY: $(SUBDIRS) |