diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2020-08-29 22:58:58 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2020-08-29 22:58:58 -0400 |
commit | f08649b6aa6c359c0ed5903c5809a8e7dfbf83b0 (patch) | |
tree | fa3aac43f720745a93f2db6e21d67961d03223e4 /subdirs.mk | |
parent | 2c6ad4d51f5625c30bab0c4ca8a19c2e44c1a7a7 (diff) | |
download | makefile_templates-f08649b6aa6c359c0ed5903c5809a8e7dfbf83b0.tar.gz makefile_templates-f08649b6aa6c359c0ed5903c5809a8e7dfbf83b0.zip |
allow to pass absolute topdir to subdirs targets
Diffstat (limited to 'subdirs.mk')
-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) |