From 560a5090361c11b08db9790eb2227dc1e6d0de0e Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 18 Oct 2016 23:27:59 +0200 Subject: [PATCH] make: remove trailing slash from BINDIR variable --- Makefile.base | 26 +++++++++--------- Makefile.buildtests | 2 +- Makefile.include | 28 ++++++++++---------- Makefile.modules | 2 +- boards/msba2-common/Makefile.include | 2 +- boards/native/Makefile.include | 4 +-- boards/x86-multiboot-common/Makefile.include | 2 +- cpu/Makefile.include.cortexm_common | 2 +- cpu/atmega1281/Makefile.include | 2 +- cpu/atmega2560/Makefile.include | 2 +- cpu/k60/Makefile.include | 4 +-- cpu/k64f/Makefile.include | 2 +- cpu/kinetis_common/Makefile.include | 2 +- cpu/kw2x/Makefile.include | 2 +- cpu/msp430-common/Makefile.include | 2 +- pkg/oonf_api/Makefile | 6 ++--- pkg/relic/Makefile | 4 +-- sys/Makefile.include | 2 +- sys/arduino/Makefile.include | 2 +- sys/newlib/Makefile.include | 2 +- tests/unittests/Makefile | 2 +- 21 files changed, 51 insertions(+), 51 deletions(-) diff --git a/Makefile.base b/Makefile.base index 04bfec914c..22cee4e963 100644 --- a/Makefile.base +++ b/Makefile.base @@ -9,7 +9,7 @@ MODULE ?= $(shell basename $(CURDIR)) .PHONY: all ${DIRS:%=ALL--%} ${DIRS:%=CLEAN--%} -all: $(BINDIR)$(MODULE).a ..nothing +all: $(BINDIR)/$(MODULE).a ..nothing ..nothing: @: @@ -35,22 +35,22 @@ ifeq ($(strip $(ASSMSRC)),) ASSMSRC := $(wildcard *.S) endif -OBJC_LTO := $(SRC:%.c=$(BINDIR)$(MODULE)/%.o) -OBJC_NOLTO := $(SRC_NOLTO:%.c=$(BINDIR)$(MODULE)/%.o) +OBJC_LTO := $(SRC:%.c=$(BINDIR)/$(MODULE)/%.o) +OBJC_NOLTO := $(SRC_NOLTO:%.c=$(BINDIR)/$(MODULE)/%.o) OBJC := $(OBJC_NOLTO) $(OBJC_LTO) -OBJCXX := $(SRCXX:%.cpp=$(BINDIR)$(MODULE)/%.o) -ASMOBJ := $(ASMSRC:%.s=$(BINDIR)$(MODULE)/%.o) -ASSMOBJ := $(ASSMSRC:%.S=$(BINDIR)$(MODULE)/%.o) +OBJCXX := $(SRCXX:%.cpp=$(BINDIR)/$(MODULE)/%.o) +ASMOBJ := $(ASMSRC:%.s=$(BINDIR)/$(MODULE)/%.o) +ASSMOBJ := $(ASSMSRC:%.S=$(BINDIR)/$(MODULE)/%.o) OBJ := $(OBJC) $(OBJCXX) $(ASMOBJ) $(ASSMOBJ) DEP := $(OBJC:.o=.d) $(OBJCXX:.o=.d) $(ASSMOBJ:.o=.d) -$(BINDIR)$(MODULE)/: +$(BINDIR)/$(MODULE)/: $(AD)mkdir -p $@ -$(BINDIR)$(MODULE).a $(OBJ): | $(BINDIR)$(MODULE)/ +$(BINDIR)/$(MODULE).a $(OBJ): | $(BINDIR)/$(MODULE)/ -$(BINDIR)$(MODULE).a: $(OBJ) | ${DIRS:%=ALL--%} +$(BINDIR)/$(MODULE).a: $(OBJ) | ${DIRS:%=ALL--%} $(AD)$(AR) $(ARFLAGS) $@ $? @@ -60,22 +60,22 @@ CXXFLAGS = $(filter-out $(CXXUWFLAGS), $(CFLAGS)) $(CXXEXFLAGS) $(OBJC_LTO): CFLAGS+=$(LTOFLAGS) -$(OBJC): $(BINDIR)$(MODULE)/%.o: %.c $(RIOTBUILD_CONFIG_HEADER_C) +$(OBJC): $(BINDIR)/$(MODULE)/%.o: %.c $(RIOTBUILD_CONFIG_HEADER_C) $(AD)$(CCACHE) $(CC) \ -DRIOT_FILE_RELATIVE=\"$(patsubst $(RIOTBASE)/%,%,$(abspath $<))\" \ -DRIOT_FILE_NOPATH=\"$(notdir $<)\" \ $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<) -$(OBJCXX): $(BINDIR)$(MODULE)/%.o: %.cpp $(RIOTBUILD_CONFIG_HEADER_C) +$(OBJCXX): $(BINDIR)/$(MODULE)/%.o: %.cpp $(RIOTBUILD_CONFIG_HEADER_C) $(AD)$(CCACHE) $(CXX) \ -DRIOT_FILE_RELATIVE=\"$(patsubst $(RIOTBASE)/%,%,$(abspath $<))\" \ -DRIOT_FILE_NOPATH=\"$(notdir $<)\" \ $(CXXFLAGS) $(INCLUDES) $(CXXINCLUDES) -MD -MP -c -o $@ $(abspath $<) -$(ASMOBJ): $(BINDIR)$(MODULE)/%.o: %.s +$(ASMOBJ): $(BINDIR)/$(MODULE)/%.o: %.s $(AD)$(AS) $(ASFLAGS) -o $@ $(abspath $<) -$(ASSMOBJ): $(BINDIR)$(MODULE)/%.o: %.S +$(ASSMOBJ): $(BINDIR)/$(MODULE)/%.o: %.S $(AD)$(CC) $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<) # pull in dependency info for *existing* .o files diff --git a/Makefile.buildtests b/Makefile.buildtests index 280c580585..d01f6d23b5 100644 --- a/Makefile.buildtests +++ b/Makefile.buildtests @@ -118,7 +118,7 @@ info-objsize: sort -rnk$${SORTROW} info-buildsize: - @$(SIZE) -dB $(BINDIR)$(APPLICATION).elf || echo '' + @$(SIZE) -dB $(BINDIR)/$(APPLICATION).elf || echo '' info-buildsizes: SHELL=bash info-buildsizes: diff --git a/Makefile.include b/Makefile.include index d480d943a6..4f4c505f22 100644 --- a/Makefile.include +++ b/Makefile.include @@ -25,9 +25,9 @@ override RIOTBOARD := $(abspath $(RIOTBOARD)) override RIOTPKG := $(abspath $(RIOTPKG)) override RIOTPROJECT := $(abspath $(RIOTPROJECT)) override GITCACHE := $(abspath $(GITCACHE)) -override APPDIR := $(abspath $(APPDIR))/ +override APPDIR := $(abspath $(APPDIR)) override BINDIRBASE := $(abspath $(BINDIRBASE)) -override BINDIR := $(abspath $(BINDIR))/ +override BINDIR := $(abspath $(BINDIR)) # Ensure that all directories are set and don't contain spaces. ifneq (, $(filter-out 1, $(foreach v,${__DIRECTORY_VARIABLES},$(words ${${v}})))) @@ -50,7 +50,7 @@ include $(RIOTBASE)/Makefile.docker # Static code analysis tools provided by LLVM include $(RIOTBASE)/Makefile.scan-build -export RIOTBUILD_CONFIG_HEADER_C = $(BINDIR)riotbuild/riotbuild.h +export RIOTBUILD_CONFIG_HEADER_C = $(BINDIR)/riotbuild/riotbuild.h COLOR_GREEN := COLOR_RED := @@ -213,8 +213,8 @@ CFLAGS += -DCPU_$(CPUDEF)=\"$(CPU)\" -DRIOT_CPU=CPU_$(CPUDEF) CFLAGS += -DMCU_$(MCUDEF)=\"$(MCU)\" -DRIOT_MCU=MCU_$(MCUDEF) # OSX fails to create empty archives. Provide a wrapper to catch that error. -ifneq (0, $(shell mkdir -p $(BINDIR); $(AR) rc $(BINDIR)empty-archive.a 2> /dev/null; \ - echo $$?; rm -f $(BINDIR)empty-archive.a 2>&1 > /dev/null)) +ifneq (0, $(shell mkdir -p $(BINDIR); $(AR) rc $(BINDIR)/empty-archive.a 2> /dev/null; \ + echo $$?; rm -f $(BINDIR)/empty-archive.a 2>&1 > /dev/null)) AR := $(RIOTBASE)/dist/ar-wrapper $(AR) endif @@ -237,13 +237,13 @@ ifeq ($(origin RIOT_VERSION), undefined) endif # the binaries to link -BASELIBS += $(BINDIR)${APPLICATION}.a +BASELIBS += $(BINDIR)/${APPLICATION}.a BASELIBS += $(APPDEPS) .PHONY: all clean flash term doc debug debug-server reset objdump help info-modules .PHONY: ..in-docker-container -ELFFILE ?= $(BINDIR)$(APPLICATION).elf +ELFFILE ?= $(BINDIR)/$(APPLICATION).elf HEXFILE ?= $(ELFFILE:.elf=.hex) # variables used to compile and link c++ @@ -258,13 +258,13 @@ ifeq ($(BUILD_IN_DOCKER),1) all: ..in-docker-container else ## make script for your application. Build RIOT-base here! -all: ..compiler-check ..build-message $(RIOTBUILD_CONFIG_HEADER_C) $(USEPKG:%=${BINDIR}%.a) $(APPDEPS) +all: ..compiler-check ..build-message $(RIOTBUILD_CONFIG_HEADER_C) $(USEPKG:%=${BINDIR}/%.a) $(APPDEPS) $(AD)DIRS="$(DIRS)" "$(MAKE)" -C $(APPDIR) -f $(RIOTBASE)/Makefile.application ifeq (,$(RIOTNOLINK)) ifeq ($(BUILDOSXNATIVE),1) $(AD)$(if $(CPPMIX),$(CXX),$(LINK)) $(UNDEF) -o $(ELFFILE) $$(find $(BASELIBS) -size +8c) $(LINKFLAGS) $(LINKFLAGPREFIX)-no_pie else - $(AD)$(if $(CPPMIX),$(CXX),$(LINK)) $(UNDEF) -o $(ELFFILE) $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGPREFIX)-Map=$(BINDIR)$(APPLICATION).map $(LINKFLAGPREFIX)--cref $(LINKFLAGS) + $(AD)$(if $(CPPMIX),$(CXX),$(LINK)) $(UNDEF) -o $(ELFFILE) $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map $(LINKFLAGPREFIX)--cref $(LINKFLAGS) endif $(AD)$(SIZE) $(ELFFILE) $(AD)$(OBJCOPY) $(OFLAGS) $(ELFFILE) $(HEXFILE) @@ -303,10 +303,10 @@ USEMODULE_INCLUDES_ = $(shell echo $(USEMODULE_INCLUDES) | tr ' ' '\n' | awk '!a INCLUDES += $(USEMODULE_INCLUDES_:%=-I%) -.PHONY: $(USEPKG:%=${BINDIR}%.a) -$(USEPKG:%=${BINDIR}%.a): $(RIOTBUILD_CONFIG_HEADER_C) +.PHONY: $(USEPKG:%=${BINDIR}/%.a) +$(USEPKG:%=${BINDIR}/%.a): $(RIOTBUILD_CONFIG_HEADER_C) @mkdir -p ${BINDIR} - "$(MAKE)" -C $(RIOTPKG)/$(patsubst ${BINDIR}%.a,%,$@) + "$(MAKE)" -C $(RIOTPKG)/$(patsubst ${BINDIR}/%.a,%,$@) clean: -@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTPKG)/$$i clean ; done @@ -469,12 +469,12 @@ else # RIOT_VERSION clean: -$(AD)rm -rf $(BINDIR) - $(BINDIR)riot-version/$(NUM_RIOT_VERSION)/Makefile.include: + $(BINDIR)/riot-version/$(NUM_RIOT_VERSION)/Makefile.include: $(AD)rm -rf $(@D) $(AD)mkdir -p $(@D) $(AD)cd $(RIOTBASE) && git archive --format=tar $(NUM_RIOT_VERSION) | ( cd $(@D) && tar x 1>&2 ) - ..delegate: $(BINDIR)riot-version/$(NUM_RIOT_VERSION)/Makefile.include + ..delegate: $(BINDIR)/riot-version/$(NUM_RIOT_VERSION)/Makefile.include @$(COLOR_ECHO) '$(COLOR_GREEN)Using RIOT_VERSION=${NUM_RIOT_VERSION}$(COLOR_RESET)' 1>&2 @$(COLOR_ECHO) $(MAKE) RIOTBASE=$( comp-options.cmake @@ -24,5 +24,5 @@ fix_source: git-download ./fix-old-style-definitions.sh $(PKG_BUILDDIR) clean:: - @rm -rf $(BINDIR)$(PKG_NAME).a + @rm -rf $(BINDIR)/$(PKG_NAME).a include $(RIOTBASE)/pkg/pkg.mk diff --git a/sys/Makefile.include b/sys/Makefile.include index ae1b736b2d..51790bc3ec 100644 --- a/sys/Makefile.include +++ b/sys/Makefile.include @@ -30,7 +30,7 @@ ifneq (,$(filter cpp11-compat,$(USEMODULE))) USEMODULE_INCLUDES += $(RIOTBASE)/sys/cpp11-compat/include # make sure cppsupport.o is linked explicitly because __dso_handle is not # found if it is hidden away inside a static object. - export UNDEF += $(BINDIR)cpp11-compat/cppsupport.o + export UNDEF += $(BINDIR)/cpp11-compat/cppsupport.o endif ifneq (,$(filter gnrc_slip,$(USEMODULE))) diff --git a/sys/arduino/Makefile.include b/sys/arduino/Makefile.include index 02a3cf8614..7e87c6f1cb 100644 --- a/sys/arduino/Makefile.include +++ b/sys/arduino/Makefile.include @@ -1,5 +1,5 @@ # compile together the Arduino sketches of the application -SKETCHES = $(wildcard $(APPDIR)*.sketch) +SKETCHES = $(wildcard $(APPDIR)/*.sketch) SRCDIR = $(RIOTBASE)/sys/arduino # run the Arduino pre-build script diff --git a/sys/newlib/Makefile.include b/sys/newlib/Makefile.include index c4b59f757a..94e526e0db 100644 --- a/sys/newlib/Makefile.include +++ b/sys/newlib/Makefile.include @@ -1,4 +1,4 @@ -UNDEF := $(BINDIR)newlib_syscalls_default/syscalls.o $(UNDEF) +UNDEF := $(BINDIR)/newlib_syscalls_default/syscalls.o $(UNDEF) ifneq (,$(filter newlib_nano,$(USEMODULE))) # Test if nano.specs is available diff --git a/tests/unittests/Makefile b/tests/unittests/Makefile index 70e9262bee..a34e2932c2 100644 --- a/tests/unittests/Makefile +++ b/tests/unittests/Makefile @@ -57,7 +57,7 @@ DISABLE_MODULE += auto_init -include $(UNIT_TESTS:%=$(RIOTBASE)/tests/unittests/%/Makefile.include) DIRS += $(UNIT_TESTS) -BASELIBS += $(UNIT_TESTS:%=$(BINDIR)%.a) +BASELIBS += $(UNIT_TESTS:%=$(BINDIR)/%.a) INCLUDES += -I$(RIOTBASE)/tests/unittests/common