blob: 45796331e5afdb8e21b5f1100f9e1c86a30b8906 [file] [log] [blame]
Will Arthurca8e7f32015-08-03 15:35:19 -04001#;**********************************************************************;
2#
3# Copyright (c) 2015, Intel Corporation
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are met:
8#
9# 1. Redistributions of source code must retain the above copyright notice,
10# this list of conditions and the following disclaimer.
11#
12# 2. Redistributions in binary form must reproduce the above copyright notice,
13# this list of conditions and the following disclaimer in the documentation
14# and/or other materials provided with the distribution.
15#
16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26# THE POSSIBILITY OF SUCH DAMAGE.
27#;**********************************************************************;
28
Philip Triccae690e082015-09-07 18:17:35 -070029include src_vars.mk
30
Philip Triccaa509a682015-09-14 15:34:52 -070031ACLOCAL_AMFLAGS = -I m4
32
Philip Tricca2bd4adb2015-09-25 00:14:16 -070033# stuff to build, what that stuff is, and where/if to install said stuff
34sbin_PROGRAMS = $(resourcemgr)
35noinst_PROGRAMS = $(tpmclient) $(tpmtest)
Philip Triccaa51ca972015-11-04 00:13:42 -050036lib_LTLIBRARIES = $(libtpm2sapi) $(libtpm2tctidev) $(libtpm2tctisock)
Philip Tricca7d3515f2015-09-07 10:06:56 -070037
Philip Tricca2bd4adb2015-09-25 00:14:16 -070038# headers and where to install them
39libtpm2sapidir = $(includedir)/tpm2sapi
Philip Triccae2c16792016-01-05 12:07:22 -080040libtpm2sapi_HEADERS = $(srcdir)/include/tpm2sapi/*.h
Philip Tricca97e869f2015-11-03 20:19:44 -050041libtpm2tctidir = $(includedir)/tpm2tcti
Philip Triccae2c16792016-01-05 12:07:22 -080042libtpm2tcti_HEADERS = $(srcdir)/include/tpm2tcti/*.h
Philip Tricca2bd4adb2015-09-25 00:14:16 -070043
44# how to build stuff
Philip Tricca00692472015-09-16 13:09:54 -070045resourcemgr_resourcemgr_CFLAGS = $(RESOURCEMGR_INC) $(PTHREAD_CFLAGS)
46resourcemgr_resourcemgr_CXXFLAGS = $(RESOURCEMGR_INC) $(PTHREAD_CFLAGS)
Will-nuc8619aca2015-12-10 17:20:26 -050047resourcemgr_resourcemgr_LDADD = $(libtpm2sapi)
Philip Tricca00692472015-09-16 13:09:54 -070048resourcemgr_resourcemgr_LDFLAGS = $(PTHREAD_LDFLAGS)
Philip Triccabe9acd32016-01-25 00:05:58 +000049resourcemgr_resourcemgr_SOURCES = $(RESOURCEMGR_C) $(TPMSOCKETS_C) $(TPMSOCKETS_CXX) \
Will-nuc8619aca2015-12-10 17:20:26 -050050 $(COMMON_C) $(COMMONTCTI_C) $(LOCALTPM_C)
Philip Tricca10d1aa22015-09-07 10:55:58 -070051
Philip Triccae2c16792016-01-05 12:07:22 -080052sysapi_libtpm2sapi_la_CFLAGS = -I$(srcdir)/include/tpm2sapi
Philip Tricca2bd4adb2015-09-25 00:14:16 -070053sysapi_libtpm2sapi_la_SOURCES = $(SYSAPI_C) $(SYSAPIUTIL_C)
Philip Tricca7d3515f2015-09-07 10:06:56 -070054
Philip Triccae2c16792016-01-05 12:07:22 -080055tcti_libtpm2tctidev_la_CFLAGS = -DSAPI_CLIENT $(TCTIDEV_INC)
Will-nucf2ea1f12015-11-25 16:29:57 -050056tcti_libtpm2tctidev_la_SOURCES = common/debug.c $(LOCALTPM_C) $(COMMONTCTI_C)
Philip Tricca97e869f2015-11-03 20:19:44 -050057
Philip Triccae2c16792016-01-05 12:07:22 -080058tcti_libtpm2tctisock_la_CFLAGS = -DSAPI_CLIENT $(TCTISOCK_INC)
Philip Triccaa51ca972015-11-04 00:13:42 -050059tcti_libtpm2tctisock_la_CXXFLAGS = -DSAPI_CLIENT $(TCTISOCK_INC)
Philip Triccabe9acd32016-01-25 00:05:58 +000060tcti_libtpm2tctisock_la_SOURCES = common/debug.c $(TPMSOCKETS_C) $(TPMSOCKETS_CXX) $(COMMONTCTI_C)
Philip Triccaa51ca972015-11-04 00:13:42 -050061
Philip Tricca38de2022015-09-07 11:46:28 -070062test_tpmclient_tpmclient_CFLAGS = -DSAPI_CLIENT $(TPMCLIENT_INC)
Will-nuc8619aca2015-12-10 17:20:26 -050063test_tpmclient_tpmclient_CXXFLAGS = -DSAPI_CLIENT $(TPMCLIENT_INC) $(COMMONTCTI_INC) $(TCTIDEV_INC)
64test_tpmclient_tpmclient_LDADD = $(libtpm2sapi) $(libtpm2tctisock) $(libtpm2tctidev)
Philip Triccaa51ca972015-11-04 00:13:42 -050065test_tpmclient_tpmclient_SOURCES = $(TPMCLIENT_CXX) $(COMMON_C) $(SAMPLE_C)
Philip Tricca38de2022015-09-07 11:46:28 -070066
Gang Weie9600692015-09-10 14:07:14 +080067test_tpmtest_tpmtest_CFLAGS = -DSAPI_CLIENT $(TPMTEST_INC)
68test_tpmtest_tpmtest_CXXFLAGS = -DSAPI_CLIENT $(TPMTEST_INC)
Philip Triccaa51ca972015-11-04 00:13:42 -050069test_tpmtest_tpmtest_LDADD = $(libtpm2sapi) $(libtpm2tctisock)
70test_tpmtest_tpmtest_SOURCES = $(TPMTEST_CXX) $(COMMON_C) $(SAMPLE_C)
Gang Weie9600692015-09-10 14:07:14 +080071
Philip Tricca2bd4adb2015-09-25 00:14:16 -070072# simple variables
Philip Triccae2c16792016-01-05 12:07:22 -080073RESOURCEMGR_INC = -I$(srcdir)/include/tpm2sapi -I$(srcdir)/common \
74 -I$(srcdir)/include/tpm2tcti \
Will-nucf2ea1f12015-11-25 16:29:57 -050075 -I$(srcdir)/resourcemgr -I$(srcdir)/test/tpmclient \
76 -I$(srcdir)/tcti/commonTcti
Philip Tricca2bd4adb2015-09-25 00:14:16 -070077RESOURCEMGR_C = resourcemgr/resourcemgr.c
Philip Tricca10d1aa22015-09-07 10:55:58 -070078
Philip Triccae2c16792016-01-05 12:07:22 -080079COMMONTCTI_INC = -I$(srcdir)/include/tpm2sapi -I$(srcdir)/common \
80 -I$(srcdir)/include/tpm2tcti -I$(srcdir)/tcti/commonTcti
Will-nuc8d4f9672015-11-25 16:48:20 -050081
Philip Triccae2c16792016-01-05 12:07:22 -080082TCTIDEV_INC = -I$(srcdir)/tcti/localtpm $(COMMONTCTI_INC)
Will-nucf2ea1f12015-11-25 16:29:57 -050083
Philip Triccae2c16792016-01-05 12:07:22 -080084TCTISOCK_INC = -I$(srcdir)/tcti/tpmsockets $(COMMONTCTI_INC)
Philip Tricca97e869f2015-11-03 20:19:44 -050085
Philip Triccae2c16792016-01-05 12:07:22 -080086TPMCLIENT_INC = -I$(srcdir)/include/tpm2sapi -I$(srcdir)/include/tpm2tcti \
Philip Tricca2bd4adb2015-09-25 00:14:16 -070087 -I$(srcdir)/test/tpmclient -I$(srcdir)/common \
Philip Triccae2c16792016-01-05 12:07:22 -080088 -I$(srcdir)/test/common/sample -I$(srcdir)/resourcemgr
Philip Tricca2bd4adb2015-09-25 00:14:16 -070089TPMCLIENT_CXX = test/tpmclient/tpmclient.cpp
Philip Triccae690e082015-09-07 18:17:35 -070090
Philip Triccae2c16792016-01-05 12:07:22 -080091TPMTEST_INC = -I$(srcdir)/include/tpm2sapi -I$(srcdir)/include/tpm2tcti \
Philip Tricca2bd4adb2015-09-25 00:14:16 -070092 -I$(srcdir)/test/tpmclient -I$(srcdir)/common \
Gang Weie9600692015-09-10 14:07:14 +080093 -I$(srcdir)/test/common/sample -I$(srcdir)/resourcemgr
Philip Tricca2bd4adb2015-09-25 00:14:16 -070094TPMTEST_CXX = test/tpmtest/tpmtest.cpp
95
96libtpm2sapi = sysapi/libtpm2sapi.la
Philip Tricca97e869f2015-11-03 20:19:44 -050097libtpm2tctidev = tcti/libtpm2tctidev.la
Philip Triccaa51ca972015-11-04 00:13:42 -050098libtpm2tctisock = tcti/libtpm2tctisock.la
Philip Tricca2bd4adb2015-09-25 00:14:16 -070099resourcemgr = resourcemgr/resourcemgr
100tpmclient = test/tpmclient/tpmclient
101tpmtest = test/tpmtest/tpmtest