tests/var-set.mk
author Benjamin Smedberg <benjamin@smedbergs.us>
Thu, 12 Feb 2009 09:36:35 -0500
changeset 101 ce89bcf91bf6
parent 75 e4d4c5c8d23a
child 191 7a8dc41115d6
permissions -rw-r--r--
Two bug fixes: * fix variable value when it is assigned across a line continuation: the whitespace should be stripped all the way across * fix ifeq/ifneq arguments: when the () form is used, whitespace should be stripped around the comma

#T commandline: ['OBASIC=oval']

BASIC = val

TEST = $(TEST)

TEST2 = $(TES
TEST2 += T)

TES T = val

RECVAR = foo
RECVAR += var baz 

IMMVAR := bloo
IMMVAR += $(RECVAR)

BASIC ?= notval

all: BASIC = valall
all: RECVAR += $(BASIC)
all: IMMVAR += $(BASIC)
all: UNSET += more
all: OBASIC += allmore

RECVAR = blimey

TESTEMPTY = \
	$(NULL)

all: other
	test "$(TEST2)" = "val"
	test '$(value TEST2)' = '$$(TES T)'
	test "$(RECVAR)" = "blimey valall"
	test "$(IMMVAR)" = "bloo foo var baz  valall"
	test "$(UNSET)" = "more"
	test "$(OBASIC)" = "oval"
	test "$(TESTEMPTY)" = ""
	@echo TEST-PASS

OVAR = oval
OVAR ?= onotval

other: OVAR ?= ooval
other: LATERVAR ?= lateroverride

LATERVAR = olater

other:
	test "$(OVAR)" = "oval"
	test "$(LATERVAR)" = "lateroverride"