build: Allow overriding BUILDDIR from command line

You can now specify BUILDDIR= on the make command line,
e.g., in order to put that into a tmpfs or similar.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2020-09-18 11:50:00 +02:00 committed by Jouni Malinen
parent b3313939b7
commit ce963433bd

View file

@ -7,7 +7,8 @@ all: _all
# setup some variables # setup some variables
ROOTDIR := $(dir $(lastword $(MAKEFILE_LIST))) ROOTDIR := $(dir $(lastword $(MAKEFILE_LIST)))
ROOTDIR := $(dir $(ROOTDIR:%../src/=%))../ ROOTDIR := $(dir $(ROOTDIR:%../src/=%))../
BUILDDIR := $(ROOTDIR)build BUILDDIR ?= $(abspath $(ROOTDIR)build)
BUILDDIR := $(BUILDDIR:%/=%)
_PROJ := $(abspath $(dir $(firstword $(MAKEFILE_LIST)))) _PROJ := $(abspath $(dir $(firstword $(MAKEFILE_LIST))))
ABSROOT := $(abspath $(ROOTDIR)) ABSROOT := $(abspath $(ROOTDIR))
_PROJ := $(_PROJ:$(ABSROOT)/%=%) _PROJ := $(_PROJ:$(ABSROOT)/%=%)