-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathMakefile
48 lines (34 loc) · 909 Bytes
/
Makefile
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
#CROSS = arm-linux-gnueabihf-
MAKE = make
CC = $(CROSS)gcc
LD = $(CROSS)ld
STRIP = $(CROSS)strip
ROOT_DIR = $(CURDIR)
MBEDTLS = $(ROOT_DIR)/mbedtls
CFLAGS = -fPIC -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -O2
LDFLAGS =
INCLUDES = -I$(MBEDTLS)/include
LIBS = $(MBEDTLS)/library/libmbedx509.a $(MBEDTLS)/library/libmbedtls.a $(MBEDTLS)/library/libmbedcrypto.a
SOURCES = main.c https.c
OBJS = $(SOURCES:.c=.o)
.SUFFIXES:.c .o
all: https_client
mbedtls_make:
@for dir in $(MBEDTLS); do \
$(MAKE) -C $$dir ; \
if [ $$? != 0 ]; then exit 1; fi; \
done
https_client: mbedtls_make $(OBJS)
@echo Linking: $@ ....
$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
# $(STRIP) -s $@
.c.o:
@echo Compiling: $< ....
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
clean:
rm -f https_client *.o
mbedtls_clean:
@for dir in $(MBEDTLS); do \
$(MAKE) -C $$dir clean; \
if [ $$? != 0 ]; then exit 1; fi; \
done