fix regression supporting HOST, NATIVE vars set from config.mak
the logic for processing the NATIVE var (shortcut for HOST=$(TARGET)) and HOST var took place before inclusion of config.mak, causing NATIVE not to be honored and wrong BUILD_DIR and OUTPUT defaults to be used if either was set from config.mak rather than on the make command line. the current preferred interface is the command line, but the regression was unintentional. to fix it, replace the conditional blocks of the makefile with conditional functions in recursively-expanded variables HOST, BUILD_DIR, and OUTPUT. this way, assignments to NATIVE or HOST that take place later in config.mak will affect the resulting values, as intended.
This commit is contained in:
parent
1e04a0d998
commit
5dd1a49567
14
Makefile
14
Makefile
|
@ -25,17 +25,9 @@ LINUX_SITE = https://cdn.kernel.org/pub/linux/kernel
|
||||||
|
|
||||||
DL_CMD = wget -c -O
|
DL_CMD = wget -c -O
|
||||||
|
|
||||||
ifneq ($(NATIVE),)
|
HOST = $(if $(NATIVE),$(TARGET))
|
||||||
HOST := $(TARGET)
|
BUILD_DIR = build/$(if $(HOST),$(HOST),local)/$(TARGET)
|
||||||
endif
|
OUTPUT = $(CURDIR)/output$(if $(HOST),-$(HOST))
|
||||||
|
|
||||||
ifneq ($(HOST),)
|
|
||||||
BUILD_DIR = build/$(HOST)/$(TARGET)
|
|
||||||
OUTPUT = $(CURDIR)/output-$(HOST)
|
|
||||||
else
|
|
||||||
BUILD_DIR = build/local/$(TARGET)
|
|
||||||
OUTPUT = $(CURDIR)/output
|
|
||||||
endif
|
|
||||||
|
|
||||||
REL_TOP = ../../..
|
REL_TOP = ../../..
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue