From 84ea0971bc5b101764126b49f303badc6b2b1ed0 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Mon, 18 Dec 2017 06:41:31 -0800 Subject: [PATCH] Remove obsolete flag AUTOSTART_ENABLE, as well as .co and .ce files --- Makefile.include | 18 ++---------------- arch/cpu/arm/cortex-m/cm3/Makefile.cm3 | 2 +- arch/cpu/arm/cortex-m/cm4/Makefile.cm4 | 4 ++-- arch/cpu/msp430/Makefile.msp430 | 11 +---------- arch/platform/cooja/Makefile.cooja | 2 +- arch/platform/cooja/contiki-cooja-main.c | 1 - arch/platform/jn516x/Makefile.jn516x | 4 ++-- arch/platform/sky/platform.c | 1 - os/services/unit-test/example-test.c | 7 +++---- os/sys/autostart.h | 5 ----- 10 files changed, 12 insertions(+), 43 deletions(-) diff --git a/Makefile.include b/Makefile.include index 3b8c41605..c7c191f03 100644 --- a/Makefile.include +++ b/Makefile.include @@ -8,7 +8,7 @@ endif # Setting this option is also important for tests on Cooja motes to check for warnings. WERROR ?= 1 -include $(CONTIKI)/Makefile.identify-target +include $(CONTIKI)/Makefile.identify-target ifeq ($(DEFINES),) -include Makefile.$(TARGET).defines @@ -241,7 +241,6 @@ clean: -rm -f *~ *core core *.srec \ *.lst *.map \ *.cprg *.bin *.data contiki*.a *.firmware core-labels.S *.ihex *.ini \ - *.ce *.co rm -rf $(CLEAN) -rm -rf $(OBJECTDIR) @@ -250,13 +249,6 @@ distclean: clean -include $(CONTIKI)/arch/platform/$(TARGET)/Makefile.customrules-$(TARGET) -ifndef CUSTOM_RULE_C_TO_CE -%.ce: %.c - $(TRACE_CC) - $(Q)$(CC) $(CFLAGS) -DAUTOSTART_ENABLE -c $< -o $@ - $(STRIP) --strip-unneeded -g -x $@ -endif - ifndef CUSTOM_RULE_C_TO_OBJECTDIR_O $(OBJECTDIR)/%.o: %.c | $(OBJECTDIR) $(TRACE_CC) @@ -300,12 +292,6 @@ ifndef CUSTOM_RULE_C_TO_E $(Q)$(CC) $(CFLAGS) -E $< -o $@ endif -ifndef CUSTOM_RULE_C_TO_CO -%.co: %.c - $(TRACE_CC) - $(Q)$(CC) $(CFLAGS) -DAUTOSTART_ENABLE -c $< -o $@ -endif - ifndef AROPTS AROPTS = rcf endif @@ -321,7 +307,7 @@ ifndef LD endif ifndef CUSTOM_RULE_LINK -%.$(TARGET): %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a +%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(TRACE_LD) $(Q)$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out %.a,$^} \ ${filter %.a,$^} $(TARGET_LIBFILES) -o $@ diff --git a/arch/cpu/arm/cortex-m/cm3/Makefile.cm3 b/arch/cpu/arm/cortex-m/cm3/Makefile.cm3 index a422d3080..f5547fea0 100644 --- a/arch/cpu/arm/cortex-m/cm3/Makefile.cm3 +++ b/arch/cpu/arm/cortex-m/cm3/Makefile.cm3 @@ -19,7 +19,7 @@ CUSTOM_RULE_LINK = 1 .SECONDEXPANSION: -%.elf: $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(LDSCRIPT) +%.elf: $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(LDSCRIPT) $(TRACE_LD) $(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -lm -o $@ diff --git a/arch/cpu/arm/cortex-m/cm4/Makefile.cm4 b/arch/cpu/arm/cortex-m/cm4/Makefile.cm4 index ca79428f1..78367b0eb 100644 --- a/arch/cpu/arm/cortex-m/cm4/Makefile.cm4 +++ b/arch/cpu/arm/cortex-m/cm4/Makefile.cm4 @@ -6,8 +6,8 @@ LDFLAGS += -mcpu=cortex-m4 ### Compilation rules CUSTOM_RULE_LINK=1 -%.elf: $(TARGET_STARTFILES) %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(TARGET_LIBS) +%.elf: $(TARGET_STARTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(TARGET_LIBS) $(TRACE_LD) - $(Q)$(CC) $(LDFLAGS) ${filter %o %.co %.a,$^} -o $@ + $(Q)$(CC) $(LDFLAGS) ${filter %.o %.a,$^} -o $@ include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m diff --git a/arch/cpu/msp430/Makefile.msp430 b/arch/cpu/msp430/Makefile.msp430 index f7267b694..ec8c33664 100644 --- a/arch/cpu/msp430/Makefile.msp430 +++ b/arch/cpu/msp430/Makefile.msp430 @@ -108,11 +108,6 @@ ifeq ($(HOST_OS),Windows) @$(FINALIZE_CYGWIN_DEPENDENCY) endif -CUSTOM_RULE_C_TO_CO = 1 -%.co: %.c - $(TRACE_CC) - $(Q)$(CC) $(CFLAGS) -DAUTOSTART_ENABLE $< -o $@ - AROPTS = -o else @@ -195,10 +190,6 @@ PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)} $(CC) $(CFLAGS) -c $< -o $@ $(STRIP) --strip-unneeded -g -x $@ -%.cm: %.co - $(LD) -i -r --unresolved-symbols=ignore-in-object-files -mmsp430x149 -o $@ $^ - $(STRIP) --strip-unneeded -g -x $@ - %-stripped.o: %.o $(STRIP) --strip-unneeded -g -x -o $@ $< @@ -206,7 +197,7 @@ PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)} mv $< $@ ifdef IAR -%.ihex: %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a +%.ihex: %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(LD) $(LDFLAGSNO) -Fintel-extended $(TARGET_STARTFILES) ${filter-out %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -o $@ else %.ihex: %.$(TARGET) diff --git a/arch/platform/cooja/Makefile.cooja b/arch/platform/cooja/Makefile.cooja index 9f41dbaad..853e7eaf5 100644 --- a/arch/platform/cooja/Makefile.cooja +++ b/arch/platform/cooja/Makefile.cooja @@ -38,7 +38,7 @@ endif ## QUICKSTART MAIN_OBJ = $(OBJECTDIR)/$(LIBNAME).o ARCHIVE = $(OBJECTDIR)/$(LIBNAME).a JNILIB = $(OBJECTDIR)/$(LIBNAME).$(TARGET) -CONTIKI_APP_OBJ = $(CONTIKI_APP).co +CONTIKI_APP_OBJ = $(CONTIKI_APP).o # Modules MODULES += os/net os/net/mac os/net/mac/framer diff --git a/arch/platform/cooja/contiki-cooja-main.c b/arch/platform/cooja/contiki-cooja-main.c index 39793d12c..d418e7039 100644 --- a/arch/platform/cooja/contiki-cooja-main.c +++ b/arch/platform/cooja/contiki-cooja-main.c @@ -45,7 +45,6 @@ #include "sys/clock.h" #include "sys/etimer.h" #include "sys/cooja_mt.h" -#include "sys/autostart.h" #include "sys/log.h" #include "lib/random.h" diff --git a/arch/platform/jn516x/Makefile.jn516x b/arch/platform/jn516x/Makefile.jn516x index bb654ceb8..d7aa80992 100644 --- a/arch/platform/jn516x/Makefile.jn516x +++ b/arch/platform/jn516x/Makefile.jn516x @@ -236,7 +236,7 @@ ABS_APPLIBS = $(addsuffix _$(JENNIC_CHIP_FAMILY).a,$(addprefix $(COMPONENTS_BASE ifneq ($(wildcard $(SDK_BASE_DIR)/Components/Library/*),) # The SDK is fully installed, proceed to linking and objcopy to ready-to-upload .jn516x.bin file -%.$(TARGET): %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(ABS_APPLIBS) +%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(ABS_APPLIBS) echo ${filter %.a,$^} $(Q)$(CC) -Wl,--gc-sections $(LDFLAGS) -T$(LINKCMD) -o $@ -Wl,--start-group \ $(patsubst /cygdrive/c/%,c:/%,${filter-out %.a,$^}) \ @@ -245,7 +245,7 @@ ifneq ($(wildcard $(SDK_BASE_DIR)/Components/Library/*),) $(OBJCOPY) -S -O binary $@ $@.bin else # The SDK does not include libraries, only build objects and libraries, skip linking -%.$(TARGET): %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a +%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a echo Creating empty $@ touch $@ endif diff --git a/arch/platform/sky/platform.c b/arch/platform/sky/platform.c index 5bbce5286..d71471340 100644 --- a/arch/platform/sky/platform.c +++ b/arch/platform/sky/platform.c @@ -51,7 +51,6 @@ #include "sys/node-id.h" #include "cfs-coffee-arch.h" #include "cfs/cfs-coffee.h" -#include "sys/autostart.h" #if DCOSYNCH_CONF_ENABLED static struct timer mgt_timer; diff --git a/os/services/unit-test/example-test.c b/os/services/unit-test/example-test.c index b40dc525f..04192642f 100644 --- a/os/services/unit-test/example-test.c +++ b/os/services/unit-test/example-test.c @@ -37,12 +37,12 @@ #include "contiki.h" #include "unit-test.h" -/* Register two unit tests that will be executed by using +/* Register two unit tests that will be executed by using the UNIT_TEST_RUN macro. */ UNIT_TEST_REGISTER(arithmetic, "Arith ops"); UNIT_TEST_REGISTER(string, "String ops"); -/* arithmetic: Demonstrates a test that succeeds. The exit point will be +/* arithmetic: Demonstrates a test that succeeds. The exit point will be the line where UNIT_TEST_END is called. */ UNIT_TEST(arithmetic) { @@ -58,7 +58,7 @@ UNIT_TEST(arithmetic) UNIT_TEST_END(); } -/* string: Demonstrates a test that fails. The exit point will be +/* string: Demonstrates a test that fails. The exit point will be the line where the call to UNIT_TEST_ASSERT fails. */ UNIT_TEST(string) { @@ -72,7 +72,6 @@ UNIT_TEST(string) } PROCESS(test_process, "Unit testing"); -AUTOSTART_PROCESSES(&test_process); PROCESS_THREAD(test_process, ev, data) { diff --git a/os/sys/autostart.h b/os/sys/autostart.h index a2cd10eb7..8a671b363 100644 --- a/os/sys/autostart.h +++ b/os/sys/autostart.h @@ -44,13 +44,8 @@ #include "sys/process.h" #if ! CC_NO_VA_ARGS -#if AUTOSTART_ENABLE #define AUTOSTART_PROCESSES(...) \ struct process * const autostart_processes[] = {__VA_ARGS__, NULL} -#else /* AUTOSTART_ENABLE */ -#define AUTOSTART_PROCESSES(...) \ -extern int _dummy -#endif /* AUTOSTART_ENABLE */ #else #error "C compiler must support __VA_ARGS__ macro" #endif