> > > On Wednesday 14 January 2009 04:09:16 Masatake YAMATO wrote: > > > > > yes, there has been too much "put all CPPFLAGS into CFLAGS and dont > > > > > use CPPFLAGS" in the tree. it isnt a critical issue, but one we > > > > > should be fixing as we go rather than introducing more of the same. > > > > > > > > > > as for LOADLIBES vs LDLIBS, i believe the difference is that > > > > > LOADLIBES are local libraries (i.e. static archives from the package > > > > > -- liblta.a) while LDLIBS are external libraries (i.e. things like > > > > > -lrt or -lcap or ...). but that might be more my opinion than > > > > > reality :). i'm happy as long as one of those variables is being > > > > > used instead of LDFLAGS. > > > > > > > > Could you write down these conversions used in LTP to toplevel Makefile > > > > or somewhere? I was confused CFLAGS and CPPFLAGS. > > > > > > the conventions enforced are the standard ones. LTP isnt redefining any > > > of the flags from their normal meaning. here's a quick summary off the > > > top of my head: > > > CFLAGS - used when compiling/linking C code (no CPPFLAGS!) > > > CXXFLAGS - used when compiling/linking C++ code (no CPPFLAGS!) > > > CPPFLAGS - used when preprocessor is run (so C/C++ compiling an $(CPP) > > > checks) LDFLAGS - linker flags (no libraries) used when linking > > > LDLIBS - libraries listed after objects during link > > > > > > i imagine the gcc manual has a definition for preprocessor flags, but the > > > general usage is all -I/-D/-U flags. there are also a few more flags > > > (like the -std= one) that should be in CPPFLAGS rather than > > > CFLAGS/CXXFLAGS, but those dont come up too often. > > > > Thank you. I hope this is written in top level Makefile. > > i guess it would be easy enough to document there
... I don't have write-access for CVS, and you may have it so I hoped:) I know I should prepare a patch to be reviewed. The most of all part of this patch is taken from mail from Mike. So I think the sign of Mike is needed to merge the patch. Anyway my sign is here. Signed-off-by: Masatake YAMATO <yam...@redhat.com> diff --git a/Makefile b/Makefile index 7fab4e8..07d7d7e 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +# +# About cross compile +# +# ---------------------------------------------------------------------- # To cross compile, override one or more of CC, AR, CROSS_CFLAGS, # LOADLIBES, LDFLAGS, & LIB_DIR and be sure to always build from the top level. # @@ -26,7 +30,7 @@ # Note: If you override a variable from the commandline all # assignments to it in the Makefiles will be ignored. To set it both # in the commandline and in the Makefiles use a dummy variable like in -# CFLAGS +# CFLAGS. ifdef CROSS_COMPILE CROSS_COMPILER = $(CROSS_COMPILE) @@ -39,6 +43,30 @@ endif HAS_NUMA=$(shell sh tools/scripts/numa_test.sh) +# +# Macros +# +# ---------------------------------------------------------------------- +# The conventions enforced are the standard ones. LTP isnt redefining any +# of the flags from their normal meaning. here's a quick summary: +# +# CFLAGS - used when compiling/linking C code (no CPPFLAGS!) +# +# CXXFLAGS - used when compiling/linking C++ code (no CPPFLAGS!) +# +# CPPFLAGS - used when preprocessor is run (so C/C++ compiling an $(CPP) +# checks) +# +# LDFLAGS - linker flags (no libraries) used when linking +# +# LDLIBS - libraries listed after objects during link +# +# Above list is ideal: Many codes in LTP violates above list. +# e.g. -I and -D are passed to CFLAGS. +# +# Currently the violation isn't critical. However, it should +# be fixed. +# export CFLAGS += -Wall $(CROSS_CFLAGS) export CC AR RANLIB CPPFLAGS LDFLAGS HAS_NUMA ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list