### Build Process Authenticator Provisioning tool  ######################
LOCAL_NAME := pa_signer
LOCAL_SRC_C := $(wildcard tools/pa_signer/src/*.c)
LOCAL_SRC_CPP := $(wildcard tools/pa_signer/src/*.cpp)
LOCAL_CFLAGS := -std=gnu99 $(PA_GLOBAL_CFLAGS)
LOCAL_CPPFLAGS := -std=c++11 $(PA_GLOBAL_CFLAGS)
LOCAL_LDFLAGS := -lcrypto -lstdc++
LOCAL_STATIC_LIBRARIES := asn1proto
include $(BUILD_HOST)

LOCAL_NAME := unit_test_pa_signer
LOCAL_INCLUDE_DIRS += tools/pa_signer/src
LOCAL_SRC_C := $(wildcard tools/pa_signer/src/*.c)
LOCAL_SRC_CPP := $(wildcard tools/pa_signer/src/*.cpp)
LOCAL_SRC_CPP := $(filter-out tools/pa_signer/src/pa_signer.cpp, $(wildcard tools/pa_signer/src/*.cpp))
LOCAL_SRC_CPP += $(wildcard tools/pa_signer/src/tests/*.cpp)
LOCAL_CPPFLAGS := -std=c++11
LOCAL_STATIC_LIBRARIES := asn1proto gtest_main

LOCAL_LDFLAGS += -lstdc++ -lpthread -lcrypto --coverage
include $(BUILD_HOST)

.PHONY: _run_unit_test_tools
_run_unit_test_tools: unit_test_pa_signer
	@GTEST_OUTPUT="xml:./out/host/unit_test_asn1/unit_test_pa_signer.xml" ./out/host/unit_test_pa_signer/unit_test_pa_signer

run_utests: _run_unit_test_tools

