forked from igrr/axtls-8266
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (50 loc) · 1.23 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
TOOLCHAIN_PREFIX := xtensa-lx106-elf-
CC := $(TOOLCHAIN_PREFIX)gcc
AR := $(TOOLCHAIN_PREFIX)ar
LD := $(TOOLCHAIN_PREFIX)gcc
OBJCOPY := $(TOOLCHAIN_PREFIX)objcopy
XTENSA_LIBS ?= $(shell $(CC) -print-sysroot)
OBJ_FILES := \
crypto/aes.o \
crypto/bigint.o \
crypto/hmac.o \
crypto/md2.o \
crypto/md5.o \
crypto/rc4.o \
crypto/rsa.o \
crypto/sha1.o \
ssl/asn1.o \
ssl/gen_cert.o \
ssl/loader.o \
ssl/os_port.o \
ssl/p12.o \
ssl/tls1.o \
ssl/tls1_clnt.o \
ssl/tls1_svr.o \
ssl/x509.o \
crypto/crypto_misc.o \
CPPFLAGS += -I$(XTENSA_LIBS)/include \
-Icrypto \
-Issl \
-I.
LDFLAGS += -L$(XTENSA_LIBS)/lib \
-L$(XTENSA_LIBS)/arch/lib \
CFLAGS+=-std=c99 -DESP8266
CFLAGS += -Wall -Os -g -O2 -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals -D__ets__ -DICACHE_FLASH
BIN_DIR := bin
AXTLS_AR := $(BIN_DIR)/libaxtls.a
all: $(AXTLS_AR)
$(AXTLS_AR): | $(BIN_DIR)
$(AXTLS_AR): $(OBJ_FILES)
for file in $(OBJ_FILES); do \
$(OBJCOPY) \
--rename-section .text=.irom0.text \
--rename-section .literal=.irom0.literal \
$$file; \
done
$(AR) cru $@ $^
$(BIN_DIR):
mkdir -p $(BIN_DIR)
clean:
rm -rf $(OBJ_FILES) $(AXTLS_AR)
.PHONY: all clean