2016-03-21 09:25:42 +01:00
|
|
|
# Target architecture for the build. Use avr if you are unsure.
|
|
|
|
export TARGET_ARCH ?= avr
|
2014-07-15 12:08:52 +02:00
|
|
|
|
2017-02-02 20:08:06 +01:00
|
|
|
export CFLAGS_CPU = -mmcu=$(CPU) $(CFLAGS_FPU)
|
|
|
|
export CFLAGS_LINK = -ffunction-sections -fdata-sections -fno-builtin -fshort-enums
|
|
|
|
export CFLAGS_DBG ?= -ggdb -g3
|
|
|
|
export CFLAGS_OPT ?= -Os
|
2016-08-18 22:04:41 +02:00
|
|
|
|
2017-02-02 20:08:06 +01:00
|
|
|
export CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
|
|
|
|
export ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG)
|
|
|
|
export LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -static -lgcc -e reset_handler -Wl,--gc-sections
|
2016-08-18 22:04:41 +02:00
|
|
|
|
2016-06-06 17:54:42 +02:00
|
|
|
# export the peripheral drivers to be linked into the final binary
|
|
|
|
export USEMODULE += periph
|
2017-01-09 18:36:14 +01:00
|
|
|
export USEMODULE += periph_common
|
2016-06-06 17:54:42 +02:00
|
|
|
|
|
|
|
# the atmel port uses uart_stdio
|
|
|
|
export USEMODULE += uart_stdio
|
|
|
|
|
2014-07-15 12:08:52 +02:00
|
|
|
# include module specific includes
|
|
|
|
export INCLUDES += -I$(RIOTCPU)/atmega_common/include -isystem$(RIOTCPU)/atmega_common/avr-libc-extra
|
2017-02-02 20:08:06 +01:00
|
|
|
|
|
|
|
ifeq ($(LTO),1)
|
|
|
|
# avr-gcc <4.8.3 has a bug when using LTO which causes a warning to be printed always:
|
|
|
|
# '_vector_25' appears to be a misspelled signal handler [enabled by default]
|
|
|
|
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396
|
|
|
|
export LINKFLAGS += -Wno-error
|
|
|
|
endif
|