From 3211817f5902611feac85a824cea6d0053cdec21 Mon Sep 17 00:00:00 2001 From: Vikram Adiga Date: Wed, 4 Nov 2015 17:49:26 -0800 Subject: [PATCH] fix TI-RTOS makefiles to build wolfSSL from local dir Signed-off-by: Vikram Adiga --- tirtos/include.am | 1 + tirtos/products.mak | 30 ++++++++++++++++++++++++++++++ tirtos/wolfssl.bld | 14 +++++++------- tirtos/wolfssl.mak | 32 +++++++++++--------------------- 4 files changed, 49 insertions(+), 28 deletions(-) create mode 100644 tirtos/products.mak diff --git a/tirtos/include.am b/tirtos/include.am index 0e2f7a902..7299c438e 100644 --- a/tirtos/include.am +++ b/tirtos/include.am @@ -6,6 +6,7 @@ EXTRA_DIST += \ tirtos/README \ tirtos/wolfssl.bld \ tirtos/wolfssl.mak \ + tirtos/products.mak \ tirtos/packages/ti/net/wolfssl/package.bld \ tirtos/packages/ti/net/wolfssl/package.xdc \ tirtos/packages/ti/net/wolfssl/package.xs \ diff --git a/tirtos/products.mak b/tirtos/products.mak new file mode 100644 index 000000000..8bf1823db --- /dev/null +++ b/tirtos/products.mak @@ -0,0 +1,30 @@ +# +# ======== products.mak ======== +# +# +# Read the http://processors.wiki.ti.com/index.php/Using_wolfSSL_with_TI-RTOS +# for instructions to download the software required. + +# XDC_INSTALL_DIR is the path to XDCtools directory. +XDC_INSTALL_DIR = + +# BIOS_INSTALL_DIR is the path to TI-RTOS Kernel (SYS/BIOS) directory. If you +# have installed TI-RTOS, it is located in the products/bios_* path. +BIOS_INSTALL_DIR = + +# NDK_INSTALL_DIR is the path to TI-RTOS NDK directory. If you have +# installed TI-RTOS, it is located in the products/ndk_* path. +NDK_INSTALL_DIR = + +# TIVAWARE_INSTALL_DIR is the path to Tivaware driverlib directory. If you have +# installed TI-RTOS, it is located in the products/TivaWare_* path. +TIVAWARE_INSTALL_DIR = + +# Define the code generation tools path for TI, IAR and GCC ARM compilers. +# If you have installed Code Composer Studio, the TI and GCC compiler are +# located in the ccsv*/tools/compiler/* path. +# +# Leave assignment empty to disable any toolchain. +ti.targets.arm.elf.M4F = +iar.targets.arm.M4F = +gnu.targets.arm.M4F = diff --git a/tirtos/wolfssl.bld b/tirtos/wolfssl.bld index 1c1e55ef5..59e95103b 100644 --- a/tirtos/wolfssl.bld +++ b/tirtos/wolfssl.bld @@ -34,7 +34,7 @@ var armOpts = " -ms "; var gnuOpts = " -D_POSIX_SOURCE "; var iarOpts = " --diag_suppress=Pa134 "; -var TivaWareDir = ""; +var ndkDir = ""; /* Uncomment the following lines to build libraries for debug mode: */ // Pkg.attrs.profile = "debug"; @@ -57,7 +57,7 @@ var ccOpts = { for (arg = 0; arg < arguments.length; arg++) { /* * Get the compiler's installation directory. - * For "ti.targets.arm.elf.M4F=/vendors/arm/6.1.0", + * For "ti.targets.arm.elf.M4F=/vendors/arm/6.1.0", * we get "/vendors/arm/6.1.0" */ var targetName = arguments[arg].split("=")[0]; @@ -68,8 +68,8 @@ for (arg = 0; arg < arguments.length; arg++) { continue; } - if (targetName.match(/^TIVAWARE/) ) { - TivaWareDir = rootDir; + if (targetName.match(/^NDK/) ) { + ndkDir = rootDir; continue; } @@ -81,9 +81,9 @@ for (arg = 0; arg < arguments.length; arg++) { } /* Include Path (needed to find NDK headers) */ -var ndkPath = "$(NDK_INSTALL_DIR)/packages/ti/ndk/"; -var wolfsslPathInclude = " -I" + ndkPath + "/inc/bsd -DWOLFSSL_TIRTOS "; +var wolfsslPathInclude = " -I" + ndkDir + "/packages/ti/ndk/inc/bsd " + + "-DWOLFSSL_TIRTOS "; /* lib/ is a generated directory that 'xdc clean' should remove */ -var Pkg = xdc.useModule('xdc.bld.PackageContents'); +var Pkg = xdc.useModule('xdc.bld.PackageContents'); Pkg.generatedFiles.$add("lib/"); diff --git a/tirtos/wolfssl.mak b/tirtos/wolfssl.mak index 5ab82c065..c419e1a38 100644 --- a/tirtos/wolfssl.mak +++ b/tirtos/wolfssl.mak @@ -1,27 +1,17 @@ # # ======== wolfssl.mak ======== # +include ./products.mak -# USER OPTIONAL STEP: These variables are set when building wolfssl -# through the tirtos.mak -# Set up dependencies -XDC_INSTALL_DIR ?= C:/ti/xdctools_3_24_02_30 -SYSBIOS_INSTALL_DIR ?= C:/ti/bios_6_34_01_14 -NDK_INSTALL_DIR ?= C:/ti/ndk_2_24_00_02 -TIRTOS_INSTALLATION_DIR ?= C:/ti/tirtos_tivac_2_00_00_22 -TIVAWARE ?= C:/ti/tivaware -WOLFSSL_INSTALL_DIR ?= C:/wolfssl/wolfssl-2.9.4 +# Enable older TI-RTOS 2.14-based variables +ifeq ($(BIOS_INSTALL_DIR),) + BIOS_INSTALL_DIR=$(SYSBIOS_INSTALL_DIR) +endif +ifeq ($(TIVAWARE_INSTALL_DIR),) + TIVAWARE_INSTALL_DIR=$(TIVAWARE) +endif -# -# Set location of various cgtools -# These variables can be set here or on the command line. These -# variables are set when building wolfssl through tirtos.mak -# USER OPTIONAL STEP: user can define below paths to compilers -ti.targets.arm.elf.M4F ?= - -gnu.targets.arm.M4F ?= - -iar.targets.arm.M4F ?= +WOLFSSL_INSTALL_DIR=$(CURDIR)/../ # # Set XDCARGS to some of the variables above. XDCARGS are passed @@ -40,12 +30,12 @@ XDCARGS= \ ti.targets.arm.elf.M4F=\"$(ti.targets.arm.elf.M4F)\" \ gnu.targets.arm.M4F=\"$(gnu.targets.arm.M4F)\" \ iar.targets.arm.M4F=\"$(iar.targets.arm.M4F)\" \ - TIVAWARE=\"$(TIVAWARE)\" + NDK=\"$(NDK_INSTALL_DIR)\" # # Set XDCPATH to contain necessary repositories. # -XDCPATH = $(SYSBIOS_INSTALL_DIR)/packages;$(NDK_INSTALL_DIR)/packages;$(WOLFSSL_INSTALL_DIR);$(TIRTOS_INSTALLATION_DIR)/packages;$(TIVAWARE); +XDCPATH = $(BIOS_INSTALL_DIR)/packages;$(NDK_INSTALL_DIR)/packages;$(WOLFSSL_INSTALL_DIR);$(TIVAWARE_INSTALL_DIR) export XDCPATH #