H Hello, everyone. I intent to write a batch(umake.bat) file that does the following:
Check whether -f appears in one of bat parameters, so that I can take different actions in the .bat.
CASE 1:
User call
umake
Inside umake.bat I will execute
make -f Makefile.umk
CASE 2:
User call
umake debug=1 var="big cat"
Inside umake.bat I will execute
make debug=1 var="big cat" -f Makefile.umk
CASE 3:
User call
umake -f special.mk debug=1
Inside umake.bat I will execute
make -f special.mk debug=1
CASE 4:
User call
umake debug=1 -f
Inside umake.bat I will execute
make debug=1 -f
In case 4, make(GNU make) will not succeed because missing file name after -f . For simplicity, I don’t have to care for this since it is user’s fault and the problem will be reported by GNU make .
Summary:
- If user provide
-f xxxin command parameter, I’ll pass those parameter tomake. - If user does not provide
-f xxx, I’ll callmakewith all user’s parameter as well as appending-f Makefile.umkasmake‘s extra parameters.
Thank you.
I seems to have found the solution, although the code is something verbose.
NOTES:
%~1is a must. Because: If%1has value"big cat",%~1makes itbig cat, so that we can surrond%~1with quotes.