I have just started using GNU's make command to automate things. I ran into a problem and need some help. I have a python script (abc.py) which accepts a command line argument with short notation as ("-t") and long notation("--type") and can be run as :
python abc.py --type "blah"
However, I wish to run this script(abc.py) from a Makefile. So, now my Makefile looks as:
command:
python abc.py
I can now execute the code as make command, but how do I accept and pass the user input to abc.py?
Hope, the question is well formed.
TBH this isn't really what make designed to do. You'd typically get make to figure out the parameter programmatically or use different targets for different sets of parameters. This can be achieved using environment variables. If you changed your makefile to look like this:
command:
python abc.py ${PARAMS}
Your command would then look like this:
make command PARAMS='--type "blah"'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With