Skip to content

Commit

Permalink
boards: makefiles indentation cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed Sep 22, 2017
1 parent ef44438 commit 56fa737
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 62 deletions.
12 changes: 6 additions & 6 deletions boards/arduino-mkr-common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion boards/msb-430-common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion boards/msba2-common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion boards/msba2/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
USEMODULE += cc110x
USEMODULE += cc110x
endif

USEMODULE += msba2-common
Expand Down
87 changes: 46 additions & 41 deletions boards/native/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -47,60 +51,61 @@ 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++
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 \
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions boards/nrf52840dk/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions boards/pba-d-01-kw2x/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion boards/waspmote-pro/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions boards/x86-multiboot-common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 56fa737

Please sign in to comment.