diff --git a/Directory.mk b/Directory.mk index 82bb719c7..b0d475778 100644 --- a/Directory.mk +++ b/Directory.mk @@ -46,7 +46,7 @@ all: nothing define SDIR_template $(1)_$(2): - $(Q) cd $(1) $(MAKE) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" + $(Q) cd $(1) && $(MAKE) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" endef $(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),preconfig))) diff --git a/Makefile b/Makefile index 4093b0ed7..e5cdd6d72 100644 --- a/Makefile +++ b/Makefile @@ -79,13 +79,13 @@ all: $(BIN) .PHONY: import install dirlinks context context_serialize context_rest .depdirs preconfig depend clean distclean define MAKE_template - $(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)" + $(Q) cd $(1) && $(MAKE) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)" endef define SDIR_template $(1)_$(2): - $(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)" + $(Q) cd $(1) && $(MAKE) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)" endef