Cleanup of global Makefiles

This commit is contained in:
Edvard Pettersen 2018-07-26 08:26:02 +02:00
parent 7cf843f601
commit 3ac27dc7c9
2 changed files with 11 additions and 15 deletions

View File

@ -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):

View File

@ -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