mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards: makefiles indentation cleanup
This commit is contained in:
parent
ef44438d05
commit
56fa737d83
@ -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
|
||||
|
@ -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)"
|
||||
|
@ -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)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
|
||||
USEMODULE += cc110x
|
||||
USEMODULE += cc110x
|
||||
endif
|
||||
|
||||
USEMODULE += msba2-common
|
||||
|
@ -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
|
||||
export OBJCOPY ?= $(PREFIX)objcopy
|
||||
else
|
||||
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
|
||||
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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user