From 718b1a6ea1c44bcf15e55d3c265310e1cd9211fa Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 1 Mar 2021 01:52:41 +0100 Subject: Improve makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1712539..7338d5d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.NONPOSIX: +.POSIX: # If possible, use CONFIGFILE=optimised.mk CONFIGFILE = config.mk @@ -110,21 +110,22 @@ $(OBJ): $(HDR) $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS) libkeccak.$(LIBEXT): $(OBJ) - $(CC) $(LIBFLAGS) -o $@ $^ $(LDFLAGS) + $(CC) $(LIBFLAGS) -o $@ $(OBJ) $(LDFLAGS) libkeccak.a: $(OBJ) - $(AR) rc $@ $? + -rm -f -- $@ + $(AR) rc $@ $(OBJ) $(AR) -s $@ test: test.o libkeccak.a - $(CC) $(FLAGS) -o $@ $^ $(LDFLAGS) + $(CC) $(FLAGS) -o $@ test.o libkeccak.a $(LDFLAGS) test.o: test.c $(HDR) $(CC) $(FLAGS) -O3 -c -o $@ test.c $(CFLAGS) $(CPPFLAGS) benchmark: benchmark.o libkeccak.a - $(CC) $(FLAGS) -o $@ $^ $(LDFLAGS) + $(CC) $(FLAGS) -o $@ benchmark.o libkeccak.a $(LDFLAGS) benchmark.o: benchmark.c $(HDR) $(CC) $(FLAGS) -O3 -c -o $@ benchmark.c $(CFLAGS) $(CPPFLAGS) -- cgit v1.2.3-70-g09d2