Change clean target to be more explicit

Previously, the clean target would delete a number of file extensions, many of which currently unknown to our build system (old platforms?). This commit changes the target so that it only cleans what we know we are building. Platforms / CPUs can append to the target with platform-specific build artifacts.
This commit is contained in:
George Oikonomou 2018-03-30 20:20:28 +01:00
parent 1d3122750a
commit c7e36a3d55
12 changed files with 9 additions and 20 deletions

View File

@ -295,11 +295,10 @@ endef
CONTIKI_NG_PROJECT_MAP = $(addsuffix -$(TARGET).map, $(basename $@))
clean:
-rm -f *~ *core core *.srec \
*.lst *.map *.o \
*.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \
rm -rf $(CLEAN)
-rm -f *.d *.e *.o $(CONTIKI_NG_TARGET_LIB) $(CLEAN)
-rm -rf $(OBJECTDIR)
-rm -f $(addsuffix -$(TARGET).map, $(CONTIKI_PROJECT))
-rm -f $(addsuffix .$(TARGET), $(CONTIKI_PROJECT))
distclean: clean
-rm -f ${addsuffix .$(TARGET),$(CONTIKI_PROJECT)}

View File

@ -31,7 +31,7 @@ CONTIKI_ARM_DIRS += . common/dbg-io
CONTIKI_CPU_DIRS += $(addprefix ../arm/, $(CONTIKI_ARM_DIRS))
### CPU-dependent cleanup files
CLEAN += *.d *.elf *.hex
CLEAN += *.elf *.bin *.lst *.hex *.i16hex
### Don't treat the following files as intermediate
.PRECIOUS: %.elf %.hex %.bin

View File

@ -184,6 +184,9 @@ CFLAGS += $(CFLAGSNO)
PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
### CPU-dependent cleanup files
CLEAN += *.firmware *.ihex
### Compilation rules
%-stripped.o: %.c

View File

@ -13,8 +13,6 @@ CONTIKI_TARGET_SOURCEFILES += board-buttons.c als-sensor.c
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
CLEAN += *.cc2538dk
### Define the CPU directory
CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc2538
include $(CONTIKI_CPU)/Makefile.cc2538

View File

@ -64,6 +64,8 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
.SUFFIXES:
CLEAN += COOJA.log
### Define the CPU directory
CONTIKI_CPU=$(CONTIKI)/arch/cpu/x86

View File

@ -140,7 +140,6 @@ ifdef nodemac
CFLAGS += -DMACID=$(nodemac)
endif
CLEAN += *.jn516x
CLEAN += *.jn516x.bin
CONTIKI_TARGET_SOURCEFILES += $(ARCH)

View File

@ -30,8 +30,6 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
# Enable nullmac by default
MAKE_MAC ?= MAKE_MAC_NULLMAC
CLEAN += *.native
### Define the CPU directory
CONTIKI_CPU=$(CONTIKI)/arch/cpu/native
include $(CONTIKI)/arch/cpu/native/Makefile.native

View File

@ -19,8 +19,6 @@ CONTIKI_CPU_DIRS += ../arm/common/dbg-io
CONTIKI_CPU_SOURCEFILES += dbg-printf.c dbg-putchar.c dbg-snprintf.c dbg-sprintf.c strformat.c
endif
CLEAN += *.nrf52dk
### Unless the example dictates otherwise, build with code size optimisations switched off
SMALL ?= 0

View File

@ -20,8 +20,6 @@ CONTIKI_TARGET_SOURCEFILES += antenna.c adxl346.c max44009.c sht21.c tps62730.c
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
CLEAN += *.openmote-cc2538
### Define the CPU directory
CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc2538
include $(CONTIKI_CPU)/Makefile.cc2538

View File

@ -4,8 +4,6 @@ CONTIKI_TARGET_SOURCEFILES += contiki-sky-platform.c \
sht11.c sht11-sensor.c light-sensor.c battery-sensor.c \
button-sensor.c
CLEAN += *.sky
include $(CONTIKI)/arch/platform/sky/Makefile.common
MODULES += arch/dev/cc2420 arch/dev/sht11 arch/dev/ds2411 os/storage/cfs

View File

@ -19,8 +19,6 @@ CONTIKI_TARGET_SOURCEFILES += $(BOARD_SOURCEFILES)
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
CLEAN += *.srf06-cc26xx
### Unless the example dictates otherwise, build without code size optimisations
SMALL ?= 0

View File

@ -38,8 +38,6 @@ CONTIKI_TARGET_SOURCEFILES += $(BOARD_SOURCEFILES)
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
CLEAN += *.zoul
### Define the CPU directory
CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc2538
include $(CONTIKI_CPU)/Makefile.cc2538