Skip to content

Commit

Permalink
Makefiles: move to new directory /makefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Nohlgård committed Apr 4, 2017
1 parent dab3de5 commit 339a4da
Show file tree
Hide file tree
Showing 91 changed files with 131 additions and 117 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ welcome:
@echo "Or ask questions on our mailing list:"
@echo " users@riot-os.org (http://lists.riot-os.org/mailman/listinfo/users)"

-include Makefile.tests
-include makefiles/tests.inc.mk
41 changes: 28 additions & 13 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RIOTBASE ?= $(dir $(lastword $(MAKEFILE_LIST)))
CCACHE_BASEDIR ?= $(RIOTBASE)
RIOTCPU ?= $(RIOTBASE)/cpu
RIOTBOARD ?= $(RIOTBASE)/boards
RIOTMAKE ?= $(RIOTBASE)/makefiles
RIOTPKG ?= $(RIOTBASE)/pkg
RIOTPROJECT ?= $(shell git rev-parse --show-toplevel 2>/dev/null || pwd)
GITCACHE ?= $(RIOTBASE)/dist/tools/git/git-cache
Expand All @@ -16,13 +17,27 @@ BINDIRBASE ?= $(APPDIR)/bin
BINDIR ?= $(BINDIRBASE)/$(BOARD)
PKGDIRBASE ?= $(BINDIRBASE)/pkg/$(BOARD)

__DIRECTORY_VARIABLES := RIOTBASE CCACHE_BASEDIR RIOTCPU RIOTBOARD RIOTPKG GITCACHE RIOTPROJECT APPDIR BINDIRBASE BINDIR PKGDIRBASE
__DIRECTORY_VARIABLES := \
RIOTBASE \
RIOTCPU \
RIOTBOARD \
RIOTMAKE \
RIOTPKG \
RIOTPROJECT \
APPDIR \
BINDIRBASE \
BINDIR \
CCACHE_BASEDIR \
GITCACHE \
PKGDIRBASE \
#

# Make all paths absolute.
override RIOTBASE := $(abspath $(RIOTBASE))
override CCACHE_BASEDIR := $(abspath $(CCACHE_BASEDIR))
override RIOTCPU := $(abspath $(RIOTCPU))
override RIOTBOARD := $(abspath $(RIOTBOARD))
override RIOTMAKE := $(abspath $(RIOTMAKE))
override RIOTPKG := $(abspath $(RIOTPKG))
override RIOTPROJECT := $(abspath $(RIOTPROJECT))
override GITCACHE := $(abspath $(GITCACHE))
Expand All @@ -47,10 +62,10 @@ BUILDRELPATH ?= ${PWD:${RIOTPROJECT}/%=%}/
# Include Docker settings near the top because we need to build the environment
# command line before some of the variable origins are overwritten below when
# using abspath, strip etc.
include $(RIOTBASE)/Makefile.docker
include $(RIOTMAKE)/docker.inc.mk

# Static code analysis tools provided by LLVM
include $(RIOTBASE)/Makefile.scan-build
include $(RIOTMAKE)/scan-build.inc.mk

export RIOTBUILD_CONFIG_HEADER_C = $(BINDIR)/riotbuild/riotbuild.h

Expand Down Expand Up @@ -190,13 +205,13 @@ INCLUDES += -I$(RIOTCPU)/$(CPU)/include
INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include

# mandatory includes!
include $(RIOTBASE)/Makefile.pseudomodules
include $(RIOTBASE)/Makefile.defaultmodules
include $(RIOTMAKE)/pseudomodules.inc.mk
include $(RIOTMAKE)/defaultmodules.inc.mk
include $(RIOTBOARD)/$(BOARD)/Makefile.include
include $(RIOTCPU)/$(CPU)/Makefile.include

# Import all toolchain settings
include $(RIOTCPU)/Makefile.include.$(TOOLCHAIN)
include $(RIOTMAKE)/toolchain/$(TOOLCHAIN).inc.mk

# get number of interfaces straight before resolving dependencies
GNRC_NETIF_NUMOF ?= 1
Expand Down Expand Up @@ -239,7 +254,7 @@ ifneq (0, $(shell mkdir -p $(BINDIR); $(AR) rc $(BINDIR)/empty-archive.a 2> /dev
endif

# Feature test default CFLAGS and LINKFLAGS for the set compiled.
include $(RIOTBASE)/Makefile.cflags
include $(RIOTMAKE)/cflags.inc.mk

# make the RIOT version available to the program
ifeq ($(origin RIOT_VERSION), undefined)
Expand Down Expand Up @@ -279,7 +294,7 @@ all: ..in-docker-container
else
## make script for your application. Build RIOT-base here!
all: ..compiler-check ..build-message $(RIOTBUILD_CONFIG_HEADER_C) $(USEPKG:%=${BINDIR}/%.a) $(APPDEPS)
$(Q)DIRS="$(DIRS)" "$(MAKE)" -C $(APPDIR) -f $(RIOTBASE)/Makefile.application
$(Q)DIRS="$(DIRS)" "$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk
ifeq (,$(RIOTNOLINK))
ifeq ($(BUILDOSXNATIVE),1)
$(Q)$(if $(CPPMIX),$(CXX),$(LINK)) $(UNDEF) -o $(ELFFILE) $$(find $(BASELIBS) -size +8c) $(LINKFLAGS) $(LINKFLAGPREFIX)-no_pie
Expand Down Expand Up @@ -407,13 +422,13 @@ $(CURDIR)/eclipsesym.xml:
$(RIOTBASE)/dist/tools/eclipsesym/cmdline2xml.sh > $@

# Extra make goals for testing and comparing changes.
include $(RIOTBASE)/Makefile.buildtests
include $(RIOTMAKE)/buildtests.inc.mk

# process provided features
include $(RIOTBASE)/Makefile.features
include $(RIOTMAKE)/features.inc.mk

# Export variables used throughout the whole make system:
include $(RIOTBASE)/Makefile.vars
include $(RIOTMAKE)/vars.inc.mk

# Warn if the selected board and drivers don't provide all needed features:
ifneq (, $(filter all, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)))
Expand Down Expand Up @@ -517,10 +532,10 @@ endif
include $(RIOTBASE)/dist/tools/desvirt/Makefile.desvirt

# include bindist target
include $(RIOTBASE)/Makefile.bindist
include $(RIOTMAKE)/bindist.inc.mk

# Add all USEMODULE modules to CFLAGS
include $(RIOTBASE)/Makefile.modules
include $(RIOTMAKE)/modules.inc.mk

# Build a header file with all common macro definitions and undefinitions
# make it phony to force re-run of the script every time even if the file exists
Expand Down
4 changes: 2 additions & 2 deletions boards/airfy-beacon/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
2 changes: 1 addition & 1 deletion boards/arduino-due/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh
export OFLAGS = -O binary

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk
4 changes: 2 additions & 2 deletions boards/arduino-zero/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export PORT_LINUX ?= /dev/ttyACM0
export PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# Add board selector (USB serial) to OpenOCD options if specified.
# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number.
Expand All @@ -22,4 +22,4 @@ ifneq (,$(SERIAL))
endif

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
4 changes: 2 additions & 2 deletions boards/calliope-mini/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# we support flashing through plain fscopy or using JLink
FLASHTOOL ?= fscopy
Expand All @@ -22,7 +22,7 @@ ifeq (fscopy,$(FLASHTOOL))
export DEBUGSERVER =
else ifeq (jlink,$(FLASHTOOL))
export JLINK_DEVICE := nrf51822
include $(RIOTBOARD)/Makefile.include.jlink
include $(RIOTMAKE)/tools/jlink.inc.mk
else
$(info ERROR: invalid flash tool specified)
endif
2 changes: 1 addition & 1 deletion boards/cc2538dk/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export PROGRAMMER_SERIAL ?= 06EB
# the debug UART is always the second tty with the matching serial number:
PORT_LINUX ?= $(word 2,$(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh '^$(PROGRAMMER_SERIAL)'))
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# debugger config
export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh
Expand Down
2 changes: 1 addition & 1 deletion boards/cc2650stk/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# configure the flash tool
export UNIFLASH_PATH ?= "UNIFLASH_PATH unconfigured"
Expand Down
4 changes: 2 additions & 2 deletions boards/ek-lm4f120xl/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
2 changes: 1 addition & 1 deletion boards/f4vi1/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# st-flash
export FLASHER = st-flash
Expand Down
6 changes: 3 additions & 3 deletions boards/fox/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ export CPU_MODEL = stm32f103re

# set default port depending on operating system
PORT_LINUX ?= /dev/ttyUSB1
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*B)))
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
4 changes: 2 additions & 2 deletions boards/frdm-k64f/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export OPENOCD_EXTRA_INIT
export PRE_FLASH_CHECK_SCRIPT = $(RIOTCPU)/kinetis_common/dist/check-fcfield-elf.sh

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
4 changes: 2 additions & 2 deletions boards/iotlab-common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*B)))

# setup serial terminal
export BAUD = 500000
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

# add the common header files to the include path
INCLUDES += -I$(RIOTBOARD)/iotlab-common/include
4 changes: 2 additions & 2 deletions boards/limifrog-v1/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
4 changes: 2 additions & 2 deletions boards/maple-mini/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
2 changes: 1 addition & 1 deletion boards/mbed_lpc1768/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk
4 changes: 2 additions & 2 deletions boards/microbit/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# we support flashing through plain fscopy or using JLink
FLASHTOOL ?= fscopy
Expand All @@ -22,7 +22,7 @@ ifeq (fscopy,$(FLASHTOOL))
export DEBUGSERVER =
else ifeq (jlink,$(FLASHTOOL))
export JLINK_DEVICE := nrf51822
include $(RIOTBOARD)/Makefile.include.jlink
include $(RIOTMAKE)/tools/jlink.inc.mk
else
$(info ERROR: invalid flash tool specified)
endif
2 changes: 1 addition & 1 deletion boards/msb-430-common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export CPU_MODEL = msp430f1612
PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# setup flash tool
export OFLAGS = -O ihex
Expand Down
4 changes: 2 additions & 2 deletions boards/msbiot/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
4 changes: 2 additions & 2 deletions boards/mulle/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ flash: $(RIOTCPU)/kinetis_common/dist/wdog-disable.bin
.DEFAULT_GOAL :=

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk
4 changes: 2 additions & 2 deletions boards/nrf51dongle/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))

# setup JLink for flashing
export JLINK_DEVICE := nrf51822
include $(RIOTBOARD)/Makefile.include.jlink
include $(RIOTMAKE)/tools/jlink.inc.mk

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk
4 changes: 2 additions & 2 deletions boards/nrf52dk/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export JLINK_PRE_FLASH := erase\nloadfile $(BINDIR)/softdevice.hex
export JLINK_FLASH_ADDR := 0x1f000
export LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld
endif
include $(RIOTBOARD)/Makefile.include.jlink
include $(RIOTMAKE)/tools/jlink.inc.mk

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk
2 changes: 1 addition & 1 deletion boards/nrf6310/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE)
export RESET_FLAGS = $(BINDIR)

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk
4 changes: 2 additions & 2 deletions boards/nucleo-common/Makefile.include.serial
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
2 changes: 1 addition & 1 deletion boards/opencm904/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk
4 changes: 2 additions & 2 deletions boards/openmote-cc2538/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ifeq ($(PROGRAMMER),jlink)
export JLINK_FLASH_ADDR := 200000
export JLINK_IF := JTAG
export TUI := 1
include $(RIOTBOARD)/Makefile.include.jlink
include $(RIOTMAKE)/tools/jlink.inc.mk
else
export OFLAGS = -O binary
export HEXFILE = $(ELFFILE:.elf=.bin)
Expand All @@ -24,4 +24,4 @@ else
endif

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk
4 changes: 2 additions & 2 deletions boards/pba-d-01-kw2x/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ifneq (,$(SERIAL))
endif

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk

# this board uses openocd
include $(RIOTBOARD)/Makefile.include.openocd
include $(RIOTMAKE)/tools/openocd.inc.mk
4 changes: 2 additions & 2 deletions boards/pca10000/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
# setup JLink for flashing
export JLINK_DEVICE := nrf51822
export JLINK_PRE_FLASH := w4 4001e504 1
include $(RIOTBOARD)/Makefile.include.jlink
include $(RIOTMAKE)/tools/jlink.inc.mk

# setup serial terminal
include $(RIOTBOARD)/Makefile.include.serial
include $(RIOTMAKE)/tools/serial.inc.mk
Loading

0 comments on commit 339a4da

Please sign in to comment.