In the GNU Make documentation, variables LDLIBS and LOADLIBES are not documented in its corresponding section. I've read that these variables exists only for compatibility purposes, and that they are equivalents (same meaning). But, LDLIBS is still used spreadly.
Could it be said that LDLIBS is a deprecated variable, or would it be safe using it? If not, why is LDLIBS ignored by its documentation?
LDLIBS : Library flags or names given to compilers when they are supposed to invoke the linker, ld . LOADLIBES is a deprecated (but still supported) alternative to LDLIBS .
6.1 Basics of Variable References This special significance of ' $ ' is why you must write ' $$ ' to have the effect of a single dollar sign in a file name or recipe. Variable references can be used in any context: targets, prerequisites, recipes, most directives, and new variable values.
The file name of the target of the rule. If the target is an archive member, then ' $@ ' is the name of the archive file. In a pattern rule that has multiple targets (see Introduction to Pattern Rules), ' $@ ' is the name of whichever target caused the rule's recipe to be run.
The make-specific variables (the ones in capital letters) follow a name convention such that: CC refers to the compiler (gcc in this case); CFLAGS contains compiler directives/options; and LDFLAGS is a list of link (or "load") directives (here, instructions to link with the C math library).
It seems LOADLIBES
is deprecated, but LDLIBS
is not. Thus, manual says:
LDFLAGS
: Extra flags to give to compilers when they are supposed to invoke the linker,ld
, such as-L
. Libraries (-lfoo
) should be added to theLDLIBS
variable instead.
LDLIBS
: Library flags or names given to compilers when they are supposed to invoke the linker,ld
.LOADLIBES
is a deprecated (but still supported) alternative toLDLIBS
. Non-library linker flags, such as-L
, should go in theLDFLAGS
variable.
The GNU make manual says, in http://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html:
The following tables describe of some of the more commonly-used predefined variables. This list is not exhaustive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With