summaryrefslogtreecommitdiffstats
path: root/tpm-util/duplicate/sampleMakefile
blob: f54ee2b0690e123d28b987fc92a28e98b16c3182 (plain)
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
CC = gcc
#CC = g++
LD = ld
AR = ar
LDDFLAGS += -fPIC
ARFLAGS = -rc

TSS_DIR?=/tpm2-tss2
OPENSSL_DIR?=/usr/local/ssl

OUTPUT=ossl_tpm_duplicate

OBJS=	util.o \
        marshal.o \
        crypto_aux.o \
        tpm_duplication_aux.o \
        main.o


CFLAGS += -g -fPIC -I./include -I${TSS_DIR}/include -I$(TSS_DIR)/sysapi/include -I${OPENSSL_DIR}/include

LDFLAGS += -ldl -L/usr/local/lib -L${OPENSSL_DIR}/lib -ltss2-tcti-tabrmd -ltss2-mu

LIBS = -lpthread -lcrypto -lssl

%.o : %.c
	$(CC) -c $(CFLAGS) $< -o $@


$(OUTPUT): $(OBJS)
	$(CC) $(OBJS) $(LDFLAGS) ${LIBS} -o $(OUTPUT)

.PHONY: all
all: $(OUTPUT)

install:
	@set -e; for i in $(OUTPUT); do mv $$i ../../bin/$$i ; done

clean:
	rm -f *.o $(OUTPUT) *.so