makefile吧 关注:103贴子:179
  • 1回复贴,共1

打印$(PLAT)为macosx,但用ifeq 判断$(PLAT却不等于macosx,求助

只看楼主收藏回复

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


IP属地:山东1楼2016-09-01 19:15回复
    你把ifeq理解错了,换成shell比较应该就可以了


    来自iPhone客户端2楼2017-01-29 13:14
    回复