Skip to content
Snippets Groups Projects
Commit 56fa737d authored by Alexandre Abadie's avatar Alexandre Abadie
Browse files

boards: makefiles indentation cleanup

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