2f30.org website
git clone git://git.2f30.org/divzeroweb
Log | Files | Refs | README | LICENSE

commit d4d48ac62b14c717cd8a23ce44c3095ef206c34d
parent 3282ac5f16903e87f24baddd4cd82578fbe678c7
Author: lostd <lostd@2f30.org>
Date:   Wed,  4 May 2016 23:24:26 +0100

Notes on legacy make implementations

Mguides/make.md | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/guides/make.md b/guides/make.md @@ -139,6 +139,22 @@ variable. We get: rm -f bin1 bin2 +#### Notes on various make implementations + +Some `make` implementations such as the IRIX one do not use the LDLIBS +variable in their default inference rules. We could do something like: + + LDFLAGS = $(LDFLAGS) $(LDLIBS) + +The problem with this is that the libraries will possibly appear before +the object files when linking and this may be a problem for some +compilers. The better solution is to rewrite the inference rules in a way +that includes LDLIBS at the end. For example: + + .c: + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) + + #### More reading on portability * [OpenBSD make(1)](