From 404b330c25567923de8434e34dd1dbe8ccf59b8b Mon Sep 17 00:00:00 2001 From: liuhaitao Date: Thu, 27 Feb 2020 07:45:37 -0300 Subject: [PATCH] Ensure "build" before "install" Signed-off-by: liuhaitao --- examples/module/drivers/Makefile | 8 ++++---- examples/module/drivers/chardev/Makefile | 2 +- examples/nxflat/tests/Makefile | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/module/drivers/Makefile b/examples/module/drivers/Makefile index 45a7b11c0..bddb359d9 100644 --- a/examples/module/drivers/Makefile +++ b/examples/module/drivers/Makefile @@ -58,16 +58,16 @@ else ifeq ($(CONFIG_EXAMPLES_MODULE_CROMFS),y) endif define DIR_template -$(1)_$(2): +$(1)_$(2): $(4) +$(Q) $(MAKE) -C $(1) $(3) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" FSROOT_DIR="$(FSROOT_DIR)" CROSSDEV=$(CROSSDEV) endef all: $(FSIMG_HDR) $(DIRLIST_HDR) $(SYMTAB_SRC) $(PASS1_SYMTAB) .PHONY: all build clean install populate -$(foreach DIR, $(BUILD_SUBDIRS), $(eval $(call DIR_template,$(DIR),build, all))) -$(foreach DIR, $(ALL_SUBDIRS), $(eval $(call DIR_template,$(DIR),clean,clean))) -$(foreach DIR, $(BUILD_SUBDIRS), $(eval $(call DIR_template,$(DIR),install,install))) +$(foreach DIR, $(BUILD_SUBDIRS), $(eval $(call DIR_template,$(DIR),build,all,))) +$(foreach DIR, $(ALL_SUBDIRS), $(eval $(call DIR_template,$(DIR),clean,clean,))) +$(foreach DIR, $(BUILD_SUBDIRS), $(eval $(call DIR_template,$(DIR),install,install,$(DIR)_build))) # Build program(s) in each sud-directory diff --git a/examples/module/drivers/chardev/Makefile b/examples/module/drivers/chardev/Makefile index 5b290d5cc..ea646cb1f 100644 --- a/examples/module/drivers/chardev/Makefile +++ b/examples/module/drivers/chardev/Makefile @@ -92,6 +92,6 @@ clean: $(call DELFILE, $(BIN)) $(call CLEAN) -install: $(BIN) +install: $(Q) mkdir -p $(FSROOT_DIR) $(Q) install $(BIN) $(FSROOT_DIR)/$(BIN) diff --git a/examples/nxflat/tests/Makefile b/examples/nxflat/tests/Makefile index 544cd0232..d065bbc4a 100644 --- a/examples/nxflat/tests/Makefile +++ b/examples/nxflat/tests/Makefile @@ -54,16 +54,16 @@ ROMFS_DIRLIST = $(TESTS_DIR)/dirlist.h SYMTAB = $(TESTS_DIR)/symtab.h define DIR_template -$(1)_$(2): +$(1)_$(2): $(4) +$(Q) $(MAKE) -C $(1) $(3) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" ROMFS_DIR="$(ROMFS_DIR)" CROSSDEV=$(CROSSDEV) endef all: $(ROMFS_HDR) $(ROMFS_DIRLIST) $(SYMTAB) .PHONY: all build clean install populate -$(foreach DIR, $(SUBDIRS), $(eval $(call DIR_template,$(DIR),build, all))) -$(foreach DIR, $(SUBDIRS), $(eval $(call DIR_template,$(DIR),clean,clean))) -$(foreach DIR, $(SUBDIRS), $(eval $(call DIR_template,$(DIR),install,install))) +$(foreach DIR, $(SUBDIRS), $(eval $(call DIR_template,$(DIR),build,all,))) +$(foreach DIR, $(SUBDIRS), $(eval $(call DIR_template,$(DIR),clean,clean,))) +$(foreach DIR, $(SUBDIRS), $(eval $(call DIR_template,$(DIR),install,install,$(DIR)_build))) # Build program(s) in each sud-directory