| # |
| # Copyright (c) 2011-2013 Nest Labs, Inc. |
| # All rights reserved. |
| # |
| # This document is the property of Nest. It is considered |
| # confidential and proprietary information. |
| # |
| # This document may not be reproduced or transmitted in any form, |
| # in whole or in part, without the express written permission of |
| # Nest. |
| # |
| # Description: |
| # |
| |
| include pre.mak |
| |
| TpsDir = sw/tps |
| NestlabsLibDir = sw/nestlabs |
| |
| ResultIncDir = $(call GenerateResultPaths,,openssl) |
| ResultLibDir = $(call GenerateResultPaths,,.) |
| BuildDir = $(CURDIR)/$(BuildDirectory) |
| |
| PolarsslIncDir = $(call GenerateResultPaths,,polarssl) |
| |
| NlEMallocResultsDir = $(NestlabsLibDir)/lib/nlemalloc |
| NlEMallocIncludeDir = include |
| NlEMallocLibraryDir = |
| NlEMallocIncludePath = $(BuildRoot)/$(NlEMallocResultsDir)/$(NlEMallocIncludeDir) |
| |
| # |
| # Third-party software frameworks |
| # |
| |
| CLibraryDir = $(TpsDir)/newlib |
| CLibraryIncludeDir = $(call GenerateResultPaths,$(CLibraryDir),usr/arm-none-eabi/include) |
| CLibraryLibDir = $(call GenerateResultPaths,$(CLibraryDir),usr/arm-none-eabi/lib) |
| |
| AllLibraries = \ |
| libemssl.a \ |
| libbn.a \ |
| libjpake.a \ |
| libecdsa.a \ |
| libec.a \ |
| libecdh.a \ |
| libpolarssl.a \ |
| libctrdrbg.a |
| |
| all: install-includes $(BuildDir) |
| $(MAKE) \ |
| BUILD_DIR="$(BuildDir)" \ |
| LINK="$(LD) $(LDFLAGS)" \ |
| CC="$(CC)" \ |
| CPPFLAGS="$(CPPOPTFLAGS) -I$(NlEMallocIncludePath) -I$(CLibraryIncludeDir)" \ |
| AR=$(AR) \ |
| BN_MONT_ASM_TYPE=$(TargetProcArch) \ |
| -f Makefile.emssl |
| cp $(foreach l,$(AllLibraries),$(BuildDirectory)/lib/$(l)) $(ResultLibDir) |
| |
| clean: |
| $(MAKE) BUILD_DIR="$(BuildDir)" -f Makefile.emssl $@ |
| |
| $(ResultIncDir): |
| $(MKDIR) -p $@ |
| |
| $(PolarsslIncDir): |
| $(MKDIR) -p $@ |
| |
| $(BuildDir): |
| $(MKDIR) -p $@ |
| |
| install-includes: $(ResultIncDir) $(PolarsslIncDir) |
| cp openssl/*.h $(ResultIncDir) |
| cp polarssl/*.h $(PolarsslIncDir) |
| |
| include post.mak |