Projects STRLCPY criu Commits 59930e5a
🤬
  • 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 <[email protected]>
    Acked-by: Cyrill Gorcunov <[email protected]>
    Signed-off-by: Andrei Vagin <[email protected]>
  • Loading...
  • Radostin Stoyanov committed with Andrei Vagin 5 years ago
    59930e5a
    1 parent 69e35362
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    scripts/nmk/scripts/tools.mk
    skipped 3 lines
    4 4  # System tools shorthands
    5 5  RM := rm -f
    6 6  HOSTLD ?= ld
    7  -LD ?= $(CROSS_COMPILE)$(HOSTLD)
     7 +ifeq ($(origin LD), default)
     8 +LD := $(CROSS_COMPILE)$(HOSTLD)
     9 +endif
    8 10  HOSTCC ?= gcc
    9  -CC ?= $(CROSS_COMPILE)$(HOSTCC)
     11 +ifeq ($(origin CC), default)
     12 +CC := $(CROSS_COMPILE)$(HOSTCC)
     13 +endif
    10 14  CPP := $(CC) -E
    11 15  AS := $(CROSS_COMPILE)as
    12 16  AR := $(CROSS_COMPILE)ar
    skipped 26 lines
Please wait...
Page is in error, reload to recover