blob: 98cd5416c7033ff599008e8eafc31c2f2b92cf21 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
CC = gcc
CFLAGS = -Wall -fPIC
LIB = libcryptech_i2c.a
BIN = hash_i2c hash_tester_i2c trng_extractor_i2c trng_tester_i2c
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_i2c.a: tc_i2c.o
ar rcs $@ $^
hash_tester_i2c: hash_tester.o $(LIB)
$(CC) -o $@ $^
trng_tester_i2c: trng_tester.o $(LIB)
$(CC) -o $@ $^
hash_i2c: hash.o $(LIB)
$(CC) -o $@ $^
trng_extractor_i2c: 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)
|