forked from yuichitk/libcsuit
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.min_process
47 lines (38 loc) · 1.12 KB
/
Makefile.min_process
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
#
# Copyright (c) 2020-2023 SECOM CO., LTD. All Rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause
#
CFLAGS ?= -Os
WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I /usr/local/include -I ./examples/inc
LDFLAGS ?=
LOCAL_LDFLAGS = -L /usr/local/lib -lcsuit -lt_cose -lqcbor -lm
LDWRAP = \
-Xlinker --wrap=suit_fetch_callback \
-Xlinker --wrap=suit_store_callback \
-Xlinker --wrap=suit_invoke_callback \
-Xlinker --wrap=suit_condition_callback \
-Xlinker --wrap=suit_wait_callback
TARGET = ./bin/suit_manifest_process
SRCS = \
examples/suit_manifest_process_main_min.c
OBJS = $(addprefix ./obj/,$(patsubst %.c,%.o,$(SRCS)))
ifeq ($(MBEDTLS),1)
# use MbedTLS
LOCAL_CFLAGS += -DLIBCSUIT_PSA_CRYPTO_C=1
LOCAL_LDFLAGS += -lmbedcrypto
else
# use OpenSSL
LOCAL_LDFLAGS += -lcrypto
endif
.PHONY: all
all: $(TARGET)
include Makefile.common
$(TARGET): $(OBJS) | ./bin
$(CC) $(LDWRAP) -o $@ $^ $(LOCAL_LDFLAGS) $(LDFLAGS)
./obj/%.o: %.c | ./obj/src ./obj/examples
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) $(CMD_LINE) -o $@ -c $<
.PHONY: clean
clean:
$(RM) $(OBJS) $(TARGET)