gcc's makefile

Hi,
Every professional programer,there is a question about makefile.Would please you explain the follwing makefile's command:
FFLAGS = -fno-second-underscore
FITSLIB = -L$(CFITSIO)/lib -lcfitsio -Wl,-rpath,$(CFITSIO)/lib
FOBJS := $(patsubst %.f,%.o,$(wildcard *.f))

What is they mean?Thank you very much!
wenli wang
th28,Novenber,2010
Last edited on
It defines the Variables FFLAGS, FITSLIB and FOBJS with the respective compiler parameters. Later in the makefile $(FFLAGS) for example will be substituted to -fno-second-underscore .

I don't know the exact difference between := and = but maybe this helps:
http://www.gnu.org/software/make/manual/make.html
I know it defines enviroment variables,I mean how to understand the statement:
-fno-second-underscore
-L$(CFITSIO)/lib -lcfitsio -Wl,-rpath,$(CFITSIO)/lib
:= $(patsubst %.f,%.o,$(wildcard *.f))

how the codes work?
The meaning of these compiler flags? Just take a look at gcc's manpage. -L for example, defines a library search path...
Hi,
I think you should search for manual 'how to compile a Fortran program with gcc'. Those env variables start from 'F' (FOBJS) sounds like 'make object file from Fortran'.
Yeah,I have knew that "patsubst" and "wildcard" are the makefile's function,"-Wl,-rpath" is calling dynamic library or share library.And the "-fno-second-underscore" is option of code generation convention for gcc compiler.
Thank you.
Topic archived. No new replies allowed.