0
我有一個由「gmake -f Makefile foo」執行的Makefile,如下所示。Makefile:將遞歸調用轉換爲順序流程
foo:
#set var = 1
@$(MAKE) bar var=1
bar:
#hello.mk is included
@echo 「success」
ifeq ($(var), 1)
include test\hello.mk
endif
我想將其轉換爲連續流,喜歡的東西在下面,因爲它有更少的開銷,並不需要退一步這個Makefile。
foo:
$(eval var=1)
@$(bar)
define bar
include test\hello.mk #this doesn’t work
@echo 「success」
endef
我不能有一個include函數或目標內聲明,所以我應該怎麼去解決這個問題,使這個Makefile的順序沒有撥打電話?