【发布时间】:2014-01-28 14:12:42
【问题描述】:
我有这个make文件
all : CONFIG=config.ini
debug : CONFIG=config-debug.ini
CONFIG_FILES := $(shell python parse_config.py -i $(CONFIG))
all: $(CONFIG) $(CONFIG_FILES)
echo $(CONFIG) $(CONFIG_FILES)
当我运行make all 时,它显示一些python 错误,说-i 选项参数丢失。所以看起来$(CONFIG) 没有通过shell 函数。
make all 如何调用python parse_config.py -i 'config.ini'?
同样的方式make debug 调用python parse_config.py -i 'config-debug.ini'?
更新:
运行make all SHELL+=-x 后,我得到以下输出。
+ python parse_config.py -p static -i
usage: parse_config.py [-h] -i INPUT_JSB3 [-p PREFIX]
parse_config.py: error: argument -i: expected one argument
但在那之后我得到了
+ python parse_config.py -p static -i static/config.ini
make 似乎还能继续工作。
【问题讨论】:
标签: python shell build makefile