blob: b420c01e55385e6fa3898e1912b8fc0d513033fd [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
40libtpm2sapi_HEADERS = $(SYSAPI_H)
Philip Tricca97e869f2015-11-03 20:19:44 -050041libtpm2tctidir = $(includedir)/tpm2tcti
Philip Triccaa51ca972015-11-04 00:13:42 -050042libtpm2tcti_HEADERS = $(LOCALTPM_H) $(TPMSOCKETS_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)
Philip Tricca97e869f2015-11-03 20:19:44 -050047resourcemgr_resourcemgr_LDADD = $(libtpm2sapi) $(libtpm2tctidev)
Philip Tricca00692472015-09-16 13:09:54 -070048resourcemgr_resourcemgr_LDFLAGS = $(PTHREAD_LDFLAGS)
Philip Tricca2bd4adb2015-09-25 00:14:16 -070049resourcemgr_resourcemgr_SOURCES = $(RESOURCEMGR_C) $(TPMSOCKETS_CXX) \
Philip Tricca97e869f2015-11-03 20:19:44 -050050 $(COMMON_C)
Philip Tricca10d1aa22015-09-07 10:55:58 -070051
Philip Tricca2bd4adb2015-09-25 00:14:16 -070052sysapi_libtpm2sapi_la_CFLAGS = -I$(srcdir)/sysapi/include/
53sysapi_libtpm2sapi_la_SOURCES = $(SYSAPI_C) $(SYSAPIUTIL_C)
Philip Tricca7d3515f2015-09-07 10:06:56 -070054
Philip Tricca97e869f2015-11-03 20:19:44 -050055tcti_libtpm2tctidev_la_CFLAGS = $(TCTIDEV_INC)
56tcti_libtpm2tctidev_la_SOURCES = common/debug.c $(LOCALTPM_C)
57
Philip Triccaa51ca972015-11-04 00:13:42 -050058tcti_libtpm2tctisock_la_CFLAGS = -DSAPI_CLIENT $(TCTISOCK_INC)
59tcti_libtpm2tctisock_la_CXXFLAGS = -DSAPI_CLIENT $(TCTISOCK_INC)
60tcti_libtpm2tctisock_la_SOURCES = common/debug.c $(TPMSOCKETS_CXX)
61
Philip Tricca38de2022015-09-07 11:46:28 -070062test_tpmclient_tpmclient_CFLAGS = -DSAPI_CLIENT $(TPMCLIENT_INC)
63test_tpmclient_tpmclient_CXXFLAGS = -DSAPI_CLIENT $(TPMCLIENT_INC)
Philip Triccaa51ca972015-11-04 00:13:42 -050064test_tpmclient_tpmclient_LDADD = $(libtpm2sapi) $(libtpm2tctisock)
65test_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 Tricca10d1aa22015-09-07 10:55:58 -070073RESOURCEMGR_INC = -I$(srcdir)/sysapi/include -I$(srcdir)/common \
74 -I$(srcdir)/tcti/tpmsockets -I$(srcdir)/tcti/localtpm \
75 -I$(srcdir)/resourcemgr -I$(srcdir)/test/tpmclient
Philip Tricca2bd4adb2015-09-25 00:14:16 -070076RESOURCEMGR_C = resourcemgr/resourcemgr.c
Philip Tricca10d1aa22015-09-07 10:55:58 -070077
Philip Tricca97e869f2015-11-03 20:19:44 -050078TCTIDEV_INC = -I$(srcdir)/sysapi/include -I$(srcdir)/common \
79 -I$(srcdir)/tcti/localtpm
Philip Triccaa51ca972015-11-04 00:13:42 -050080TCTISOCK_INC = -I$(srcdir)/sysapi/include -I$(srcdir)/common \
81 -I$(srcdir)/tcti/tpmsockets
Philip Tricca97e869f2015-11-03 20:19:44 -050082
Philip Tricca2bd4adb2015-09-25 00:14:16 -070083TPMCLIENT_INC = -I$(srcdir)/sysapi/include -I$(srcdir)/tcti/tpmsockets \
84 -I$(srcdir)/test/tpmclient -I$(srcdir)/common \
Philip Tricca38de2022015-09-07 11:46:28 -070085 -I$(srcdir)/test/common/sample -I$(srcdir)/resourcemgr
Philip Tricca2bd4adb2015-09-25 00:14:16 -070086TPMCLIENT_CXX = test/tpmclient/tpmclient.cpp
Philip Triccae690e082015-09-07 18:17:35 -070087
Philip Tricca2bd4adb2015-09-25 00:14:16 -070088TPMTEST_INC = -I$(srcdir)/sysapi/include -I$(srcdir)/tcti/tpmsockets \
89 -I$(srcdir)/test/tpmclient -I$(srcdir)/common \
Gang Weie9600692015-09-10 14:07:14 +080090 -I$(srcdir)/test/common/sample -I$(srcdir)/resourcemgr
Philip Tricca2bd4adb2015-09-25 00:14:16 -070091TPMTEST_CXX = test/tpmtest/tpmtest.cpp
92
93libtpm2sapi = sysapi/libtpm2sapi.la
Philip Tricca97e869f2015-11-03 20:19:44 -050094libtpm2tctidev = tcti/libtpm2tctidev.la
Philip Triccaa51ca972015-11-04 00:13:42 -050095libtpm2tctisock = tcti/libtpm2tctisock.la
Philip Tricca2bd4adb2015-09-25 00:14:16 -070096resourcemgr = resourcemgr/resourcemgr
97tpmclient = test/tpmclient/tpmclient
98tpmtest = test/tpmtest/tpmtest