diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-03-23 10:59:56 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-03-23 10:59:56 +0000 |
commit | dacd7f5804aac47c117525a1091a253f9f1ff111 (patch) | |
tree | 637d08a3b762eb473e49633fd6c6ff156d494c40 /os/common/startup/e200 | |
parent | 93d0d10676d81913a1583583f108cad8257dd6a6 (diff) | |
download | ChibiOS-dacd7f5804aac47c117525a1091a253f9f1ff111.tar.gz ChibiOS-dacd7f5804aac47c117525a1091a253f9f1ff111.tar.bz2 ChibiOS-dacd7f5804aac47c117525a1091a253f9f1ff111.zip |
Fixed a problem in the new clean rule.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11837 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/common/startup/e200')
-rw-r--r-- | os/common/startup/e200/compilers/GCC/rules.mk | 14 | ||||
-rw-r--r-- | os/common/startup/e200/compilers/GHS/rules.mk | 14 |
2 files changed, 20 insertions, 8 deletions
diff --git a/os/common/startup/e200/compilers/GCC/rules.mk b/os/common/startup/e200/compilers/GCC/rules.mk index 1591867cc..84fbc1d77 100644 --- a/os/common/startup/e200/compilers/GCC/rules.mk +++ b/os/common/startup/e200/compilers/GCC/rules.mk @@ -125,7 +125,7 @@ PRE_MAKE_ALL_RULE_HOOK: POST_MAKE_ALL_RULE_HOOK:
-$(OBJS): | $(BUILDDIR) $(OBJDIR) $(LSTDIR)
+$(OBJS): | $(BUILDDIR) $(OBJDIR) $(LSTDIR) $(DEPDIR)
$(BUILDDIR):
ifneq ($(USE_VERBOSE_COMPILE),yes)
@@ -141,6 +141,9 @@ $(OBJDIR): $(LSTDIR):
@mkdir -p $(LSTDIR)
+$(DEPDIR):
+ @mkdir -p $(DEPDIR)
+
$(CPPOBJS) : $(OBJDIR)/%.o : %.cpp $(MAKEFILE_LIST)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
@@ -239,8 +242,11 @@ $(BUILDDIR)/lib$(PROJECT).a: $(OBJS) clean: CLEAN_RULE_HOOK
@echo Cleaning
- -rm -fR $(DEPDIR)/* $(BUILDDIR)/* 2>/dev/null
- -rmdir -p --ignore-fail-on-non-empty $(subst ./,,$(DEPDIR)) $(subst ./,,$(BUILDDIR)) 2>/dev/null
+ @echo - $(DEPDIR)
+ @-rm -fR $(DEPDIR)/* $(BUILDDIR)/* 2>/dev/null
+ @-if [ -d "$(DEPDIR)" ]; then rmdir -p --ignore-fail-on-non-empty $(subst ./,,$(DEPDIR)) 2>/dev/null; fi
+ @echo - $(BUILDDIR)
+ @-if [ -d "$(BUILDDIR)" ]; then rmdir -p --ignore-fail-on-non-empty $(subst ./,,$(BUILDDIR)) 2>/dev/null; fi
@echo
@echo Done
@@ -249,6 +255,6 @@ CLEAN_RULE_HOOK: #
# Include the dependency files, should be the last of the makefile
#
--include $(shell mkdir -p $(DEPDIR) 2>/dev/null)
+-include $(wildcard $(DEPDIR)/*)
# *** EOF ***
diff --git a/os/common/startup/e200/compilers/GHS/rules.mk b/os/common/startup/e200/compilers/GHS/rules.mk index c32c23218..4108b7061 100644 --- a/os/common/startup/e200/compilers/GHS/rules.mk +++ b/os/common/startup/e200/compilers/GHS/rules.mk @@ -126,7 +126,7 @@ PRE_MAKE_ALL_RULE_HOOK: POST_MAKE_ALL_RULE_HOOK:
-$(OBJS): | $(BUILDDIR) $(OBJDIR) $(LSTDIR)
+$(OBJS): | $(BUILDDIR) $(OBJDIR) $(LSTDIR) $(DEPDIR)
$(BUILDDIR):
ifneq ($(USE_VERBOSE_COMPILE),yes)
@@ -142,6 +142,9 @@ $(OBJDIR): $(LSTDIR):
@mkdir -p $(LSTDIR)
+$(DEPDIR):
+ @mkdir -p $(DEPDIR)
+
$(CPPOBJS) : $(OBJDIR)/%.o : %.cpp $(MAKEFILE_LIST)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
@@ -232,8 +235,11 @@ $(BUILDDIR)/lib$(PROJECT).a: $(OBJS) clean: CLEAN_RULE_HOOK
@echo Cleaning
- -rm -fR $(BUILDDIR)/* 2>/dev/null
- -rmdir -p --ignore-fail-on-non-empty $(subst ./,,$(BUILDDIR)) 2>/dev/null
+ @echo - $(DEPDIR)
+ @-rm -fR $(DEPDIR)/* $(BUILDDIR)/* 2>/dev/null
+ @-if [ -d "$(DEPDIR)" ]; then rmdir -p --ignore-fail-on-non-empty $(subst ./,,$(DEPDIR)) 2>/dev/null; fi
+ @echo - $(BUILDDIR)
+ @-if [ -d "$(BUILDDIR)" ]; then rmdir -p --ignore-fail-on-non-empty $(subst ./,,$(BUILDDIR)) 2>/dev/null; fi
@echo
@echo Done
@@ -242,6 +248,6 @@ CLEAN_RULE_HOOK: #
# Include the dependency files, should be the last of the makefile
#
--include $(wildcard $(OBJDIR)/*.d)
+-include $(wildcard $(DEPDIR)/*)
# *** EOF ***
|