Using Sun WorkShop

Overriding of Macro Values

The initial values of makefile macros can be overridden with command-line options to make. For example, suppose you have the following line at the top of makefile:

FFLAGS=-u

and the compile-line of computepts.f:

f77 $(FFLAGS) -c computepts.f

and the final link:

f77 $(FFLAGS) $(OBJ) -lcore77 -lcore -lsunwindow \ lpixrect -o pattern

Now a simple make command without arguments uses the value of FFLAGS set above. However, this can be overridden from the command line:


demo% make "FFLAGS=-u -O"

Here, the definition of the FFLAGS macro on the make command line overrides the makefile initialization, and both the -O flag and the -u flag are passed to f77. Note that "FFLAGS=" can also be used on the command line to reset the macro so that it has no effect.


Note -

You can use the Make Macros dialog box in Sun WorkShop to override the value of a macro (see "Using Makefile Macros").