mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-05 09:29:39 +00:00
Minor cleanup (avoid setting some compiler flags twice)
This commit is contained in:
parent
8aaa9d14b7
commit
fd81a0d393
@ -39,6 +39,11 @@ CONTIKI_TARGET_SOURCEFILES += $(MSP430) \
|
|||||||
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
||||||
|
|
||||||
### Compiler definitions
|
### Compiler definitions
|
||||||
|
|
||||||
|
ifdef WERROR
|
||||||
|
CFLAGSWERROR=-Werror
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef IAR
|
ifdef IAR
|
||||||
CC = icc430
|
CC = icc430
|
||||||
LD = xlink
|
LD = xlink
|
||||||
@ -47,7 +52,6 @@ AR = xar
|
|||||||
OBJCOPY = ielftool
|
OBJCOPY = ielftool
|
||||||
STRIP = strip
|
STRIP = strip
|
||||||
|
|
||||||
|
|
||||||
ifndef IAR_PATH
|
ifndef IAR_PATH
|
||||||
# This works with cygwin...
|
# This works with cygwin...
|
||||||
IAR_BIN_PATH = $(shell dirname "`which $(CC)`")
|
IAR_BIN_PATH = $(shell dirname "`which $(CC)`")
|
||||||
@ -87,27 +91,22 @@ NM = msp430-nm
|
|||||||
OBJCOPY = msp430-objcopy
|
OBJCOPY = msp430-objcopy
|
||||||
STRIP = msp430-strip
|
STRIP = msp430-strip
|
||||||
BSL = msp430-bsl
|
BSL = msp430-bsl
|
||||||
|
ifndef CFLAGSNO
|
||||||
CFLAGSNO = -Wall -mmcu=$(MCU) -g $(CFLAGSWERROR)
|
CFLAGSNO = -Wall -mmcu=$(MCU) -g $(CFLAGSWERROR)
|
||||||
CFLAGS += $(CFLAGSNO) -Os -fno-strict-aliasing
|
endif
|
||||||
|
CFLAGS += -Os -fno-strict-aliasing
|
||||||
LDFLAGS += -mmcu=$(MCU) -Wl,-Map=contiki-$(TARGET).map
|
LDFLAGS += -mmcu=$(MCU) -Wl,-Map=contiki-$(TARGET).map
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef WERROR
|
|
||||||
CFLAGSWERROR=-Werror
|
|
||||||
endif
|
|
||||||
|
|
||||||
CFLAGS += $(CFLAGSNO)
|
|
||||||
|
|
||||||
|
|
||||||
### These flags can reduce the code size and RAM usage with up to 10%
|
### These flags can reduce the code size and RAM usage with up to 10%
|
||||||
ifdef SMALL
|
ifdef SMALL
|
||||||
ifndef IAR
|
|
||||||
CFLAGS += -ffunction-sections
|
CFLAGS += -ffunction-sections
|
||||||
# CFLAGS += -fdata-sections
|
# CFLAGS += -fdata-sections
|
||||||
LDFLAGS += -Wl,--gc-sections,--undefined=_reset_vector__,--undefined=InterruptVectors,--undefined=_copy_data_init__,--undefined=_clear_bss_init__,--undefined=_end_of_init__
|
LDFLAGS += -Wl,--gc-sections,--undefined=_reset_vector__,--undefined=InterruptVectors,--undefined=_copy_data_init__,--undefined=_clear_bss_init__,--undefined=_end_of_init__
|
||||||
endif # !IAR
|
|
||||||
endif # SMALL
|
endif # SMALL
|
||||||
|
|
||||||
|
endif # IAR
|
||||||
|
|
||||||
|
CFLAGS += $(CFLAGSNO)
|
||||||
|
|
||||||
PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
|
PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user