aboutsummaryrefslogtreecommitdiff
path: root/sw/Makefile
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2015-04-28 17:59:39 -0400
committerPaul Selkirk <paul@psgd.org>2015-04-28 17:59:39 -0400
commiteba69a11db55cbb6f09c3103f05247ce7b029df2 (patch)
tree6c3f33723b9b2532ec1b7222742b6c49810d6b0a /sw/Makefile
parent07e3a0f3c71134fe9ce4f375cf7a6fd9ad297f45 (diff)
parentd07c710e9a82c46e20bc8262308117edf7a0ca11 (diff)
Merge branch 'unimap' to 'master'.
Diffstat (limited to 'sw/Makefile')
-rwxr-xr-xsw/Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/sw/Makefile b/sw/Makefile
new file mode 100755
index 0000000..0dbd61a
--- /dev/null
+++ b/sw/Makefile
@@ -0,0 +1,44 @@
+CC = gcc
+CFLAGS = -Wall -fPIC
+
+LIB = libcryptech.a
+BIN = hash hash_tester trng_extractor trng_tester
+INC = cryptech.h
+
+PREFIX = /usr/local
+LIB_DIR = $(PREFIX)/lib
+BIN_DIR = $(PREFIX)/bin
+INC_DIR = $(PREFIX)/include
+
+all: $(LIB) $(BIN)
+
+%.o: %.c $(INC)
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+libcryptech.a: tc_eim.o novena-eim.o
+ ar rcs $@ $^
+
+hash_tester: hash_tester.o $(LIB)
+ $(CC) -o $@ $^
+
+trng_tester: trng_tester.o $(LIB)
+ $(CC) -o $@ $^
+
+hash: hash.o $(LIB)
+ $(CC) -o $@ $^
+
+trng_extractor: trng_extractor.o $(LIB)
+ $(CC) -o $@ $^
+
+install: $(LIB) $(BIN) $(INC)
+ install $(LIB) $(LIB_DIR)
+ install $(BIN) $(BIN_DIR)
+ install $(INC) $(INC_DIR)
+
+uninstall:
+ rm -f $(LIB_DIR)/$(LIB)
+ rm -f $(foreach bin,$(BIN),$(BIN_DIR)/$(bin))
+ rm -f $(INC_DIR)/$(INC)
+
+clean:
+ rm -f *.o $(LIB) $(BIN)