From 44eaa09dc1082c1e35bfb7cc8f8c694ec0df1991 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 5 Nov 2014 00:25:41 +0100 Subject: beginning of test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 19f4feb..52280af 100644 --- a/Makefile +++ b/Makefile @@ -102,11 +102,13 @@ FLAGS = -std=gnu99 $(WARN) -OBJ = digest files generalised-spec hex state +LIB_OBJ = digest files generalised-spec hex state +TEST_OBJ = test .PHONY: all -all: lib +all: lib test + .PHONY: lib lib: bin/libkeccak.so.$(LIB_VERSION) bin/libkeccak.so.$(LIB_MAJOR) bin/libkeccak.so @@ -115,7 +117,7 @@ obj/libkeccak/%.o: src/libkeccak/%.c src/libkeccak.h src/libkeccak/*.h @mkdir -p obj/libkeccak $(CC) $(FLAGS) $(CFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $< -bin/libkeccak.so.$(LIB_VERSION): $(foreach O,$(OBJ),obj/libkeccak/$(O).o) +bin/libkeccak.so.$(LIB_VERSION): $(foreach O,$(LIB_OBJ),obj/libkeccak/$(O).o) @mkdir -p bin $(CC) $(FLAGS) $(LDFLAGS) -shared -Wl,-soname,libkeccak.so.$(LIB_MAJOR) -o $@ $^ @@ -128,6 +130,17 @@ bin/libkeccak.so: ln -sf libkeccak.so.$(LIB_VERSION) $@ +.PHONY: test +test: bin/test + +bin/test: lib $(foreach O,$(TEST_OBJ),obj/test/$(O).o) + $(CC) $(FLAGS) $(LDFLAGS) -Lbin -lkeccak -o $@ $(foreach O,$(TEST_OBJ),obj/test/$(O).o) + +obj/test/%.o: src/test/%.c src/libkeccak/*.h src/libkeccak.h + @mkdir -p obj/test + $(CC) $(FLAGS) $(CFLAGS) $(CPPFLAGS) -Isrc -c -o $@ $< + + .PHONY: clean clean: -- cgit v1.2.3-70-g09d2