diff --git a/boards/arduino-mkr-common/Makefile.include b/boards/arduino-mkr-common/Makefile.include index 9fc74857d2bb22b16297011779c2f2537f8f099b..8796cd009643448e7ac90d125396594986397079 100644 --- a/boards/arduino-mkr-common/Makefile.include +++ b/boards/arduino-mkr-common/Makefile.include @@ -11,13 +11,13 @@ include $(RIOTMAKE)/tools/serial.inc.mk # setup the flash tool used ifeq ($(PROGRAMMER),jlink) - # in case J-Link is attached to SWD pins, use a plain CPU memory model - export JLINK_DEVICE := ${MKR_JLINK_DEVICE} - include $(RIOTMAKE)/tools/jlink.inc.mk + # in case J-Link is attached to SWD pins, use a plain CPU memory model + export JLINK_DEVICE := ${MKR_JLINK_DEVICE} + include $(RIOTMAKE)/tools/jlink.inc.mk else - # on default, we use BOSSA to flash this board - export LINKER_SCRIPT ?= $(RIOTCPU)/sam0_common/ldscripts/$(CPU_MODEL)_mkr.ld - include $(RIOTMAKE)/tools/bossa.inc.mk + # on default, we use BOSSA to flash this board + export LINKER_SCRIPT ?= $(RIOTCPU)/sam0_common/ldscripts/$(CPU_MODEL)_mkr.ld + include $(RIOTMAKE)/tools/bossa.inc.mk endif INCLUDES += -I$(RIOTBOARD)/arduino-mkr-common/include diff --git a/boards/msb-430-common/Makefile.include b/boards/msb-430-common/Makefile.include index 51ed1df09a27f72b44d85755e7b486930d49b627..7a9d36b5b3d5f19dcc287d5c2087e002b781023f 100644 --- a/boards/msb-430-common/Makefile.include +++ b/boards/msb-430-common/Makefile.include @@ -13,7 +13,7 @@ export OFLAGS = -O ihex export PROGRAMMER ?= olimex export MSPDEBUGFLAGS += -j $(PROGRAMMER) ifeq ($(strip $(PROGRAMMER)),uif) - export MSPDEBUGFLAGS += -d $(PORT) + export MSPDEBUGFLAGS += -d $(PORT) endif export FLASHER ?= mspdebug export FFLAGS = $(MSPDEBUGFLAGS) "prog $(HEXFILE)" diff --git a/boards/msba2-common/Makefile.include b/boards/msba2-common/Makefile.include index c62a1017a35ca796038a5d04aae840a7dd9d3821..c1a340a7b1956466002173438b259ed31669f722 100644 --- a/boards/msba2-common/Makefile.include +++ b/boards/msba2-common/Makefile.include @@ -22,7 +22,7 @@ export LINKFLAGS += -Wl,--gc-sections USEMODULE += newlib_nano ifeq ($(PORT),) - export PORT = /dev/ttyUSB0 + export PORT = /dev/ttyUSB0 endif export FFLAGS = $(PORT) $(HEXFILE) diff --git a/boards/msba2/Makefile.include b/boards/msba2/Makefile.include index f7d05c148dbb9ab517d5af4675d39bf5ea668662..c25d470b1935dfc23eaf5213857fdc6199c46bce 100644 --- a/boards/msba2/Makefile.include +++ b/boards/msba2/Makefile.include @@ -1,5 +1,5 @@ ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) - USEMODULE += cc110x + USEMODULE += cc110x endif USEMODULE += msba2-common diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index a339978daf673373b8a7e52c612d05c53384b8ab..8bcefd50dc37633037266bda21f9d0144df6ed35 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -12,33 +12,37 @@ USEMODULE += native-drivers export PREFIX = export CC ?= $(PREFIX)gcc export CXX ?= $(PREFIX)g++ + ifeq ($(LTO),1) -export AR = $(PREFIX)gcc-ar + export AR = $(PREFIX)gcc-ar else -export AR = $(PREFIX)ar + export AR = $(PREFIX)ar endif + export AS ?= $(PREFIX)as export LINK ?= $(PREFIX)gcc export SIZE ?= $(PREFIX)size + ifneq ($(shell uname -s),Darwin) -export OBJCOPY ?= $(PREFIX)objcopy -else -ifeq (0,$(shell which gobjcopy 2>&1 > /dev/null ; echo $$?)) -export OBJCOPY ?= gobjcopy -export OFLAGS ?= -O ihex + export OBJCOPY ?= $(PREFIX)objcopy else -# If gobjcopy is not available, just create an empty file. The hexfile -# is not used for native anyways. -export OBJCOPY ?= touch -export OFLAGS = -endif + ifeq (0,$(shell which gobjcopy 2>&1 > /dev/null ; echo $$?)) + export OBJCOPY ?= gobjcopy + export OFLAGS ?= -O ihex + else + # If gobjcopy is not available, just create an empty file. The hexfile + # is not used for native anyways. + export OBJCOPY ?= touch + export OFLAGS = + endif endif ifeq ($(shell uname -s),Darwin) -export DEBUGGER ?= lldb + export DEBUGGER ?= lldb else -export DEBUGGER ?= gdb + export DEBUGGER ?= gdb endif + export TERMPROG ?= $(ELF) export FLASHER = true export VALGRIND ?= valgrind @@ -47,19 +51,20 @@ export GPROF ?= gprof # basic cflags: export CFLAGS += -Wall -Wextra -pedantic -std=gnu99 + ifeq ($(shell uname -m),x86_64) -export CFLAGS += -m32 + export CFLAGS += -m32 endif ifneq (,$(filter -DDEVELHELP,$(CFLAGS))) -export CFLAGS += -fstack-protector-all + export CFLAGS += -fstack-protector-all endif ifeq ($(shell uname -s),FreeBSD) -ifeq ($(shell uname -m),amd64) -export CFLAGS += -m32 -DCOMPAT_32BIT -B/usr/lib32 -endif + ifeq ($(shell uname -m),amd64) + export CFLAGS += -m32 -DCOMPAT_32BIT -B/usr/lib32 + endif endif ifeq ($(shell uname -s),Darwin) -export CFLAGS += -Wno-deprecated-declarations + export CFLAGS += -Wno-deprecated-declarations endif # unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++ @@ -67,40 +72,40 @@ export CXXUWFLAGS += export CXXEXFLAGS += ifeq ($(shell uname -m),x86_64) -export LINKFLAGS += -m32 + export LINKFLAGS += -m32 endif ifeq ($(shell uname -s),FreeBSD) -ifeq ($(shell uname -m),amd64) -export LINKFLAGS += -m32 -DCOMPAT_32BIT -L/usr/lib32 -B/usr/lib32 -endif -export LINKFLAGS += -L $(BINDIR) + ifeq ($(shell uname -m),amd64) + export LINKFLAGS += -m32 -DCOMPAT_32BIT -L/usr/lib32 -B/usr/lib32 + endif + export LINKFLAGS += -L $(BINDIR) else -export LINKFLAGS += -ldl + export LINKFLAGS += -ldl endif # clean up unused functions export CFLAGS += -ffunction-sections -fdata-sections ifeq ($(shell uname -s),Darwin) -export LINKFLAGS += -Wl,-dead_strip + export LINKFLAGS += -Wl,-dead_strip else -export LINKFLAGS += -Wl,--gc-sections + export LINKFLAGS += -Wl,--gc-sections endif export LINKFLAGS += -ffunction-sections # set the tap interface for term/valgrind ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) - export PORT ?= tap0 + export PORT ?= tap0 else - export PORT = + export PORT = endif export TERMFLAGS := $(PORT) $(TERMFLAGS) export ASFLAGS = ifeq ($(shell basename $(DEBUGGER)),lldb) -export DEBUGGER_FLAGS = -- $(ELF) $(TERMFLAGS) + export DEBUGGER_FLAGS = -- $(ELF) $(TERMFLAGS) else -export DEBUGGER_FLAGS = -q --args $(ELF) $(TERMFLAGS) + export DEBUGGER_FLAGS = -q --args $(ELF) $(TERMFLAGS) endif term-valgrind: export VALGRIND_FLAGS ?= \ --leak-check=full \ @@ -128,24 +133,24 @@ export CFLAGS += -DDEBUG_ASSERT_VERBOSE # workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 ifneq ($(shell gcc --version | head -1 | grep -E ' (4.6|4.7)'),) - export CFLAGS += -DHAVE_NO_BUILTIN_BSWAP16 + export CFLAGS += -DHAVE_NO_BUILTIN_BSWAP16 endif # backward compatability with glibc <= 2.17 for native ifeq ($(CPU),native) -ifeq ($(shell uname -s),Linux) -ifeq ($(shell ldd --version | awk '/^ldd/{if ($$NF < 2.17) {print "yes"} else {print "no"} }'),yes) - LINKFLAGS += -lrt -endif -endif + ifeq ($(shell uname -s),Linux) + ifeq ($(shell ldd --version | awk '/^ldd/{if ($$NF < 2.17) {print "yes"} else {print "no"} }'),yes) + LINKFLAGS += -lrt + endif + endif endif # clumsy way to enable building native on osx: BUILDOSXNATIVE = 0 ifeq ($(CPU),native) -ifeq ($(shell uname -s),Darwin) - BUILDOSXNATIVE = 1 -endif + ifeq ($(shell uname -s),Darwin) + BUILDOSXNATIVE = 1 + endif endif all: # do not override first target diff --git a/boards/nrf52840dk/Makefile.include b/boards/nrf52840dk/Makefile.include index 298a57058d3733deafa2309119bde8e0273386c3..485d3f04fbea812e2a71da17a3a8517284bfc150 100644 --- a/boards/nrf52840dk/Makefile.include +++ b/boards/nrf52840dk/Makefile.include @@ -11,9 +11,9 @@ export JLINK_DEVICE := nrf52 # special options when using SoftDevice ifneq (,$(filter nordic_softdevice_ble,$(USEPKG))) -export JLINK_PRE_FLASH := erase\nloadfile $(BINDIR)/softdevice.hex -export FLASH_ADDR := 0x1f000 -export LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld + export JLINK_PRE_FLASH := erase\nloadfile $(BINDIR)/softdevice.hex + export FLASH_ADDR := 0x1f000 + export LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld endif include $(RIOTMAKE)/tools/jlink.inc.mk diff --git a/boards/pba-d-01-kw2x/Makefile.include b/boards/pba-d-01-kw2x/Makefile.include index c32e7fdaeec681836ad2013179f55ae9790998bd..637cd2b8f7e24e9fcac49c142003c67bb1cadfa4 100644 --- a/boards/pba-d-01-kw2x/Makefile.include +++ b/boards/pba-d-01-kw2x/Makefile.include @@ -34,12 +34,12 @@ export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/kinetis_common/dist/check-fcfield-elf # Use /dist/tools/usb-serial/list-ttys.sh to find out serial number. # Usage: SERIAL="0200..." BOARD="pba-d-01-kw2x" make flash ifneq (,$(SERIAL)) - export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)" - SERIAL_TTY = $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL))) - ifeq (,$(SERIAL_TTY)) - $(error Did not find a device with serial $(SERIAL)) - endif - PORT_LINUX := $(SERIAL_TTY) + export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)" + SERIAL_TTY = $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL))) + ifeq (,$(SERIAL_TTY)) + $(error Did not find a device with serial $(SERIAL)) + endif + PORT_LINUX := $(SERIAL_TTY) endif # setup serial terminal diff --git a/boards/waspmote-pro/Makefile.include b/boards/waspmote-pro/Makefile.include index 7e3e58f9fc6657f075ebcdc3115de4ed5d36c731..eae5e716a32635b9c0b4f114ec3773136b1dd71a 100644 --- a/boards/waspmote-pro/Makefile.include +++ b/boards/waspmote-pro/Makefile.include @@ -30,7 +30,7 @@ export DEBUGGER = $(DIST_PATH)/debug.sh $(DEBUGSERVER_FLAGS) $(DIST_PATH) $(DEBU export PROGRAMMER ?= stk500v1 ifeq ($(PROGRAMMER), stk500v1) - export PROGRAMMER_FLAGS = -P $(PORT) -b 115200 + export PROGRAMMER_FLAGS = -P $(PORT) -b 115200 endif export OFLAGS += -j .text -j .data -O ihex diff --git a/boards/x86-multiboot-common/Makefile.include b/boards/x86-multiboot-common/Makefile.include index 4133f13305ac18c4f560dcd6763c02d520a2fde3..1eb877a67b5f7350713c6c8cb46a3f33075b542d 100644 --- a/boards/x86-multiboot-common/Makefile.include +++ b/boards/x86-multiboot-common/Makefile.include @@ -34,9 +34,9 @@ export CPU = x86 # toolchain config export CC ?= $(PREFIX)gcc ifeq ($(LTO),1) -export AR = $(PREFIX)gcc-ar + export AR = $(PREFIX)gcc-ar else -export AR = $(PREFIX)ar + export AR = $(PREFIX)ar endif export AS ?= $(PREFIX)as export RANLIB ?= $(PREFIX)ranlib