aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-02-21 22:50:44 +0100
committerMattias Andrée <maandree@kth.se>2022-02-21 22:50:44 +0100
commit2690fcaea7973b0e2272b46a838c585adb3609ea (patch)
tree09519d157c15fa60918e10f8e2ef442fdc1c2307 /Makefile
parentFix readme (diff)
downloadblakesum-2690fcaea7973b0e2272b46a838c585adb3609ea.tar.gz
blakesum-2690fcaea7973b0e2272b46a838c585adb3609ea.tar.bz2
blakesum-2690fcaea7973b0e2272b46a838c585adb3609ea.tar.xz
Add tests
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 20 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 730da33..be1a6ca 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,8 @@ BIN =\
OBJ =\
$(BIN:=.o)\
- common.o
+ common.o\
+ test.o
HDR =\
arg.h\
@@ -21,7 +22,16 @@ ALIASES =\
b384sum\
b512sum
-all: $(BIN)
+# Known answers tests
+KAT_FILES =\
+ kat/blake2b\
+ kat/blake2bp\
+ kat/blake2s\
+ kat/blake2sp\
+ kat/blake2xb\
+ kat/blake2xs
+
+all: $(BIN) test
$(OBJ): $(HDR)
.c.o:
@@ -33,6 +43,12 @@ bsum: bsum.o common.o
b2sum: b2sum.o common.o
$(CC) -o $@ $@.o common.o $(LDFLAGS)
+test: test.o
+ $(CC) -o $@ $@.o $(LDFLAGS)
+
+check: test $(BIN) $(KAT_FILES)
+ ./test
+
install: $(BIN)
mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1/"
@@ -49,9 +65,9 @@ uninstall:
clean:
-rm -f -- *.o *.su *.gcov *.gcno *.gcda
- -rm -f -- $(BIN)
+ -rm -f -- $(BIN) test
.SUFFIXES:
.SUFFIXES: .o .c
-.PHONY: all install uninstall clean
+.PHONY: all check install uninstall clean