NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

default make rules



How does make compose CXXFLAGS and LDFLAGS by default?  

$ touch src.C  
$ CXXFLAGS=cxxflags LDFLAGS=ldflags make -n src
c++ cxxflags  ldflags -o src src.C 

In general that's not good because the linker options need to follow
the source filename on the command line.  Otherwise at least some
symbols will be missed sometimes.  

AFAICT this is controlled by /usr/share/mk/sys.mk: 

        LINK.cc?=       ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}

and there is no provision to interpolate the input into that string,
nor any macro, say, CXXINPUT, to represent the rest of the command
line.  It's always concatenated onto the end.  

Thanks.  

--jkl


Home | Main Index | Thread Index | Old Index