打印$(PLAT)为macosx,但用ifeq 判断$(PLAT却不等于macosx,求助
makefile吧
全部回复
仅看楼主
level 1
1124803369 楼主
PLAT ?= none
PLATS = linux freebsd macosx
.PHONY : none $(PLATS) all skynet clean
none :
@echo "Please do 'make PLATFORM' where PLATFORM is one of these:"
@echo " $(PLATS)"
linux : PLAT = linux
macosx : PLAT = macosx
freebsd : PLAT = freebsd
linux macosx freebsd :
@echo $(PLAT)
ifeq ($(PLAT), macosx)
@echo macosx $(PLAT)
else
@echo other $(PLAT)
endif
以上为源码,下面的是执行make macosx后的输出:
macosx
other macosx
2016年09月01日 11点09分 1
1