Skip to content

Commit

Permalink
fix regression supporting HOST, NATIVE vars set from config.mak
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
richfelker committed Aug 6, 2018
1 parent 1e04a0d commit 5dd1a49
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,9 @@ LINUX_SITE = https://cdn.kernel.org/pub/linux/kernel

DL_CMD = wget -c -O

ifneq ($(NATIVE),)
HOST := $(TARGET)
endif

ifneq ($(HOST),)
BUILD_DIR = build/$(HOST)/$(TARGET)
OUTPUT = $(CURDIR)/output-$(HOST)
else
BUILD_DIR = build/local/$(TARGET)
OUTPUT = $(CURDIR)/output
endif
HOST = $(if $(NATIVE),$(TARGET))
BUILD_DIR = build/$(if $(HOST),$(HOST),local)/$(TARGET)
OUTPUT = $(CURDIR)/output$(if $(HOST),-$(HOST))

REL_TOP = ../../..

Expand Down

0 comments on commit 5dd1a49

Please sign in to comment.