forked from yuichitk/libteep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.client
58 lines (46 loc) · 1.18 KB
/
Makefile.client
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
55
56
57
58
#
# Copyright (c) 2020 SECOM CO., LTD. All Rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause
#
CFLAGS = -Wall -g
LDFLAGS = $(CMD_LD) -lt_cose -lqcbor -lcurl -lm
INC = $(CMD_INC) -I ./inc -I ./examples/inc
TARGET = ./bin/teep_http_client
SRCS = \
examples/teep_http_client_main.c \
examples/teep_examples_common.c \
examples/teep_examples_cose.c \
src/teep_common.c \
src/teep_cose.c \
src/teep_message_print.c \
src/teep_message_decode.c \
src/teep_message_encode.c \
examples/teep_http_client.c
OBJDIR = ./obj
OBJS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(SRCS)))
ifeq ($(MBEDTLS),1)
# use MbedTLS
CFLAGS += -DLIBTEEP_PSA_CRYPTO_C=1
LDFLAGS +=-lmbedcrypto
else
# use OpenSSL
MBEDTLS=0
LDFLAGS += -lcrypto
endif
ifdef debug
CFLAGS += -DALLOW_CBOR_WITHOUT_SIGN1 -DSEND_CBOR_WITHOUT_SIGN1
endif
.PHONY: all debug clean
all: $(TARGET)
include Makefile.common
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
$(OBJDIR)/%.o: %.c | $(OBJDIR) $(OBJDIR)/examples $(OBJDIR)/src
$(CC) $(CFLAGS) $(INC) -o $@ -c $<
run: $(TARGET)
sh -c "./testfiles/tam_server.sh > tam_stdout.txt &"
sleep 1
sh -c "$(TARGET) > agent_stdout.txt"
clean:
$(RM) $(OBJS) $(TARGET)