I have this make file
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)
When I run make all
it shows some python error saying -i
option param is missing. So it seems $(CONFIG)
is not going through shell
function.
How can make all
invoke python parse_config.py -i 'config.ini'
?
same way make debug
invoke python parse_config.py -i 'config-debug.ini'
?
Update:
After running make all SHELL+=-x
I get following output.
+ 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
But after that I get
+ python parse_config.py -p static -i static/config.ini
And make seems to continue to work.
This can be done using MAKECMDGOALS
variable.
ifeq ($(findstring debug,$(MAKECMDGOALS)),debug)
CONFIG=config-debug.ini
else
CONFIG=config.ini
endif
CONFIG_FILES := $(shell python parse_config.py -i $(CONFIG))
all: $(CONFIG) $(CONFIG_FILES)
echo $(CONFIG) $(CONFIG_FILES)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments