From 3ac27dc7c9b6ab112f22081086bdcf27c20d0384 Mon Sep 17 00:00:00 2001 From: Edvard Pettersen Date: Thu, 26 Jul 2018 08:26:02 +0200 Subject: [PATCH] Cleanup of global Makefiles --- Makefile.include | 18 +++++++++--------- arch/cpu/arm/Makefile.arm | 8 ++------ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/Makefile.include b/Makefile.include index 7643455b5..27a65a0f6 100644 --- a/Makefile.include +++ b/Makefile.include @@ -39,16 +39,10 @@ ifdef CI endif endif -# Prevent Make from remaking any makefiles. This was particularly an -# issue when you had a Makefile with a suffix equal to that of $(TARGET), -# as it managed to match with the %.$(TARGET) rule, which in turn screwed -# everything up. -Makefile.%: ; - OBJECTDIR := obj_$(TARGET) -LOWERCASE := -abcdefghijklmnopqrstuvwxyz/ -UPPERCASE := _ABCDEFGHIJKLMNOPQRSTUVWXYZ_ +LOWERCASE = -abcdefghijklmnopqrstuvwxyz/ +UPPERCASE = _ABCDEFGHIJKLMNOPQRSTUVWXYZ_ TARGET_UPPERCASE := ${strip ${shell echo $(TARGET) | sed y!$(LOWERCASE)!$(UPPERCASE)!}} CFLAGS += -DCONTIKI=1 CFLAGS += -DCONTIKI_TARGET_$(TARGET_UPPERCASE)=1 @@ -270,7 +264,7 @@ CONTIKI_CPU_DIRS_CONCAT = ${addprefix $(CONTIKI_CPU)/, \ $(CONTIKI_CPU_DIRS)} CONTIKI_ARCH_DIRS = ${addprefix $(CONTIKI)/, arch} -SOURCEDIRS = $(CONTIKI) $(PROJECTDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \ +SOURCEDIRS = . $(PROJECTDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \ $(CONTIKI_ARCH_DIRS) $(CONTIKI_CPU_DIRS_CONCAT) \ $(CONTIKIDIRS) $(MODULEDIRS) $(EXTERNALDIRS) \ $(dir $(target_makefile)) @@ -494,6 +488,12 @@ endif # the match-anything rule below instead. %: %.c +# Prevent Make from remaking any makefiles. This was particularly an +# issue when you had a Makefile with a suffix equal to that of $(TARGET), +# as it managed to match with the %.$(TARGET) rule, which in turn screwed +# everything up. +Makefile.%: ; + ifeq ($(PLATFORM_ACTION),skip) # Skip this target. $(CONTIKI_PROJECT): diff --git a/arch/cpu/arm/Makefile.arm b/arch/cpu/arm/Makefile.arm index 2c1a4bf7b..9918fa053 100644 --- a/arch/cpu/arm/Makefile.arm +++ b/arch/cpu/arm/Makefile.arm @@ -1,6 +1,3 @@ -MAKEFILE := $(lastword $(MAKEFILE_LIST)) -BASE_DIR := $(realpath $(dir $(MAKEFILE))) - CC = arm-none-eabi-gcc CPP = arm-none-eabi-cpp LD = arm-none-eabi-gcc @@ -36,9 +33,8 @@ else endif ### Use CMSIS and the existing dbg-io from arch/cpu/arm/common -CONTIKI_ARM_DIRS += . -CONTIKI_ARM_DIRS += ../common/dbg-io -CONTIKI_CPU_DIRS += $(realpath $(addprefix $(BASE_DIR)/, $(CONTIKI_ARM_DIRS))) +CONTIKI_ARM_DIRS += . common/dbg-io +CONTIKI_CPU_DIRS += $(addprefix ../arm/, $(CONTIKI_ARM_DIRS)) ### CPU-dependent cleanup files CLEAN += *.elf *.bin *.lst *.hex *.i16hex