diff options
author | Christian Pointner <equinox@spreadspace.org> | 2015-06-30 21:42:21 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2015-06-30 21:42:21 +0200 |
commit | 27b0d98d085454a9f3fbaeb73ac3000e5a965db4 (patch) | |
tree | 01c5cd7a67d25a26fe1e886999c4a48dd37dd00e /defines.mk | |
parent | updated copyright info (diff) |
added support for C++ based projects
Diffstat (limited to 'defines.mk')
-rw-r--r-- | defines.mk | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -193,6 +193,7 @@ ifeq ($(BOARD_TYPE),AvrNetIo) endif CC = avr-gcc +CXX = avr-g++ OBJCOPY = avr-objcopy AR = avr-ar rcs SIZE = avr-size @@ -203,26 +204,28 @@ DFU = dfu-programmer teensy = teensy_loader_cli avrdude = avrdude -## Options common to compile, link and assembly rules +## Options common to C and C++ compiler COMMON = -mmcu=$(MCU) +COMMON += -O2 +COMMON += -funsigned-char +COMMON += -funsigned-bitfields +COMMON += -ffunction-sections +COMMON += -fpack-struct +COMMON += -fshort-enums +COMMON += -Wall +COMMON += -I$(LIB_DIR) +COMMON += -DF_CPU=$(F_CPU)UL +COMMON += -D__BOARD_$(BOARD_TYPE)__ +COMMON += -DARCH=ARCH_$(ARCH) ## Compile options common for all C compilation units. CFLAGS = $(COMMON) -CFLAGS += -O2 -CFLAGS += -funsigned-char -CFLAGS += -funsigned-bitfields -CFLAGS += -ffunction-sections -CFLAGS += -fpack-struct -CFLAGS += -fshort-enums -CFLAGS += -Wall CFLAGS += -Wstrict-prototypes -CFLAGS += -I$(LIB_DIR) -CFLAGS += -DF_CPU=$(F_CPU)UL -CFLAGS += -D__BOARD_$(BOARD_TYPE)__ -CFLAGS += -DARCH=ARCH_$(ARCH) CFLAGS += -std=c99 +## Compile options common for all C++ compilation units. +CXXFLAGS = $(COMMON) ## Linker flags -LDFLAGS = $(COMMON) +LDFLAGS = -mmcu=$(MCU) LDFLAGS += |