1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #10038 from smlng/pr/make/buildoutdir

make: introduce common BUILD_DIR
This commit is contained in:
Gaëtan Harter 2019-01-16 14:18:48 +01:00 committed by GitHub
commit 61452669b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 0 deletions

2
.gitignore vendored
View File

@ -9,6 +9,8 @@ doc/doxygen/*.db
doc/doxygen/*.tmp doc/doxygen/*.tmp
# Built binaries # Built binaries
*bin *bin
# Build directory
/build
# Backup files # Backup files
*~ *~
*.orig *.orig

View File

@ -23,6 +23,7 @@ RIOTTOOLS ?= $(RIOTBASE)/dist/tools
RIOTPROJECT ?= $(shell git rev-parse --show-toplevel 2>/dev/null || pwd) RIOTPROJECT ?= $(shell git rev-parse --show-toplevel 2>/dev/null || pwd)
GITCACHE ?= $(RIOTTOOLS)/git/git-cache GITCACHE ?= $(RIOTTOOLS)/git/git-cache
GIT_CACHE_DIR ?= $(HOME)/.gitcache GIT_CACHE_DIR ?= $(HOME)/.gitcache
BUILD_DIR ?= $(RIOTBASE)/build
APPDIR ?= $(CURDIR) APPDIR ?= $(CURDIR)
BINDIRBASE ?= $(APPDIR)/bin BINDIRBASE ?= $(APPDIR)/bin
BINDIR ?= $(BINDIRBASE)/$(BOARD) BINDIR ?= $(BINDIRBASE)/$(BOARD)
@ -39,6 +40,7 @@ __DIRECTORY_VARIABLES := \
RIOTTOOLS \ RIOTTOOLS \
RIOTPROJECT \ RIOTPROJECT \
APPDIR \ APPDIR \
BUILD_DIR \
BINDIRBASE \ BINDIRBASE \
BINDIR \ BINDIR \
CCACHE_BASEDIR \ CCACHE_BASEDIR \
@ -58,6 +60,7 @@ override RIOTTOOLS := $(abspath $(RIOTTOOLS))
override RIOTPROJECT := $(abspath $(RIOTPROJECT)) override RIOTPROJECT := $(abspath $(RIOTPROJECT))
override GITCACHE := $(abspath $(GITCACHE)) override GITCACHE := $(abspath $(GITCACHE))
override APPDIR := $(abspath $(APPDIR)) override APPDIR := $(abspath $(APPDIR))
override BUILD_DIR := $(abspath $(BUILD_DIR))
override BINDIRBASE := $(abspath $(BINDIRBASE)) override BINDIRBASE := $(abspath $(BINDIRBASE))
override BINDIR := $(abspath $(BINDIR)) override BINDIR := $(abspath $(BINDIR))
override PKGDIRBASE := $(abspath $(PKGDIRBASE)) override PKGDIRBASE := $(abspath $(PKGDIRBASE))

View File

@ -108,14 +108,18 @@ ETC_LOCALTIME = $(realpath /etc/localtime)
# hardware which may not be reachable from inside the container. # hardware which may not be reachable from inside the container.
..in-docker-container: ..in-docker-container:
@$(COLOR_ECHO) '$(COLOR_GREEN)Launching build container using image "$(DOCKER_IMAGE)".$(COLOR_RESET)' @$(COLOR_ECHO) '$(COLOR_GREEN)Launching build container using image "$(DOCKER_IMAGE)".$(COLOR_RESET)'
@# HACK: Handle directory creation here until it is provided globally
$(Q)mkdir -p $(BUILD_DIR)
$(DOCKER) run $(DOCKER_FLAGS) -t -u "$$(id -u)" \ $(DOCKER) run $(DOCKER_FLAGS) -t -u "$$(id -u)" \
-v '$(RIOTBASE):$(DOCKER_BUILD_ROOT)/riotbase' \ -v '$(RIOTBASE):$(DOCKER_BUILD_ROOT)/riotbase' \
-v '$(BUILD_DIR):$(DOCKER_BUILD_ROOT)/build' \
-v '$(RIOTCPU):$(DOCKER_BUILD_ROOT)/riotcpu' \ -v '$(RIOTCPU):$(DOCKER_BUILD_ROOT)/riotcpu' \
-v '$(RIOTBOARD):$(DOCKER_BUILD_ROOT)/riotboard' \ -v '$(RIOTBOARD):$(DOCKER_BUILD_ROOT)/riotboard' \
-v '$(RIOTMAKE):$(DOCKER_BUILD_ROOT)/riotmake' \ -v '$(RIOTMAKE):$(DOCKER_BUILD_ROOT)/riotmake' \
-v '$(RIOTPROJECT):$(DOCKER_BUILD_ROOT)/riotproject' \ -v '$(RIOTPROJECT):$(DOCKER_BUILD_ROOT)/riotproject' \
-v '$(ETC_LOCALTIME):/etc/localtime:ro' \ -v '$(ETC_LOCALTIME):/etc/localtime:ro' \
-e 'RIOTBASE=$(DOCKER_BUILD_ROOT)/riotbase' \ -e 'RIOTBASE=$(DOCKER_BUILD_ROOT)/riotbase' \
-e 'BUILD_DIR=$(DOCKER_BUILD_ROOT)/build' \
-e 'CCACHE_BASEDIR=$(DOCKER_BUILD_ROOT)/riotbase' \ -e 'CCACHE_BASEDIR=$(DOCKER_BUILD_ROOT)/riotbase' \
-e 'RIOTCPU=$(DOCKER_BUILD_ROOT)/riotcpu' \ -e 'RIOTCPU=$(DOCKER_BUILD_ROOT)/riotcpu' \
-e 'RIOTBOARD=$(DOCKER_BUILD_ROOT)/riotboard' \ -e 'RIOTBOARD=$(DOCKER_BUILD_ROOT)/riotboard' \

View File

@ -7,6 +7,7 @@ SCANBUILD_ENV_VARS := \
BINDIR \ BINDIR \
BINDIRBASE \ BINDIRBASE \
BOARD \ BOARD \
BUILD_DIR \
BUILDRELPATH \ BUILDRELPATH \
CC \ CC \
CFLAGS \ CFLAGS \

View File

@ -29,6 +29,7 @@ export RIOTPROJECT # Top level git root of the project being built, or
export RIOTMAKE # Location of all supplemental Makefiles (such as this file) export RIOTMAKE # Location of all supplemental Makefiles (such as this file)
export BINDIRBASE # This is the folder where the application should be built in. For each BOARD a different subfolder is used. export BINDIRBASE # This is the folder where the application should be built in. For each BOARD a different subfolder is used.
export BINDIR # This is the folder where the application should be built in. export BINDIR # This is the folder where the application should be built in.
export BUILD_DIR # This is the base folder to store common build files and artifacts, e.g. test results.
export APPDIR # The base folder containing the application export APPDIR # The base folder containing the application
export PKGDIRBASE # The base folder for building packages export PKGDIRBASE # The base folder for building packages