"... but I want to know which way is right."
The right way is to keep up with the names of the standard make variables, in particular CXXFLAGS and LDFLAGS .
You do not want to specify libraries for linker flags, as you are trying to do here (by specifying topics in fact):
FLAGS = ... ../intel/mkl/lib/intel64/libmkl_scalapack_ilp64.a
Instead of using FLAGS and providing a direct object for binding, you should rather use the standard make2 variable for LDFLAGS to set the path and let the linker find the appropriate static or shared libraries:
LDFLAGS += -L../intel/mkl/lib/intel64 -lmkl_scalapack_ilp64
Differences from compilation phase flags ( CXXFLAGS ) and scene flag bindings ( LDFLAGS ).
Besides
To avoid this
make -f Makefile clean
in your final target rule (maybe this was added to avoid being absent, to catch up with the header dependencies), add the -MF parameter to CXXFLAGS and include the results.
Here is more detailed information about the various methods:
Autosendency Generation
source share