Enable code size optimization by default on most platforms

This commit is contained in:
Simon Duquennoy 2017-05-16 17:09:58 +02:00
parent 51beaee1b5
commit ccbb55de2e
19 changed files with 9 additions and 50 deletions

View File

@ -27,6 +27,7 @@ CFLAGS += -Werror
endif
### Are we building with code size optimisations?
SMALL ?= 1
ifeq ($(SMALL),1)
CFLAGS += -Os
else

View File

@ -46,6 +46,7 @@ CFLAGS += -Werror
endif
### Are we building with code size optimisations?
SMALL ?= 1
ifeq ($(SMALL),1)
CFLAGS += -Os
else

View File

@ -178,6 +178,7 @@ CFLAGS += -Os -fno-strict-aliasing
LDFLAGS += -mmcu=$(CC_MCU) -Wl,-Map=contiki-$(TARGET).map
### These flags can reduce the code size and RAM usage with up to 10%
SMALL ?= 1
ifeq ($(SMALL),1)
CFLAGS += -ffunction-sections
# CFLAGS += -fdata-sections

View File

@ -145,6 +145,7 @@ CFLAGS += -DSOFTDEVICE_PRESENT
CFLAGS += -DS132
endif
SMALL ?= 1
ifeq ($(SMALL),1)
CFLAGS += -Os
else

View File

@ -15,11 +15,6 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
CLEAN += *.cc2538dk
### Unless the example dictates otherwise, build with code size optimisations
ifndef SMALL
SMALL = 1
endif
### Define the CPU directory
CONTIKI_CPU=$(CONTIKI)/drivers/cpu/cc2538
include $(CONTIKI_CPU)/Makefile.cc2538

View File

@ -21,11 +21,8 @@ endif
CLEAN += *.nrf52dk
### Unless the example dictates otherwise, build with code size optimisations switched
### off
ifndef SMALL
SMALL = 0
endif
### Unless the example dictates otherwise, build with code size optimisations switched off
SMALL ?= 0
### Define the CPU directory and pull in the correct CPU makefile.
CONTIKI_CPU=$(CONTIKI)/drivers/cpu/nrf52832

View File

@ -22,11 +22,6 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
CLEAN += *.openmote-cc2538
### Unless the example dictates otherwise, build with code size optimisations
ifndef SMALL
SMALL = 1
endif
### Define the CPU directory
CONTIKI_CPU=$(CONTIKI)/drivers/cpu/cc2538
include $(CONTIKI_CPU)/Makefile.cc2538

View File

@ -4,10 +4,6 @@ CONTIKI_TARGET_SOURCEFILES += contiki-sky-platform.c \
sht11.c sht11-sensor.c light-sensor.c battery-sensor.c \
button-sensor.c radio-sensor.c
ifndef SMALL
SMALL=1
endif
include $(CONTIKI)/drivers/platform/sky/Makefile.common
MODULES += core/net/mac \

View File

@ -23,10 +23,8 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
CLEAN += *.srf06-cc26xx
### Unless the example dictates otherwise, build with code size optimisations
ifndef SMALL
SMALL = 0
endif
### Unless the example dictates otherwise, build without code size optimisations
SMALL ?= 0
### Define the CPU directory and pull in the correct CPU makefile. This will
### be defined by one of the makefiles included above and it can be either

View File

@ -19,9 +19,8 @@ CONTIKI_TARGET_MAIN = contiki-wismote-main.c
endif
ifdef IAR
SMALL = 0
CFLAGS += -D__MSP430F5437__=1 -e --vla -Ohz --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 --core=430X --double=32
else
SMALL=1
endif
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)

View File

@ -41,11 +41,6 @@ CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
CLEAN += *.zoul
### Unless the example dictates otherwise, build with code size optimisations
ifndef SMALL
SMALL = 1
endif
### Define the CPU directory
CONTIKI_CPU=$(CONTIKI)/drivers/cpu/cc2538
include $(CONTIKI_CPU)/Makefile.cc2538

View File

@ -3,7 +3,6 @@ CONTIKI = ../../../
APPS += antelope unit-test
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
SMALL = 1
all: shell-db

View File

@ -20,9 +20,6 @@ endif
PROJECTDIRS += $(REST_RESOURCES_DIR)
PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES)
# linker optimizations
SMALL=1
# REST Engine shall use Erbium CoAP implementation
APPS += er-coap
APPS += rest-engine

View File

@ -1,7 +1,5 @@
CONTIKI=../../..
SMALL=1
PROJECT_SOURCEFILES += json-ws.c
ifdef WITH_COSM

View File

@ -4,9 +4,6 @@ APPS = slip-cmd
CONTIKI=../../..
#linker optimizations
SMALL=1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECT_SOURCEFILES += border-router-cmds.c tun-bridge.c border-router-rdc.c \
slip-config.c slip-dev.c

View File

@ -3,9 +3,6 @@ all: $(CONTIKI_PROJECT)
CONTIKI=../../..
#linker optimizations
SMALL=1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECT_SOURCEFILES += slip-bridge.c

View File

@ -8,9 +8,6 @@ endif
CONTIKI=../../..
#linker optimizations
SMALL=1
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECT_SOURCEFILES += slip-net.c no-framer.c
ifeq ($(TARGET),sky)

View File

@ -23,9 +23,6 @@ REST_RESOURCES_FILES = $(notdir $(shell find $(REST_RESOURCES_DIR) -name '*.c' !
PROJECTDIRS += $(REST_RESOURCES_DIR)
PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES)
# linker optimizations
SMALL=1
# REST Engine shall use Erbium CoAP implementation
APPS += er-coap
APPS += rest-engine

View File

@ -2,8 +2,6 @@ all: z1-websense
CONTIKI = ../../../../..
SMALL = 1
APPS += webserver webbrowser
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"