aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-03-01 01:52:41 +0100
committerMattias Andrée <maandree@kth.se>2021-03-01 01:52:41 +0100
commit718b1a6ea1c44bcf15e55d3c265310e1cd9211fa (patch)
tree845d8af1096f28425fa2b6bd0281bceb8ee6b51f /Makefile
parentStyle fix (diff)
downloadlibkeccak-718b1a6ea1c44bcf15e55d3c265310e1cd9211fa.tar.gz
libkeccak-718b1a6ea1c44bcf15e55d3c265310e1cd9211fa.tar.bz2
libkeccak-718b1a6ea1c44bcf15e55d3c265310e1cd9211fa.tar.xz
Improve makefile
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile11
1 files 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)