From 40b6d76453be91a5b8998c19db80ccd57b5b1653 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Wed, 2 Aug 2017 14:25:05 +0000 Subject: 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 --- os/common/startup/SIMIA32/compilers/GCC/rules.mk | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'os/common/startup/SIMIA32/compilers') 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 *** -- cgit v1.2.3