aboutsummaryrefslogblamecommitdiff
path: root/sw/Makefile
blob: d1f33f281cd73c2fb46e60daadce96f2449dcd4e (plain) (tree)
1
2
3
4
5
        
                    

                   
                                                                          











                                   
                                                 







                                 


                               


                                     

















                                                     
CC = gcc
CFLAGS = -Wall -fPIC

LIB = libcryptech.a
BIN = hash hash_tester trng_extractor trng_tester aes_tester modexp_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 capability.o
	ar rcs $@ $^

hash_tester: hash_tester.o $(LIB)
	$(CC) -o $@ $^

trng_tester: trng_tester.o $(LIB)
	$(CC) -o $@ $^

aes_tester: aes_tester.o $(LIB)
	$(CC) -o $@ $^

modexp_tester: modexp_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)