summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2015-05-13 12:07:50 -0600
committerShawn Willden <swillden@google.com>2015-05-18 09:07:48 -0600
commit67380a948d80ce62455b1ec9ed8283e3349498c6 (patch)
treecad1b02f443416975477ae9065ea41b0738b6432 /Makefile
parentbcd6b99ad5eb0e010f611facb55358e52cbde071 (diff)
downloadandroid_system_keymaster-67380a948d80ce62455b1ec9ed8283e3349498c6.tar.gz
android_system_keymaster-67380a948d80ce62455b1ec9ed8283e3349498c6.tar.bz2
android_system_keymaster-67380a948d80ce62455b1ec9ed8283e3349498c6.zip
Build development unit tests against BoringSSL.
Change-Id: Ie3ab9e09913ed304d5326dca3bfa398f26dc9bf7
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 33 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 85d9c6f..3d87148 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,38 @@
+#####
+# Local unit test Makefile
+#
+# This makefile builds and runs the keymaster unit tests locally on the development
+# machine, not on an Android device. Android.mk builds the same tests into the
+# "keymaster_tests" binary for execution on-device, but this Makefile runs them locally,
+# for a very fast edit/build/test development cycle.
+#
+# To build and run these tests, one pre-requisite must be manually installed: BoringSSL.
+# This Makefile expects to find BoringSSL in a directory adjacent to $ANDROID_BUILD_TOP.
+# To get and build it, first install the Ninja build tool (e.g. apt-get install
+# ninja-build), then do:
+#
+# cd $ANDROID_BUILD_TOP/..
+# git clone https://boringssl.googlesource.com/boringssl
+# cd boringssl
+# mdkir build
+# cd build
+# cmake -GNinja ..
+# ninja
+#
+# Then return to $ANDROID_BUILD_TOP/system/keymaster and run "make".
+#####
+
BASE=../..
SUBS=system/core \
hardware/libhardware \
- external/gtest
+ external/gtest \
+ system/security/softkeymaster \
+ system/security/keystore
GTEST=$(BASE)/external/gtest
INCLUDES=$(foreach dir,$(SUBS),-I $(BASE)/$(dir)/include) \
-I $(BASE)/libnativehelper/include/nativehelper \
- -I $(GTEST) -Iinclude
+ -I $(GTEST) -Iinclude -I$(BASE)/../boringssl/include
ifdef USE_CLANG
CC=/usr/bin/clang
@@ -17,7 +43,7 @@ else
COMPILER_SPECIFIC_ARGS=-std=c++0x -fprofile-arcs
endif
-CPPFLAGS=$(INCLUDES) -g -O0 -MD
+CPPFLAGS=$(INCLUDES) -g -O0 -MD -MP
CXXFLAGS=-Wall -Werror -Wno-unused -Winit-self -Wpointer-arith -Wunused-parameter \
-Werror=sign-compare -Wmissing-declarations -ftest-coverage -fno-permissive \
-Wno-deprecated-declarations -fno-exceptions -DKEYMASTER_NAME_TAGS \
@@ -26,7 +52,7 @@ CXXFLAGS=-Wall -Werror -Wno-unused -Winit-self -Wpointer-arith -Wunused-paramete
# Uncomment to enable debug logging.
# CXXFLAGS += -DDEBUG
-LDLIBS=-lcrypto -lpthread -lstdc++ -lgcov
+LDLIBS=-L$(BASE)/../boringssl/build/crypto -lcrypto -lpthread -lstdc++ -lgcov
CPPSRCS=\
abstract_factory_registry_test.cpp \
@@ -109,7 +135,9 @@ MEMCHECK_OPTS=--leak-check=full \
--show-reachable=yes \
--vgdb=full \
$(UNINIT_OPTS) \
- --error-exitcode=1
+ --error-exitcode=1 \
+ --suppressions=valgrind.supp \
+ --gen-suppressions=all
MASSIF_OPTS=--tool=massif \
--stacks=yes