blob: 6c9f6f0e5167f3fd469319bc6a0666f96f5d52a5 [file] [log] [blame]
# Copyright (C) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE.makefile file.
# Top-level Makefile for verity.
# Pull in chromium os defaults
# Prepend with our include
CFLAGS += -I$(SRC)/include -I$(SRC)/..
CXXFLAGS += -I$(SRC)/include -I$(SRC)/..
# Current toolchain doesn't support -pie statically linked binaries
CXX_STATIC_BINARY(verity-static): \
$(filter-out %_testrunner.o %_unittest.o,$(CXX_OBJECTS)) \
CXX_STATIC_LIBRARY(kernel/libkernel.pic.a) \
all: CXX_STATIC_BINARY(verity-static)
clean: CLEAN(verity-static)
CXX_BINARY(verity): $(filter-out %_testrunner.o %_unittest.o,$(CXX_OBJECTS)) \
CXX_STATIC_LIBRARY(kernel/libkernel.pie.a) \
all: CXX_BINARY(verity)
clean: CLEAN(verity)
# Simple helper. Not ideal but here it is.
verity: CXX_BINARY(verity)
# Shared dm-bht library
CXX_LIBRARY( $(filter-out %verity_main.o,$(C_OBJECTS)) \
clean: CLEAN(
CXX_STATIC_LIBRARY(libdm-bht.pic.a): $(C_OBJECTS) \
clean: CLEAN(libdm-bht.pic.a)
# Give libdm-bht.pic.a a slightly cleaner name
# But, we have to do some odd stuff like use $(OUT) and use "cp"
# rather than mv because it gets called twice and can ace with the
# actual build of libdm-bht.pic.a
# TODO(wad) fix the double invocation problem and clean this up
libdm-bht.a: CXX_STATIC_LIBRARY(libdm-bht.pic.a)
cp $(OUT)libdm-bht.pic.a $(OUT)libdm-bht.a || true
all: libdm-bht.a
# For this project, only the unittests are CXX
CXX_BINARY(verity_testrunner): $(filter-out %_main.o,$(CXX_OBJECTS)) \
$(filter %dm-bht-userspace.o,$(C_OBJECTS)) \
CXX_STATIC_LIBRARY(kernel/libkernel.pie.a) \
$(call cxx_binary,-lgtest -lgmock -lpthread)
all: CXX_BINARY(verity_testrunner)
clean: CLEAN(verity_testrunner)
tests: TEST(CXX_BINARY(verity_testrunner))