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
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