From e77eab32338ca4c6be0744a83c1d98174c5a44da Mon Sep 17 00:00:00 2001 From: Taku Shimosawa Date: Tue, 28 Feb 2012 10:58:41 +0900 Subject: [PATCH] Makefile modified to treat dependencies properly, but still buggy... --- kernel/Makefile | 3 ++- kernel/Makefile.build | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 0398a281..124b945c 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -14,7 +14,7 @@ $(if $(O),,$(error Specify the compilation target directory)) $(if $(shell ls $(AALBASE)/Makefile),,\ $(error AAL is not found in $(AALBASE))) -.PHONY: all clean +.PHONY: all clean depend all: $(KERNELS) @@ -28,6 +28,7 @@ all: $(KERNELS) @echo 'AALBASE = $(AALBASE)' >> $@ @echo 'TARGET = $(notdir $(patsubst %/,%,$(dir $@)))' >> $@ @cat Makefile.build >> $@ + @rm -f $(dir $@)/Makefile.dep clean: $(addsuffix .clean,$(BUILD_TARGET)) diff --git a/kernel/Makefile.build b/kernel/Makefile.build index 3f9e554b..dacd1f81 100644 --- a/kernel/Makefile.build +++ b/kernel/Makefile.build @@ -30,11 +30,12 @@ clean: depend: Makefile.dep -Makefile.dep: $(DEPSRCS) - $(dep_cmd) +Makefile.dep: + $(call dep_cmd,$(DEPSRCS)) $(AALOBJ): FORCE @mkdir -p $(dir $(AALOBJ)) + $(call echo_cmd,BUILD AAL,$(TARGET))$(submake) -C $(AALBASE) $(SUBCMD_OPTS) prepare $(call echo_cmd,BUILD AAL,$(TARGET))$(submake) -C $(AALBASE) $(SUBCMD_OPTS) %.o: $(SRC)/%.c