google / kati

An experimental GNU make clone

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Another missing endef silently ignored

colincross opened this issue · comments

define test1
# Typo below, endif instead of endef
endif
define test2
endef

foo:
    echo FAIL
$ make -f test.mk
test.mk:1: *** missing `endef', unterminated `define'.  Stop.
$ ckati -f test.mk
echo FAIL
FAIL

This is related to kati not supporting nested defines:

define outer
define inner
PASS
endef
endef

A := $(inner)
$(eval $(outer))

foo:
    echo $(A)
    echo $(inner)
$ make -f test.mk 
echo 

echo PASS
PASS
$ ckati -f test.mk
test.mk:5: *** missing separator.

Properly supporting nested defines doesn't seem important, but parsing them correctly does.