My makefile has line like this
CFLAGS = -c -g -D OPT1 -D OPT2
I want to pass this arguments through command line like this
make ARG1= OPT1 ARG2 =OPT2
If I dont pass these arguments through command line I want makefile to use take default values defined in makefile. How do I do that ?
Just do something like this in the makefile:
Then on the command line:
When you specify falues for
OPT1and/orOPT2on the command line these will override the default values in the makefile.Note that you probably want the
-eoption withmakein most cases to force everything to be re-built with the newOPT1,OPT2values.