mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
tools.mk: Define CC if not set to 'default'
FOO ?= bar is equivalent to ifeq ($(origin FOO), undefined) FOO = bar endif However, when CC is not set its value is 'default' rather than 'undefined'. >From [1]: 'undefined': if variable was never defined. 'default': if variable has a default definition, as is usual with CC and so on. See Variables Used by Implicit Rules. Note that if you have redefined a default variable, the origin function will return the origin of the later definition. [1] https://www.gnu.org/software/make/manual/make.html Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com> Acked-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
parent
69e3536285
commit
59930e5afb
1 changed files with 6 additions and 2 deletions
|
|
@ -4,9 +4,13 @@ ifndef ____nmk_defined__tools
|
|||
# System tools shorthands
|
||||
RM := rm -f
|
||||
HOSTLD ?= ld
|
||||
LD ?= $(CROSS_COMPILE)$(HOSTLD)
|
||||
ifeq ($(origin LD), default)
|
||||
LD := $(CROSS_COMPILE)$(HOSTLD)
|
||||
endif
|
||||
HOSTCC ?= gcc
|
||||
CC ?= $(CROSS_COMPILE)$(HOSTCC)
|
||||
ifeq ($(origin CC), default)
|
||||
CC := $(CROSS_COMPILE)$(HOSTCC)
|
||||
endif
|
||||
CPP := $(CC) -E
|
||||
AS := $(CROSS_COMPILE)as
|
||||
AR := $(CROSS_COMPILE)ar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue