1 # 2 # Copyright (C) 2014 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 17 PWD ?= $(CURDIR) 18 OUT ?= $(PWD)/build-opt-local 19 20 include common.mk 21 22 PC_DEPS = libchrome-$(BASE_VER) libbrillo-$(BASE_VER) openssl 23 PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS)) 24 PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS)) 25 26 CXXFLAGS += -I$(SRC)/.. $(PC_CFLAGS) 27 LDLIBS += $(PC_LIBS) 28 29 TEST_OBJS := $(filter %_test.o trunks_testrunner.o mock_%.o, $(CXX_OBJECTS)) 30 SHARED_OBJS := $(filter-out $(TEST_OBJS), $(CXX_OBJECTS)) 31 32 CXX_BINARY(trunks_testrunner): CXXFLAGS += $(shell gtest-config --cxxflags) \ 33 $(shell gmock-config --cxxflags) 34 CXX_BINARY(trunks_testrunner): LDLIBS += $(shell gtest-config --libs) \ 35 $(shell gmock-config --libs) 36 CXX_BINARY(trunks_testrunner): $(TEST_OBJS) $(SHARED_OBJS) 37 38 all: $(SHARED_OBJS) 39 tests: TEST(CXX_BINARY(trunks_testrunner)) 40 clean: CLEAN(CXX_BINARY(trunks_testrunner)) 41