2021-06-16 02:52:02 +00:00
|
|
|
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
|
|
|
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
|
|
|
|
|
|
|
PKGS += THIRD_PARTY_MBEDTLS
|
|
|
|
|
|
|
|
THIRD_PARTY_MBEDTLS_ARTIFACTS += THIRD_PARTY_MBEDTLS_A
|
|
|
|
THIRD_PARTY_MBEDTLS = $(THIRD_PARTY_MBEDTLS_A_DEPS) $(THIRD_PARTY_MBEDTLS_A)
|
|
|
|
THIRD_PARTY_MBEDTLS_A = o/$(MODE)/third_party/mbedtls/mbedtls.a
|
2021-06-16 03:18:59 +00:00
|
|
|
THIRD_PARTY_MBEDTLS_A_FILES := $(wildcard third_party/mbedtls/*)
|
2021-06-16 02:52:02 +00:00
|
|
|
THIRD_PARTY_MBEDTLS_A_HDRS = $(filter %.h,$(THIRD_PARTY_MBEDTLS_A_FILES))
|
|
|
|
THIRD_PARTY_MBEDTLS_A_SRCS = $(filter %.c,$(THIRD_PARTY_MBEDTLS_A_FILES))
|
2021-07-08 04:44:27 +00:00
|
|
|
THIRD_PARTY_MBEDTLS_A_OBJS = $(THIRD_PARTY_MBEDTLS_A_SRCS:%.c=o/$(MODE)/%.o)
|
2021-06-16 02:52:02 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_MBEDTLS_A_CHECKS = \
|
|
|
|
$(THIRD_PARTY_MBEDTLS_A).pkg \
|
|
|
|
$(THIRD_PARTY_MBEDTLS_A_HDRS:%=o/$(MODE)/%.ok)
|
|
|
|
|
|
|
|
THIRD_PARTY_MBEDTLS_A_DIRECTDEPS = \
|
2021-07-19 21:55:20 +00:00
|
|
|
LIBC_BITS \
|
2021-06-16 02:52:02 +00:00
|
|
|
LIBC_CALLS \
|
2021-07-19 21:55:20 +00:00
|
|
|
LIBC_DNS \
|
2021-06-16 02:52:02 +00:00
|
|
|
LIBC_FMT \
|
|
|
|
LIBC_INTRIN \
|
|
|
|
LIBC_MEM \
|
|
|
|
LIBC_NEXGEN32E \
|
|
|
|
LIBC_RAND \
|
|
|
|
LIBC_RUNTIME \
|
2021-07-19 21:55:20 +00:00
|
|
|
LIBC_SOCK \
|
2021-06-24 19:31:26 +00:00
|
|
|
LIBC_LOG \
|
2021-06-16 02:52:02 +00:00
|
|
|
LIBC_STDIO \
|
|
|
|
LIBC_STR \
|
|
|
|
LIBC_SYSV \
|
|
|
|
LIBC_TIME \
|
|
|
|
LIBC_UNICODE \
|
2021-07-08 04:44:27 +00:00
|
|
|
NET_HTTP \
|
2021-06-16 02:52:02 +00:00
|
|
|
THIRD_PARTY_COMPILER_RT \
|
|
|
|
THIRD_PARTY_GDTOA
|
|
|
|
|
|
|
|
THIRD_PARTY_MBEDTLS_A_DEPS := \
|
|
|
|
$(call uniq,$(foreach x,$(THIRD_PARTY_MBEDTLS_A_DIRECTDEPS),$($(x))))
|
|
|
|
|
|
|
|
$(THIRD_PARTY_MBEDTLS_A): \
|
|
|
|
third_party/mbedtls/ \
|
|
|
|
$(THIRD_PARTY_MBEDTLS_A).pkg \
|
|
|
|
$(THIRD_PARTY_MBEDTLS_A_OBJS)
|
|
|
|
|
|
|
|
$(THIRD_PARTY_MBEDTLS_A).pkg: \
|
|
|
|
$(THIRD_PARTY_MBEDTLS_A_OBJS) \
|
|
|
|
$(foreach x,$(THIRD_PARTY_MBEDTLS_A_DIRECTDEPS),$($(x)_A).pkg)
|
|
|
|
|
|
|
|
$(THIRD_PARTY_MBEDTLS_A_OBJS): \
|
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-fdata-sections \
|
|
|
|
-ffunction-sections
|
|
|
|
|
2021-07-12 06:17:47 +00:00
|
|
|
o/$(MODE)/third_party/mbedtls/everest.o: \
|
|
|
|
OVERRIDE_CFLAGS += \
|
2021-07-26 22:16:43 +00:00
|
|
|
-O3
|
2021-07-12 06:17:47 +00:00
|
|
|
|
2021-07-19 21:55:20 +00:00
|
|
|
o/$(MODE)/third_party/mbedtls/bigmul4.o \
|
|
|
|
o/$(MODE)/third_party/mbedtls/bigmul6.o: \
|
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-O2
|
|
|
|
|
|
|
|
o/$(MODE)/third_party/mbedtls/shiftright-avx.o: \
|
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-O3 -mavx
|
|
|
|
|
|
|
|
o/$(MODE)/third_party/mbedtls/shiftright2-avx.o: \
|
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-O3 -mavx
|
|
|
|
|
2021-06-16 02:52:02 +00:00
|
|
|
THIRD_PARTY_MBEDTLS_LIBS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)))
|
|
|
|
THIRD_PARTY_MBEDTLS_SRCS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)_SRCS))
|
|
|
|
THIRD_PARTY_MBEDTLS_HDRS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)_HDRS))
|
|
|
|
THIRD_PARTY_MBEDTLS_CHECKS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)_CHECKS))
|
|
|
|
THIRD_PARTY_MBEDTLS_OBJS = $(foreach x,$(THIRD_PARTY_MBEDTLS_ARTIFACTS),$($(x)_OBJS))
|
|
|
|
$(THIRD_PARTY_MBEDTLS_A_OBJS): third_party/mbedtls/mbedtls.mk
|
|
|
|
|
|
|
|
.PHONY: o/$(MODE)/third_party/mbedtls
|
|
|
|
o/$(MODE)/third_party/mbedtls: \
|
2021-06-24 19:31:26 +00:00
|
|
|
o/$(MODE)/third_party/mbedtls/test \
|
|
|
|
$(THIRD_PARTY_MBEDTLS_CHECKS)
|