# # Top-level Makefile for building various versions of MatrixSSL. # # Copyright (c) 2016 Rambus Inc. All Rights Reserved. # # @version $Format:%h%d$ # A list of the most important build targets provided by this Makefile: # Make command Description # make all Default target: Build all software using current # MatrixSSL configuration # make libs Build MatrixSSL libraries using current # MatrixSSL configuration # make tests Build MatrixSSL test programs using current # MatrixSSL configuration # make apps Build MatrixSSL example programs using current # MatrixSSL configuration # make check-config Apply default configuration if not present. # make *-config (Specify *) select one of prepackaged configurations # from configs directory. # # Additional targets for MatrixSSL Open Source and Commercial Editions # # make all-tls Build MatrixSSL using options suitable for most # TLS use cases and the MatrixSSL stock crypto. # make all-noecc Build MatrixSSL using options that disable ECC, # using the MatrixSSL stock crypto. # make all-rsaonly Build MatrixSSL using options that disable ECC and DH, # using the MatrixSSL stock crypto. # make all-psk Build MatrixSSL with support for only a single PSK # ciphersuite using MatrixSSL stock crypto. # This is the smallest possible configuration, # except that both server- and client-side TLS are enabled # for easier testing. # # Additional targets for MatrixSSL FIPS Edition # # make all-fips Compile MatrixSSL FIPS Edition with default # configuration. # make all-cl-nonfips Compile MatrixSSL FIPS Edition using CL library in # non-FIPS Mode of operation. # make all-combined Compile MatrixSSL FIPS Edition allowing run-time # selection of FIPS or non-FIPS mode. # make all-openssl-compat A configuration specially tailored for use # with the OpenSSL compatibility layer. # make all-combined-default-nonfips The same than make all combined, but # non-FIPS mode is the default. # # default: all util: all-utils CONFIG_EXTRA_DEPENDENCIES= CORE_CONFIG_DIR=core/config CORE_CONFIG_FILE=$(CORE_CONFIG_DIR)/coreConfig.h # ! -e $(CORE_CONFIG_FILE) ] || ! cmp -s $(1)/coreConfig.h $(CORE_CONFIG_FILE) define apply_core_config @if [ ! -e $(CORE_CONFIG_FILE) ] || ! cmp -s $(1)/coreConfig.h $(CORE_CONFIG_FILE); then cp $(1)/coreConfig.h $(CORE_CONFIG_FILE); echo cp $(1)/coreConfig.h $(CORE_CONFIG_FILE); echo WARNING: Applied new configuration also to core. You may need to recompile the core.;fi endef # ! -e $(CORE_CONFIG_FILE) ] || ! cmp -s $(1)/coreConfig.h $(CORE_CONFIG_FILE) define apply_core_config_non_exist @if [ ! -e $(CORE_CONFIG_FILE) ]; then cp $(1)/coreConfig.h $(CORE_CONFIG_FILE); echo cp $(1)/coreConfig.h $(CORE_CONFIG_FILE); echo WARNING: Applied new configuration also to core. You may need to recompile the core.;fi endef # Use default config if no config is being used. check-config: $(CONFIG_EXTRA_DEPENDENCIES) @if [ ! -e crypto/cryptoConfig.h ];then \ cp configs/default/cryptoConfig.h crypto/cryptoConfig.h;\ echo NOTE: Using default configuration from configs/default/cryptoConfig.h.;\ fi @if [ ! -e matrixssl/matrixsslConfig.h ];then \ cp configs/default/matrixsslConfig.h matrixssl/matrixsslConfig.h;\ echo NOTE: Using default configuration from configs/default/matrixsslConfig.h.;\ fi $(call apply_core_config_non_exist,configs/default) clean-config: rm -f core/coreConfig.h crypto/cryptoConfig.h matrixssl/matrixsslConfig.h # Apply any of pre-existing configurations from configs directory %-config: configs/% $(CONFIG_EXTRA_DEPENDENCIES) @echo Using $