From: Fabio Scotoni <34964387+fscoto@users.noreply.github.com> Date: Thu, 12 Dec 2019 08:48:36 +0000 (+0100) Subject: makefile: Honor LDFLAGS variable if given X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=1655eb2ec8823e3c7e2cbe383bf368a4d8e6d9a0;p=Monocypher.git makefile: Honor LDFLAGS variable if given This allows specifying e.g. hardening options like -Wl,-z,relro for link-time options. It *is* normally possible to add these to CFLAGS, but LDFLAGS is the established way to do this and tooling expects it to work. See also POSIX on make(1), whose default rules use LDFLAGS. --- diff --git a/makefile b/makefile index bb25830..b17092e 100644 --- a/makefile +++ b/makefile @@ -100,7 +100,7 @@ lib/libmonocypher.so: lib/$(SONAME) ln -sf `basename $<` $@ lib/$(SONAME): lib/monocypher.o $(LINK_ED25519) @mkdir -p $(@D) - $(CC) $(CFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ + $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ lib/monocypher-ed25519.o: src/optional/monocypher-ed25519.c \ src/optional/monocypher-ed25519.h lib/chacha20.o : src/deprecated/chacha20.c src/deprecated/chacha20.h