forked from kentakayama/libcsuit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.sign
54 lines (47 loc) · 1.15 KB
/
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
49
50
51
52
53
54
#
# Copyright (c) 2020-2023 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/suit_manifest_sign
SRCS = \
examples/suit_manifest_sign_main.c \
examples/suit_examples_common.c \
examples/suit_examples_cose.c \
src/suit_common.c \
src/suit_digest.c \
src/suit_cose.c \
src/suit_manifest_encode.c \
src/suit_manifest_decode.c \
src/suit_manifest_print.c
OBJDIR = ./obj
OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(SRCS)))
ifeq ($(MBEDTLS),1)
# use MbedTLS
CFLAGS += -DLIBCSUIT_PSA_CRYPTO_C=1
#LDFLAGS += -lmbedtls -lmbedx509
LDFLAGS += -lmbedcrypto
else
# use OpenSSL
LDFLAGS += -lcrypto
endif
ifeq ($(SIGNER),TAM)
CFLAGS += "-DSUIT_MANIFEST_SIGNER_TAM=1"
TARGET = ./bin/suit_manifest_sign_delegate
else
CFLAGS += "-DSUIT_MANIFEST_SIGNER_TRUST_ANCHOR=1"
endif
$(TARGET): $(OBJS)
mkdir -p ./bin
$(CC) -o $@ $^ $(LDFLAGS)
$(OBJDIR)/%.o: %.c
mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(INC) -o $@ -c $<
.PHONY: all
all: $(TARGET)
.PHONY: clean
clean:
$(RM) $(OBJS) $(TARGET)