Makefile

Dear all,

I have a quite simple question about how to manipulate "makefile.am". I intend to:

  1. "CFLAGS" and "CXXFLAGS" have no value at all. I know that these values get "-g -O2" by default. On the other hand, when I try to set them as "CFLAGS = " in "makefile.am", I get warning messages that these values are user defined and should not be changes.

  2. I want to add some libraries exactly at the end of the linker line. I am able to add my libraries to the beginning of linker line by adding:

AM_CXXFLAGS = $(INTEL_CXXFLAGS) $(MKL)

but in this case I get some undefined references. Is there any way to add link to some libraries afeter "-o xxx" when linker is called?

Thanks for your help,

Dan

Create a new variable to carry whatever you want to any spot where you want it?

Is this a source package with a ./configure file?

CFLAGS="..." LDFLAGS="..." ./configure

Yes, I have ./configure too.

---------- Post updated at 03:41 PM ---------- Previous update was at 03:37 PM ----------

I can create a variable and I did, but the problem is how can I append it to the end of the linker parameters list. As you know, the parameters to the linker is defined as:

CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
        -o $@

and I wish ti have it like this:

CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
        -o $@ $(MKL)

where "MKL" is the variable that has my switches and library paths. I also tried to redefine "CXXLINK" in the "Makefile.am" but the result wasn't successful. Is there any solution to this (I am sure there is)?

Regards,

D.

Like above, try CXXLINK="extrastuff" ./configure