forked from yuichitk/libteep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.sign
49 lines (39 loc) · 988 Bytes
/
Makefile.sign
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
45
46
47
48
#
# Copyright (c) 2020 SECOM CO., LTD. All Rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause
#
CFLAGS = -Wall -g
LDFLAGS = $(CMD_LD) -lt_cose -lqcbor -lm
INC = $(CMD_INC) -I ./inc -I ./examples/inc
TARGET = ./bin/teep_sign_test
SRCS = \
examples/teep_sign_test_main.c \
examples/teep_examples_common.c \
src/teep_common.c src/teep_message_encode.c \
src/teep_message_decode.c \
src/teep_message_print.c \
src/teep_cose.c
OBJDIR = ./obj
OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(SRCS)))
ifeq ($(MBEDTLS),1)
# use MbedTLS
CFLAGS += -DLIBTEEP_PSA_CRYPTO_C=1
#LDFLAGS += -lmbedtls -lmbedx509
LDFLAGS += -lmbedcrypto
else
# use OpenSSL
MBEDTLS=0
LDFLAGS += -lcrypto
endif
.PHONY: all clean run
all: $(TARGET)
$(OBJDIR)/%.o: %.c
mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(INC) -o $@ -c $<
$(TARGET): $(OBJS)
$(CC) -o $@ $(CFLAGS) $(INC) $^ $(LDFLAGS)
clean:
$(RM) -f $(OBJS) $(TAM_OBJ) $(AGENT_OBJ) $(TAM) $(AGENT)
run: $(TARGET)
$<