forked from Mbed-TLS/mbedtls
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Mbed-TLS#8 from ARMmbed/msp430-build
Msp430 build and test scripts
- Loading branch information
Showing
30 changed files
with
3,026 additions
and
1,902 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,169 +1,113 @@ | ||
IAR_PATH ?= C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.4 | ||
|
||
# Also see "include/mbedtls/config.h" | ||
ifeq ($(DESKTOP),1) | ||
|
||
CFLAGS ?= -O2 | ||
WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement | ||
LDFLAGS ?= | ||
CC = gcc | ||
AR = ar | ||
|
||
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64 | ||
LOCAL_LDFLAGS = | ||
CFLAGS = -O2 | ||
WARNING_CFLAGS = -Wall -W -Wdeclaration-after-statement | ||
LOCAL_CFLAGS += -DMBEDTLS_PLATFORM_C | ||
ARFLAGS = -rcs | ||
|
||
ifdef DEBUG | ||
LOCAL_CFLAGS += -g3 | ||
endif | ||
|
||
# MicroBlaze specific options: | ||
# CFLAGS += -mno-xl-soft-mul -mxl-barrel-shift | ||
OBJEXT=.o | ||
STATEXT=.a | ||
|
||
# To compile on Plan9: | ||
# CFLAGS += -D_BSD_EXTENSION | ||
else | ||
|
||
# if were running on Windows build for Windows | ||
ifdef WINDOWS | ||
WINDOWS_BUILD=1 | ||
endif | ||
CC = icc430 | ||
AR = xar | ||
|
||
# To compile as a shared library: | ||
ifdef SHARED | ||
# all code is position-indep with mingw, avoid warning about useless flag | ||
ifndef WINDOWS_BUILD | ||
LOCAL_CFLAGS += -fPIC -fpic | ||
endif | ||
endif | ||
CFLAGS = --no_cse --no_unroll --no_inline --no_code_motion --no_tbaa --debug -D__MSP430F5359__ -e --double=32 --dlib_config "$(IAR_PATH)/430/lib/dlib/dl430xlsfn.h" --library_module --core=430X --data_model=small -On --multiplier=32 --hw_workaround=CPU40 --code_model=large | ||
WARNING_CFLAGS = | ||
ARFLAGS = | ||
|
||
SOEXT_TLS=so.10 | ||
SOEXT_X509=so.0 | ||
SOEXT_CRYPTO=so.0 | ||
ifdef DEBUG | ||
LOCAL_CFLAGS += --debug | ||
endif | ||
|
||
DLEXT=so | ||
# OSX shared library extension: | ||
# DLEXT=dylib | ||
OBJEXT=.r43 | ||
STATEXT=.r43 | ||
|
||
# Windows shared library extension: | ||
ifdef WINDOWS_BUILD | ||
DLEXT=dll | ||
endif | ||
|
||
OBJS_CRYPTO= aes.o aesni.o arc4.o \ | ||
asn1parse.o asn1write.o base64.o \ | ||
bignum.o blowfish.o camellia.o \ | ||
ccm.o cipher.o cipher_wrap.o \ | ||
cmac.o ctr_drbg.o des.o \ | ||
dhm.o ecdh.o ecdsa.o \ | ||
ecjpake.o ecp.o \ | ||
ecp_curves.o entropy.o entropy_poll.o \ | ||
error.o gcm.o havege.o \ | ||
hmac_drbg.o md.o md2.o \ | ||
md4.o md5.o md_wrap.o \ | ||
memory_buffer_alloc.o oid.o \ | ||
padlock.o pem.o pk.o \ | ||
pk_wrap.o pkcs12.o pkcs5.o \ | ||
pkparse.o pkwrite.o platform.o \ | ||
ripemd160.o rsa.o sha1.o \ | ||
sha256.o sha512.o threading.o \ | ||
timing.o version.o \ | ||
version_features.o xtea.o | ||
|
||
OBJS_X509= certs.o pkcs11.o x509.o \ | ||
x509_create.o x509_crl.o x509_crt.o \ | ||
x509_csr.o x509write_crt.o x509write_csr.o | ||
|
||
OBJS_TLS= debug.o net_sockets.o \ | ||
ssl_cache.o ssl_ciphersuites.o \ | ||
ssl_cli.o ssl_cookie.o \ | ||
ssl_srv.o ssl_ticket.o \ | ||
ssl_tls.o | ||
|
||
.SILENT: | ||
|
||
.PHONY: all static shared clean | ||
|
||
ifndef SHARED | ||
all: static | ||
else | ||
all: shared static | ||
endif | ||
LOCAL_CFLAGS += $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64 | ||
LOCAL_LDFLAGS = | ||
|
||
OBJS_CRYPTO= aes$(OBJEXT) aesni$(OBJEXT) arc4$(OBJEXT) \ | ||
asn1parse$(OBJEXT) asn1write$(OBJEXT) base64$(OBJEXT) \ | ||
bignum$(OBJEXT) blowfish$(OBJEXT) camellia$(OBJEXT) \ | ||
ccm$(OBJEXT) cipher$(OBJEXT) cipher_wrap$(OBJEXT) \ | ||
cmac$(OBJEXT) ctr_drbg$(OBJEXT) des$(OBJEXT) \ | ||
dhm$(OBJEXT) ecdh$(OBJEXT) ecdsa$(OBJEXT) \ | ||
ecjpake$(OBJEXT) ecp$(OBJEXT) \ | ||
ecp_curves$(OBJEXT) entropy$(OBJEXT) entropy_poll$(OBJEXT) \ | ||
error$(OBJEXT) gcm$(OBJEXT) havege$(OBJEXT) \ | ||
hmac_drbg$(OBJEXT) md$(OBJEXT) md2$(OBJEXT) \ | ||
md4$(OBJEXT) md5$(OBJEXT) md_wrap$(OBJEXT) \ | ||
memory_buffer_alloc$(OBJEXT) oid$(OBJEXT) \ | ||
padlock$(OBJEXT) pem$(OBJEXT) pk$(OBJEXT) \ | ||
pk_wrap$(OBJEXT) pkcs12$(OBJEXT) pkcs5$(OBJEXT) \ | ||
pkparse$(OBJEXT) pkwrite$(OBJEXT) platform$(OBJEXT) \ | ||
ripemd160$(OBJEXT) rsa$(OBJEXT) sha1$(OBJEXT) \ | ||
sha256$(OBJEXT) sha512$(OBJEXT) threading$(OBJEXT) \ | ||
timing$(OBJEXT) version$(OBJEXT) \ | ||
version_features$(OBJEXT) xtea$(OBJEXT) | ||
|
||
OBJS_X509= certs$(OBJEXT) pkcs11$(OBJEXT) x509$(OBJEXT) \ | ||
x509_create$(OBJEXT) x509_crl$(OBJEXT) x509_crt$(OBJEXT) \ | ||
x509_csr$(OBJEXT) x509write_crt$(OBJEXT) x509write_csr$(OBJEXT) | ||
|
||
OBJS_TLS= debug$(OBJEXT) net_sockets$(OBJEXT) \ | ||
ssl_cache$(OBJEXT) ssl_ciphersuites$(OBJEXT) \ | ||
ssl_cli$(OBJEXT) ssl_cookie$(OBJEXT) \ | ||
ssl_srv$(OBJEXT) ssl_ticket$(OBJEXT) \ | ||
ssl_tls$(OBJEXT) | ||
|
||
.PHONY: all static clean | ||
|
||
static: libmbedcrypto.a libmbedx509.a libmbedtls.a | ||
all: static | ||
|
||
shared: libmbedcrypto.$(DLEXT) libmbedx509.$(DLEXT) libmbedtls.$(DLEXT) | ||
static: libmbedcrypto$(STATEXT) libmbedx509$(STATEXT) libmbedtls$(STATEXT) | ||
|
||
# tls | ||
libmbedtls.a: $(OBJS_TLS) | ||
echo " AR $@" | ||
$(AR) -rc $@ $(OBJS_TLS) | ||
echo " RL $@" | ||
$(AR) -s $@ | ||
@echo " AR $@" | ||
$(AR) $(ARFLAGS) $@ $(OBJS_TLS) | ||
|
||
libmbedtls.$(SOEXT_TLS): $(OBJS_TLS) libmbedx509.so | ||
echo " LD $@" | ||
$(CC) -shared -Wl,-soname,$@ -L. -lmbedcrypto -lmbedx509 $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_TLS) | ||
|
||
libmbedtls.so: libmbedtls.$(SOEXT_TLS) | ||
echo " LN $@ -> $<" | ||
ln -sf $< $@ | ||
|
||
libmbedtls.dylib: $(OBJS_TLS) | ||
echo " LD $@" | ||
$(CC) -dynamiclib $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_TLS) | ||
|
||
libmbedtls.dll: $(OBJS_TLS) libmbedx509.dll | ||
echo " LD $@" | ||
$(CC) -shared -Wl,-soname,$@ -Wl,--out-implib,$@.a -o $@ $(OBJS_TLS) -lws2_32 -lwinmm -lgdi32 -L. -lmbedcrypto -lmbedx509 -static-libgcc $(LOCAL_LDFLAGS) $(LDFLAGS) | ||
libmbedtls.r43: $(OBJS_TLS) | ||
@echo " AR43 $@" | ||
$(AR) $(ARFLAGS) -o $@ $(OBJS_TLS) | ||
|
||
# x509 | ||
libmbedx509.a: $(OBJS_X509) | ||
echo " AR $@" | ||
$(AR) -rc $@ $(OBJS_X509) | ||
echo " RL $@" | ||
$(AR) -s $@ | ||
|
||
libmbedx509.$(SOEXT_X509): $(OBJS_X509) libmbedcrypto.so | ||
echo " LD $@" | ||
$(CC) -shared -Wl,-soname,$@ -L. -lmbedcrypto $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_X509) | ||
|
||
libmbedx509.so: libmbedx509.$(SOEXT_X509) | ||
echo " LN $@ -> $<" | ||
ln -sf $< $@ | ||
|
||
libmbedx509.dylib: $(OBJS_X509) | ||
echo " LD $@" | ||
$(CC) -dynamiclib $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_X509) | ||
@echo " AR $@" | ||
$(AR) $(ARFLAGS) $@ $(OBJS_X509) | ||
|
||
libmbedx509.dll: $(OBJS_X509) libmbedcrypto.dll | ||
echo " LD $@" | ||
$(CC) -shared -Wl,-soname,$@ -Wl,--out-implib,$@.a -o $@ $(OBJS_X509) -lws2_32 -lwinmm -lgdi32 -L. -lmbedcrypto -static-libgcc $(LOCAL_LDFLAGS) $(LDFLAGS) | ||
libmbedx509.r43: $(OBJS_X509) | ||
@echo " AR43 $@" | ||
$(AR) $(ARFLAGS) -o $@ $(OBJS_X509) | ||
|
||
# crypto | ||
libmbedcrypto.a: $(OBJS_CRYPTO) | ||
echo " AR $@" | ||
$(AR) -rc $@ $(OBJS_CRYPTO) | ||
echo " RL $@" | ||
$(AR) -s $@ | ||
@echo " AR $@" | ||
$(AR) $(ARFLAGS) $@ $(OBJS_CRYPTO) | ||
|
||
libmbedcrypto.$(SOEXT_CRYPTO): $(OBJS_CRYPTO) | ||
echo " LD $@" | ||
$(CC) -shared -Wl,-soname,$@ $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_CRYPTO) | ||
|
||
libmbedcrypto.so: libmbedcrypto.$(SOEXT_CRYPTO) | ||
echo " LN $@ -> $<" | ||
ln -sf $< $@ | ||
|
||
libmbedcrypto.dylib: $(OBJS_CRYPTO) | ||
echo " LD $@" | ||
$(CC) -dynamiclib $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_CRYPTO) | ||
|
||
libmbedcrypto.dll: $(OBJS_CRYPTO) | ||
echo " LD $@" | ||
$(CC) -shared -Wl,-soname,$@ -Wl,--out-implib,$@.a -o $@ $(OBJS_CRYPTO) -lws2_32 -lwinmm -lgdi32 -static-libgcc $(LOCAL_LDFLAGS) $(LDFLAGS) | ||
libmbedcrypto.r43: $(OBJS_CRYPTO) | ||
@echo " AR43 $@" | ||
$(AR) $(ARFLAGS) -o $@ $(OBJS_CRYPTO) | ||
|
||
.c.o: | ||
echo " CC $<" | ||
@echo " CC $<" | ||
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< | ||
|
||
%.r43: %.c | ||
@echo " CC43 $<" | ||
$(CC) $< -o $@ $(LOCAL_CFLAGS) $(CFLAGS) | ||
|
||
clean: | ||
ifndef WINDOWS | ||
rm -f *.o libmbed* | ||
else | ||
del /Q /F *.o libmbed* | ||
endif | ||
rm -f *.r43 *.d43 *.o libmbed* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.