有没有更好的方法从 makefile 中获取设置环境变量的脚本?
FLAG ?= 0
ifeq ($(FLAG),0)
export FLAG=1
/bin/myshell -c '<source scripts here> ; $(MAKE) $@'
else
...targets...
endif
Makefile 默认 shell 是/bin/sh
哪个不执行source
.
将外壳更改为/bin/bash
使之成为可能:
# Makefile
SHELL := /bin/bash
rule:
source env.sh && YourCommand
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)