Skip to content

Commit 3661c54

Browse files
committed
Add makefile
1 parent 4e0ccaf commit 3661c54

16 files changed

+77
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.o
2+
bin/
3+
Makefile.local
4+
.DS_Store
5+

Makefile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
include Makefile.local
2+
3+
TOOLCHAIN_PREFIX := xtensa-lx106-elf-
4+
CC := $(TOOLCHAIN_PREFIX)gcc
5+
AR := $(TOOLCHAIN_PREFIX)ar
6+
LD := $(TOOLCHAIN_PREFIX)gcc
7+
OBJCOPY := $(TOOLCHAIN_PREFIX)objcopy
8+
9+
10+
XTENSA_LIBS ?= $(shell $(CC) -print-sysroot)
11+
12+
13+
OBJ_FILES := \
14+
crypto/aes.o \
15+
crypto/bigint.o \
16+
crypto/hmac.o \
17+
crypto/md2.o \
18+
crypto/md5.o \
19+
crypto/rc4.o \
20+
crypto/rsa.o \
21+
crypto/sha1.o \
22+
ssl/asn1.o \
23+
ssl/gen_cert.o \
24+
ssl/loader.o \
25+
ssl/os_port.o \
26+
ssl/p12.o \
27+
ssl/tls1.o \
28+
ssl/tls1_clnt.o \
29+
ssl/tls1_svr.o \
30+
ssl/x509.o \
31+
crypto/crypto_misc.o \
32+
33+
34+
CPPFLAGS += -I$(XTENSA_LIBS)/include \
35+
-I$(SDK_BASE)/include \
36+
-Icrypto \
37+
-Issl
38+
39+
LDFLAGS += -L$(XTENSA_LIBS)/lib \
40+
-L$(XTENSA_LIBS)/arch/lib \
41+
-L$(SDK_BASE)/lib
42+
43+
CFLAGS+=-std=c99 -DESP8266
44+
45+
CFLAGS += -Os -g -O2 -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals -D__ets__ -DICACHE_FLASH
46+
BIN_DIR := bin
47+
AXTLS_AR := $(BIN_DIR)/libaxtls.a
48+
49+
all: $(AXTLS_AR)
50+
51+
$(AXTLS_AR): | $(BIN_DIR)
52+
53+
$(AXTLS_AR): $(OBJ_FILES)
54+
for file in $(OBJ_FILES); do \
55+
$(OBJCOPY) \
56+
--rename-section .text=.irom0.text \
57+
--rename-section .literal=.irom0.literal \
58+
$$file; \
59+
done
60+
$(AR) cru $@ $^
61+
62+
$(BIN_DIR):
63+
mkdir -p $(BIN_DIR)
64+
65+
clean:
66+
rm -rf $(OBJ_FILES) $(LWIP_AR)
67+
68+
69+
.PHONY: all clean

Makefile.local.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Set this to SDK path and save as Makefile.local
2+
SDK_BASE := $(HOME)/esp8266/sdk
3+

crypto/aes.o

-34.5 KB
Binary file not shown.

crypto/bigint.o

-92.5 KB
Binary file not shown.

crypto/hmac.o

-10.2 KB
Binary file not shown.

crypto/md2.o

-9.58 KB
Binary file not shown.

crypto/md5.o

-18.9 KB
Binary file not shown.

crypto/rc4.o

-6.09 KB
Binary file not shown.

crypto/rsa.o

-25 KB
Binary file not shown.

crypto/sha1.o

-13.4 KB
Binary file not shown.

ssl/asn1.o

-47 KB
Binary file not shown.

ssl/gen_cert.o

-828 Bytes
Binary file not shown.

ssl/loader.o

-37.4 KB
Binary file not shown.

ssl/os_port.o

-13.1 KB
Binary file not shown.

ssl/p12.o

-1.77 KB
Binary file not shown.

0 commit comments

Comments
 (0)