Calling one target from another and also pass a variable or value in makefile

痞子三分冷 提交于 2021-02-11 14:49:12

问题


I need to call "target_1" from "target_2" plus also pass on a variable to the "target_1".

.PHONY:target_1
target_1: 
ifeq ($(RQM_SETUP),ci)
        mkdir /tmp/$1
        chown 1000:1000 /tmp/$1
else
    @echo "Nothing to do" 
endif


.PHONY:target_2
target_2: 
    $(MAKE) target_1(dags)

So like in this eg, target_2 would call target_1 and also pass on value as "dags" to it. So that it would create a "/tmp/dags" folder

来源:https://stackoverflow.com/questions/63884790/calling-one-target-from-another-and-also-pass-a-variable-or-value-in-makefile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!