diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-08-02 14:25:05 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-08-02 14:25:05 +0000 |
commit | 40b6d76453be91a5b8998c19db80ccd57b5b1653 (patch) | |
tree | 4c72363680f260f43cfc78077c2b06f3d74682d4 /os/common/startup | |
parent | 9058939dbe67670b079204d3b1ae337cf7d3cf60 (diff) | |
download | ChibiOS-40b6d76453be91a5b8998c19db80ccd57b5b1653.tar.gz ChibiOS-40b6d76453be91a5b8998c19db80ccd57b5b1653.tar.bz2 ChibiOS-40b6d76453be91a5b8998c19db80ccd57b5b1653.zip |
Added to the Makefiles the ability to change the default build, dependencies and configuration directories.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10350 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common/startup')
-rw-r--r-- | os/common/startup/ARM/compilers/GCC/rules.mk | 22 | ||||
-rw-r--r-- | os/common/startup/ARMCMx/compilers/GCC/rules.mk | 21 | ||||
-rw-r--r-- | os/common/startup/SIMIA32/compilers/GCC/rules.mk | 22 | ||||
-rw-r--r-- | os/common/startup/e200/compilers/GCC/rules.mk | 24 |
4 files changed, 61 insertions, 28 deletions
diff --git a/os/common/startup/ARM/compilers/GCC/rules.mk b/os/common/startup/ARM/compilers/GCC/rules.mk index f66daa520..0860b2974 100644 --- a/os/common/startup/ARM/compilers/GCC/rules.mk +++ b/os/common/startup/ARM/compilers/GCC/rules.mk @@ -76,10 +76,18 @@ endif ifeq ($(BUILDDIR),.)
BUILDDIR = build
endif
+
+# Dependencies directory
+ifeq ($(DEPDIR),)
+ DEPDIR = .dep
+endif
+ifeq ($(DEPDIR),.)
+ DEPDIR = .dep
+endif
+
OUTFILES = $(BUILDDIR)/$(PROJECT).elf $(BUILDDIR)/$(PROJECT).hex \
$(BUILDDIR)/$(PROJECT).bin $(BUILDDIR)/$(PROJECT).dmp \
$(BUILDDIR)/$(PROJECT).list
-
# Source files groups and paths
ifeq ($(USE_THUMB),yes)
@@ -157,10 +165,10 @@ else endif
# Generate dependency information
-ASFLAGS += -MD -MP -MF .dep/$(@F).d
-ASXFLAGS += -MD -MP -MF .dep/$(@F).d
-CFLAGS += -MD -MP -MF .dep/$(@F).d
-CPPFLAGS += -MD -MP -MF .dep/$(@F).d
+ASFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+ASXFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+CFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+CPPFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
# Paths where to search for sources
VPATH = $(SRCPATHS)
@@ -300,7 +308,7 @@ $(BUILDDIR)/lib$(PROJECT).a: $(OBJS) clean: CLEAN_RULE_HOOK
@echo Cleaning
- -rm -fR .dep $(BUILDDIR)
+ -rm -fR $(DEPDIR) $(BUILDDIR)
@echo
@echo Done
@@ -309,6 +317,6 @@ CLEAN_RULE_HOOK: #
# Include the dependency files, should be the last of the makefile
#
--include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+-include $(shell mkdir $(DEPDIR) 2>/dev/null) $(wildcard $(DEPDIR)/*)
# *** EOF ***
diff --git a/os/common/startup/ARMCMx/compilers/GCC/rules.mk b/os/common/startup/ARMCMx/compilers/GCC/rules.mk index 3c0857042..1ca7298a7 100644 --- a/os/common/startup/ARMCMx/compilers/GCC/rules.mk +++ b/os/common/startup/ARMCMx/compilers/GCC/rules.mk @@ -66,6 +66,15 @@ endif ifeq ($(BUILDDIR),.)
BUILDDIR = build
endif
+
+# Dependencies directory
+ifeq ($(DEPDIR),)
+ DEPDIR = .dep
+endif
+ifeq ($(DEPDIR),.)
+ DEPDIR = .dep
+endif
+
OUTFILES := $(BUILDDIR)/$(PROJECT).elf \
$(BUILDDIR)/$(PROJECT).hex \
$(BUILDDIR)/$(PROJECT).bin \
@@ -153,10 +162,10 @@ else endif
# Generate dependency information
-ASFLAGS += -MD -MP -MF .dep/$(@F).d
-ASXFLAGS += -MD -MP -MF .dep/$(@F).d
-CFLAGS += -MD -MP -MF .dep/$(@F).d
-CPPFLAGS += -MD -MP -MF .dep/$(@F).d
+ASFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+ASXFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+CFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+CPPFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
# Paths where to search for sources
VPATH = $(SRCPATHS)
@@ -306,7 +315,7 @@ $(BUILDDIR)/lib$(PROJECT).a: $(OBJS) clean: CLEAN_RULE_HOOK
@echo Cleaning
- -rm -fR .dep $(BUILDDIR)
+ -rm -fR $(DEPDIR) $(BUILDDIR)
@echo
@echo Done
@@ -315,6 +324,6 @@ CLEAN_RULE_HOOK: #
# Include the dependency files, should be the last of the makefile
#
--include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+-include $(shell mkdir $(DEPDIR) 2>/dev/null) $(wildcard $(DEPDIR)/*)
# *** EOF ***
diff --git a/os/common/startup/SIMIA32/compilers/GCC/rules.mk b/os/common/startup/SIMIA32/compilers/GCC/rules.mk index 54c27f0fa..5bf3b96f2 100644 --- a/os/common/startup/SIMIA32/compilers/GCC/rules.mk +++ b/os/common/startup/SIMIA32/compilers/GCC/rules.mk @@ -34,8 +34,16 @@ endif ifeq ($(BUILDDIR),.)
BUILDDIR = build
endif
+
+# Dependencies directory
+ifeq ($(DEPDIR),)
+ DEPDIR = .dep
+endif
+ifeq ($(DEPDIR),.)
+ DEPDIR = .dep
+endif
+
OUTFILES = $(BUILDDIR)/$(PROJECT)
-
# Source files groups and paths
SRC = $(CSRC)$(CPPSRC)
@@ -73,10 +81,10 @@ CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir LDFLAGS = $(MCFLAGS) $(OPT) $(LLIBDIR) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,$(LDOPT)
# Generate dependency information
-ASFLAGS += -MD -MP -MF .dep/$(@F).d
-ASXFLAGS += -MD -MP -MF .dep/$(@F).d
-CFLAGS += -MD -MP -MF .dep/$(@F).d
-CPPFLAGS += -MD -MP -MF .dep/$(@F).d
+ASFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+ASXFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+CFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+CPPFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
# Paths where to search for sources
VPATH = $(SRCPATHS)
@@ -161,7 +169,7 @@ $(BUILDDIR)/lib$(PROJECT).a: $(OBJS) clean: CLEAN_RULE_HOOK
@echo Cleaning
- -rm -fR .dep $(BUILDDIR)
+ -rm -fR $(DEPDIR) $(BUILDDIR)
@echo
@echo Done
@@ -174,6 +182,6 @@ gcov: #
# Include the dependency files, should be the last of the makefile
#
--include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+-include $(shell mkdir $(DEPDIR) 2>/dev/null) $(wildcard $(DEPDIR)/*)
# *** EOF ***
diff --git a/os/common/startup/e200/compilers/GCC/rules.mk b/os/common/startup/e200/compilers/GCC/rules.mk index c84ebc66f..4645b5110 100644 --- a/os/common/startup/e200/compilers/GCC/rules.mk +++ b/os/common/startup/e200/compilers/GCC/rules.mk @@ -58,10 +58,18 @@ endif ifeq ($(BUILDDIR),.)
BUILDDIR = build
endif
+
+# Dependencies directory
+ifeq ($(DEPDIR),)
+ DEPDIR = .dep
+endif
+ifeq ($(DEPDIR),.)
+ DEPDIR = .dep
+endif
+
OUTFILES = $(BUILDDIR)/$(PROJECT).elf $(BUILDDIR)/$(PROJECT).hex \
$(BUILDDIR)/$(PROJECT).mot $(BUILDDIR)/$(PROJECT).bin \
- $(BUILDDIR)/$(PROJECT).dmp $(BUILDDIR)/$(PROJECT).list
-
+ $(BUILDDIR)/$(PROJECT).dmp $(BUILDDIR)/$(PROJECT).list
# Source files groups and paths
SRC = $(CSRC)$(CPPSRC)
@@ -99,10 +107,10 @@ CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(RULESPATH)/ld,$(LDOPT),--script=$(LDSCRIPT)
# Generate dependency information
-ASFLAGS += -MD -MP -MF .dep/$(@F).d
-ASXFLAGS += -MD -MP -MF .dep/$(@F).d
-CFLAGS += -MD -MP -MF .dep/$(@F).d
-CPPFLAGS += -MD -MP -MF .dep/$(@F).d
+ASFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+ASXFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+CFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
+CPPFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
# Paths where to search for sources
VPATH = $(SRCPATHS)
@@ -231,7 +239,7 @@ $(BUILDDIR)/lib$(PROJECT).a: $(OBJS) clean: CLEAN_RULE_HOOK
@echo Cleaning
- -rm -fR .dep $(BUILDDIR)
+ -rm -fR $(DEPDIR) $(BUILDDIR)
@echo
@echo Done
@@ -240,6 +248,6 @@ CLEAN_RULE_HOOK: #
# Include the dependency files, should be the last of the makefile
#
--include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
+-include $(shell mkdir $(DEPDIR) 2>/dev/null) $(wildcard $(DEPDIR)/*)
# *** EOF ***
|