今天在学习makefile的时候遇到一个问题,执行命令的时候老师报:make8.mk:11: *** missing separator. Stop.的错误。
场景还原:
Makefile文件名:
make8.mk
<span style="font-size:18px;">#this file is just a demo to test the make
define print_target
@echo the make target is $(MAKECMDGOALS)
endef
.PHONY:values clean makecmd
values:
$(print_target)
clean:
$(print_target)
@echo execute the clean target
ifeq($(MAKECMDGOALS),clean)
print_string=the make target is clean
else
print_string=the make target is $(MAKECMDGOALS)
endif
makecmd:
@echo $(print_string)</span>
执行命令出现一下情况:
desktop:~/work$ make -f make8.mk makecmd
make8.mk:12: