]> git.codecow.com Git - Monocypher.git/commitdiff
replaced build.sh by a makefile
authorLoup Vaillant <loup@loup-vaillant.fr>
Fri, 10 Feb 2017 23:01:31 +0000 (00:01 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Fri, 10 Feb 2017 23:01:31 +0000 (00:01 +0100)
build.sh [deleted file]
makefile [new file with mode: 0644]
monocypher.c

diff --git a/build.sh b/build.sh
deleted file mode 100755 (executable)
index 256c001..0000000
--- a/build.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/bash
-
-CC="gcc"
-CFLAGS="-O2 -Wall -Wextra -std=c11"
-
-$CC $CFLAGS -c monocypher.c -DED25519_SHA512
-$CC $CFLAGS -c sha512.c
-$CC $CFLAGS -c test.c
-$CC $CFLAGS -o test test.o monocypher.o sha512.o
diff --git a/makefile b/makefile
new file mode 100644 (file)
index 0000000..4388c3b
--- /dev/null
+++ b/makefile
@@ -0,0 +1,21 @@
+CC=gcc
+CFLAGS=-O2 -Wall -Wextra -std=c11 -pedantic
+
+.PHONY: all clean
+
+all: test
+
+clean:
+       rm -f *.o test
+
+test: test.o monocypher.o sha512.o
+       $(CC) $(CFLAGS) -o $@ $^
+
+test.o: test.c
+       $(CC) $(CFLAGS) -c $^
+
+sha512.o: sha512.c
+       $(CC) $(CFLAGS) -c $^
+
+monocypher.o: monocypher.c
+       $(CC) $(CFLAGS) -c $^ -DED25519_SHA512
index ee524095ace9957eab5d0529481061f293867d3f..ef5844172e703569f1e677a3e5393bc6576431d0 100644 (file)
@@ -1311,7 +1311,7 @@ int crypto_unlock(u8       *plaintext,
                                   box, box + 16, text_size);
 }
 
-static const u8 null_nonce[24] = {};
+static const u8 null_nonce[24];
 
 void crypto_anonymous_lock(u8       *box,
                            const u8  random_secret_key[32],