Will Arthur | ca8e7f3 | 2015-08-03 15:35:19 -0400 | [diff] [blame] | 1 | #;**********************************************************************; |
| 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 Tricca | e690e08 | 2015-09-07 18:17:35 -0700 | [diff] [blame] | 29 | include src_vars.mk |
| 30 | |
Philip Tricca | a509a68 | 2015-09-14 15:34:52 -0700 | [diff] [blame] | 31 | ACLOCAL_AMFLAGS = -I m4 |
Philip Tricca | 391e889 | 2017-02-08 13:15:27 -0800 | [diff] [blame] | 32 | AM_CFLAGS = -I$(srcdir)/include -I$(srcdir)/sysapi/include -I$(srcdir)/log |
Philip Tricca | a509a68 | 2015-09-14 15:34:52 -0700 | [diff] [blame] | 33 | |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 34 | # stuff to build, what that stuff is, and where/if to install said stuff |
| 35 | sbin_PROGRAMS = $(resourcemgr) |
| 36 | noinst_PROGRAMS = $(tpmclient) $(tpmtest) |
Philip Tricca | 7360972 | 2017-02-10 10:50:06 -0800 | [diff] [blame] | 37 | lib_LTLIBRARIES = $(libmarshal) $(libsapi) $(libtcti_device) $(libtcti_socket) |
Philip Tricca | e72f257 | 2016-12-02 11:26:59 -0800 | [diff] [blame] | 38 | noinst_LTLIBRARIES = test/integration/libtest_utils.la |
| 39 | check_PROGRAMS = $(TESTS_UNIT) $(TESTS_INTEGRATION) |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 40 | |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 41 | # unit tests |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 42 | if UNIT |
Philip Tricca | e72f257 | 2016-12-02 11:26:59 -0800 | [diff] [blame] | 43 | TESTS_UNIT = \ |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 44 | test/unit/CommonPreparePrologue \ |
| 45 | test/unit/CopyCommandHeader \ |
| 46 | test/unit/getcommands-malloc-mock \ |
| 47 | test/unit/GetNumHandles \ |
| 48 | test/unit/marshal-TPM2B-simple \ |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 49 | test/unit/tcti-device \ |
Philip Tricca | 7360972 | 2017-02-10 10:50:06 -0800 | [diff] [blame] | 50 | test/unit/UINT8-marshal \ |
Philip Tricca | 689c090 | 2017-02-03 21:10:53 -0800 | [diff] [blame] | 51 | test/unit/UINT16-marshal \ |
Philip Tricca | bff7212 | 2017-02-04 07:53:07 -0800 | [diff] [blame] | 52 | test/unit/UINT32-marshal \ |
Philip Tricca | 935972e | 2017-02-15 14:49:56 -0800 | [diff] [blame] | 53 | test/unit/UINT64-marshal |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 54 | endif #UNIT |
| 55 | |
hp | 43ac71d | 2016-12-02 11:16:45 -0800 | [diff] [blame] | 56 | TESTS_INTEGRATION = \ |
hp | ab961cb | 2016-12-03 00:05:07 +0800 | [diff] [blame] | 57 | test/integration/get-random \ |
hp | b4bebc7 | 2016-12-20 18:22:28 +0800 | [diff] [blame] | 58 | test/integration/self-test \ |
hp | 328ae1b | 2017-01-10 17:16:46 +0800 | [diff] [blame] | 59 | test/integration/pcr-extension \ |
| 60 | test/integration/asymmetric-encrypt-decrypt |
hp | 43ac71d | 2016-12-02 11:16:45 -0800 | [diff] [blame] | 61 | |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 62 | TESTS = $(check_PROGRAMS) |
Philip Tricca | 7ae0154 | 2016-05-05 18:45:03 -0700 | [diff] [blame] | 63 | CLEANFILES = $(nodist_pkgconfig_DATA) |
Philip Tricca | 7d3515f | 2015-09-07 10:06:56 -0700 | [diff] [blame] | 64 | |
Philip Tricca | e72f257 | 2016-12-02 11:26:59 -0800 | [diff] [blame] | 65 | AM_TESTS_ENVIRONMENT = \ |
| 66 | export TPM20TEST_TCTI_NAME="socket"; \ |
| 67 | export TPM20TEST_SOCKET_ADDRESS="127.0.0.1"; \ |
| 68 | export TPM20TEST_SOCKET_PORT="2321"; |
| 69 | |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 70 | # headers and where to install them |
Philip Tricca | d69337a | 2016-05-26 16:16:01 -0700 | [diff] [blame] | 71 | libsapidir = $(includedir)/sapi |
| 72 | libsapi_HEADERS = $(srcdir)/include/sapi/*.h |
Philip Tricca | c3dedc2 | 2016-01-15 13:47:22 -0800 | [diff] [blame] | 73 | libtctidir = $(includedir)/tcti |
| 74 | libtcti_HEADERS = $(srcdir)/include/tcti/*.h |
Philip Tricca | 7360972 | 2017-02-10 10:50:06 -0800 | [diff] [blame] | 75 | |
Philip Tricca | 7ae0154 | 2016-05-05 18:45:03 -0700 | [diff] [blame] | 76 | # pkg-config files |
| 77 | pkgconfigdir = $(libdir)/pkgconfig |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 78 | nodist_pkgconfig_DATA = lib/sapi.pc lib/tcti-device.pc lib/tcti-socket.pc |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 79 | |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 80 | if UNIT |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 81 | test_unit_tcti_device_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include -I$(srcdir)/sysapi/include |
| 82 | test_unit_tcti_device_LDADD = $(libsapi) $(libtcti_device) $(CMOCKA_LIBS) |
| 83 | test_unit_tcti_device_SOURCES = test/unit/tcti-device.c |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 84 | |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 85 | test_unit_getcommands_malloc_mock_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include \ |
Philip Tricca | 4c1b4a0 | 2016-06-21 05:44:51 -0700 | [diff] [blame] | 86 | -I$(srcdir)/sysapi/include/ |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 87 | test_unit_getcommands_malloc_mock_LDADD = $(CMOCKA_LIBS) |
| 88 | test_unit_getcommands_malloc_mock_LDFLAGS = -Wl,--wrap=malloc \ |
Philip Tricca | 4c1b4a0 | 2016-06-21 05:44:51 -0700 | [diff] [blame] | 89 | -Wl,--wrap=Tss2_Sys_GetCapability |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 90 | test_unit_getcommands_malloc_mock_SOURCES = \ |
| 91 | test/unit/getcommands-malloc-mock.c resourcemgr/getcommands.c |
Philip Tricca | 4c1b4a0 | 2016-06-21 05:44:51 -0700 | [diff] [blame] | 92 | |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 93 | test_unit_CommonPreparePrologue_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include \ |
Philip Tricca | 6f634c4 | 2016-07-23 12:32:15 -0700 | [diff] [blame] | 94 | -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 95 | test_unit_CommonPreparePrologue_LDFLAGS = -Wl,--unresolved-symbols=ignore-all |
| 96 | test_unit_CommonPreparePrologue_LDADD = $(CMOCKA_LIBS) |
| 97 | test_unit_CommonPreparePrologue_SOURCES = \ |
| 98 | test/unit/CommonPreparePrologue.c sysapi/sysapi_util/CommandUtil.c \ |
Philip Tricca | 90363cd | 2016-07-23 15:22:37 -0700 | [diff] [blame] | 99 | sysapi/sysapi/ContextManagement.c |
Philip Tricca | 6f634c4 | 2016-07-23 12:32:15 -0700 | [diff] [blame] | 100 | |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 101 | test_unit_GetNumHandles_CFLAGS = $(CMOCKA_CFLAGS) \ |
Philip Tricca | 364c0ce | 2016-07-23 16:48:37 -0700 | [diff] [blame] | 102 | -I$(srcdir)/include -I$(srcdir)/sysapi/include |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 103 | test_unit_GetNumHandles_LDADD = $(CMOCKA_LIBS) |
| 104 | test_unit_GetNumHandles_SOURCES = \ |
| 105 | test/unit/GetNumHandles.c sysapi/sysapi_util/GetNumHandles.c |
Philip Tricca | 1f3a1fd | 2016-08-14 11:48:45 -0700 | [diff] [blame] | 106 | |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 107 | test_unit_CopyCommandHeader_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include \ |
Philip Tricca | 81223f4 | 2016-07-28 19:50:08 -0700 | [diff] [blame] | 108 | -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 109 | test_unit_CopyCommandHeader_LDFLAGS = -Wl,--unresolved-symbols=ignore-all |
| 110 | test_unit_CopyCommandHeader_LDADD = $(CMOCKA_LIBS) |
| 111 | test_unit_CopyCommandHeader_SOURCES = \ |
| 112 | test/unit/CopyCommandHeader.c sysapi/sysapi_util/CommandUtil.c \ |
Philip Tricca | 81223f4 | 2016-07-28 19:50:08 -0700 | [diff] [blame] | 113 | sysapi/sysapi/ContextManagement.c sysapi/sysapi_util/changeEndian.c |
Philip Tricca | f1811f0 | 2016-08-28 11:02:31 -0700 | [diff] [blame] | 114 | |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 115 | test_unit_marshal_TPM2B_simple_CFLAGS = $(CMOCKA_CFLAGS) \ |
Philip Tricca | 430cda2 | 2016-09-01 15:41:53 -0700 | [diff] [blame] | 116 | -I$(srcdir)/include -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | 6260ec0 | 2017-02-14 15:06:30 -0800 | [diff] [blame] | 117 | test_unit_marshal_TPM2B_simple_LDADD = $(CMOCKA_LIBS) $(libmarshal) |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 118 | test_unit_marshal_TPM2B_simple_SOURCES = \ |
Philip Tricca | 430cda2 | 2016-09-01 15:41:53 -0700 | [diff] [blame] | 119 | sysapi/sysapi_util/changeEndian.c \ |
Philip Tricca | 430cda2 | 2016-09-01 15:41:53 -0700 | [diff] [blame] | 120 | sysapi/sysapi_util/CopySessionData.c \ |
| 121 | sysapi/sysapi_util/marshal_simple_tpm2b.c \ |
| 122 | sysapi/sysapi_util/unmarshal_simple_tpm2b.c \ |
| 123 | sysapi/sysapi_util/unmarshal_simple_tpm2b_no_size_check.c \ |
Philip Tricca | e08bdb9 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 124 | test/unit/marshal-TPM2B-simple.c |
Philip Tricca | 430cda2 | 2016-09-01 15:41:53 -0700 | [diff] [blame] | 125 | |
Philip Tricca | 7360972 | 2017-02-10 10:50:06 -0800 | [diff] [blame] | 126 | test_unit_UINT8_marshal_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include |
| 127 | test_unit_UINT8_marshal_LDADD = $(CMOCKA_LIBS) $(libmarshal) |
| 128 | test_unit_UINT8_marshal_SOURCES = test/unit/UINT8-marshal.c |
Philip Tricca | 689c090 | 2017-02-03 21:10:53 -0800 | [diff] [blame] | 129 | |
| 130 | test_unit_UINT16_marshal_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include |
| 131 | test_unit_UINT16_marshal_LDADD = $(CMOCKA_LIBS) $(libmarshal) |
| 132 | test_unit_UINT16_marshal_SOURCES = test/unit/UINT16-marshal.c |
Philip Tricca | bff7212 | 2017-02-04 07:53:07 -0800 | [diff] [blame] | 133 | |
| 134 | test_unit_UINT32_marshal_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include |
| 135 | test_unit_UINT32_marshal_LDADD = $(CMOCKA_LIBS) $(libmarshal) |
| 136 | test_unit_UINT32_marshal_SOURCES = test/unit/UINT32-marshal.c |
Philip Tricca | b33eb35 | 2017-02-04 09:41:35 -0800 | [diff] [blame] | 137 | |
| 138 | test_unit_UINT64_marshal_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include |
| 139 | test_unit_UINT64_marshal_LDADD = $(CMOCKA_LIBS) $(libmarshal) |
| 140 | test_unit_UINT64_marshal_SOURCES = test/unit/UINT64-marshal.c |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 141 | endif # UNIT |
Philip Tricca | 364c0ce | 2016-07-23 16:48:37 -0700 | [diff] [blame] | 142 | |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 143 | # how to build stuff |
Philip Tricca | fe6b8ae | 2016-04-22 14:17:10 -0700 | [diff] [blame] | 144 | resourcemgr_resourcemgr_CFLAGS = $(RESOURCEMGR_INC) $(PTHREAD_CFLAGS) $(AM_CFLAGS) |
Philip Tricca | 6260ec0 | 2017-02-14 15:06:30 -0800 | [diff] [blame] | 145 | resourcemgr_resourcemgr_LDADD = $(libsapi) $(libtcti_device) $(libtcti_socket) $(libmarshal) |
Philip Tricca | 0069247 | 2015-09-16 13:09:54 -0700 | [diff] [blame] | 146 | resourcemgr_resourcemgr_LDFLAGS = $(PTHREAD_LDFLAGS) |
Philip Tricca | 66f143a | 2016-04-17 00:09:06 -0700 | [diff] [blame] | 147 | resourcemgr_resourcemgr_SOURCES = $(RESOURCEMGR_C) $(COMMON_SRC) |
Philip Tricca | 10d1aa2 | 2015-09-07 10:55:58 -0700 | [diff] [blame] | 148 | |
Philip Tricca | 391e889 | 2017-02-08 13:15:27 -0800 | [diff] [blame] | 149 | marshal_libmarshal_la_LDFLAGS = $(LIBRARY_LDFLAGS) -Wl,--version-script=$(srcdir)/lib/libmarshal.map |
| 150 | marshal_libmarshal_la_SOURCES = marshal/base-types.c log/log.c |
Philip Tricca | 7360972 | 2017-02-10 10:50:06 -0800 | [diff] [blame] | 151 | |
Philip Tricca | d69337a | 2016-05-26 16:16:01 -0700 | [diff] [blame] | 152 | sysapi_libsapi_la_CFLAGS = -I$(srcdir)/sysapi/include $(AM_CFLAGS) |
Philip Tricca | 391e889 | 2017-02-08 13:15:27 -0800 | [diff] [blame] | 153 | sysapi_libsapi_la_LIBADD = $(libmarshal) |
Philip Tricca | d69337a | 2016-05-26 16:16:01 -0700 | [diff] [blame] | 154 | sysapi_libsapi_la_LDFLAGS = $(LIBRARY_LDFLAGS) |
| 155 | sysapi_libsapi_la_SOURCES = $(SYSAPI_C) $(SYSAPIUTIL_C) |
Philip Tricca | 7d3515f | 2015-09-07 10:06:56 -0700 | [diff] [blame] | 156 | |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 157 | tcti_libtcti_device_la_CFLAGS = $(TCTIDEVICE_INC) $(AM_CFLAGS) |
| 158 | tcti_libtcti_device_la_LDFLAGS = $(LIBRARY_LDFLAGS) \ |
Philip Tricca | 92fb8a7 | 2016-03-31 15:33:57 -0700 | [diff] [blame] | 159 | -Wl,--version-script=$(srcdir)/tcti/tcti_device.map |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 160 | tcti_libtcti_device_la_SOURCES = $(TCTIDEVICE_C) \ |
Philip Tricca | 3d48635 | 2016-04-18 11:26:25 -0700 | [diff] [blame] | 161 | sysapi/sysapi_util/changeEndian.c $(TCTICOMMON_C) common/debug.c |
Philip Tricca | 97e869f | 2015-11-03 20:19:44 -0500 | [diff] [blame] | 162 | |
Philip Tricca | b0927df | 2016-06-21 06:28:44 -0700 | [diff] [blame] | 163 | tcti_libtcti_socket_la_CFLAGS = $(TCTISOCKET_INC) $(AM_CFLAGS) |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 164 | tcti_libtcti_socket_la_LDFLAGS = $(LIBRARY_LDFLAGS) \ |
Philip Tricca | 92fb8a7 | 2016-03-31 15:33:57 -0700 | [diff] [blame] | 165 | -Wl,--version-script=$(srcdir)/tcti/tcti_socket.map |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 166 | tcti_libtcti_socket_la_SOURCES = $(TCTISOCKET_C) \ |
Philip Tricca | 56fec89 | 2017-02-25 11:31:55 -0800 | [diff] [blame] | 167 | sysapi/sysapi_util/changeEndian.c $(TCTICOMMON_C) \ |
| 168 | common/sockets.c common/debug.c |
Philip Tricca | a51ca97 | 2015-11-04 00:13:42 -0500 | [diff] [blame] | 169 | |
Philip Tricca | b0927df | 2016-06-21 06:28:44 -0700 | [diff] [blame] | 170 | test_tpmclient_tpmclient_CFLAGS = $(TPMCLIENT_INC) $(AM_CFLAGS) |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 171 | test_tpmclient_tpmclient_LDADD = $(libsapi) $(libtcti_socket) $(libtcti_device) |
Philip Tricca | 56fec89 | 2017-02-25 11:31:55 -0800 | [diff] [blame] | 172 | test_tpmclient_tpmclient_SOURCES = test/tpmclient/tpmclient.c $(COMMON_C) $(SAMPLE_C) |
Philip Tricca | 38de202 | 2015-09-07 11:46:28 -0700 | [diff] [blame] | 173 | |
Philip Tricca | b0927df | 2016-06-21 06:28:44 -0700 | [diff] [blame] | 174 | test_tpmtest_tpmtest_CFLAGS = $(TPMTEST_INC) $(AM_CFLAGS) |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 175 | test_tpmtest_tpmtest_LDADD = $(libsapi) $(libtcti_socket) $(libtcti_device) |
Philip Tricca | 56fec89 | 2017-02-25 11:31:55 -0800 | [diff] [blame] | 176 | test_tpmtest_tpmtest_SOURCES = test/tpmtest/tpmtest.c $(COMMON_C) $(SAMPLE_C) |
Gang Wei | e960069 | 2015-09-10 14:07:14 +0800 | [diff] [blame] | 177 | |
Philip Tricca | e72f257 | 2016-12-02 11:26:59 -0800 | [diff] [blame] | 178 | test_integration_libtest_utils_la_SOURCES = test/integration/test-options.c \ |
| 179 | test/integration/context-util.c |
| 180 | |
hp | 43ac71d | 2016-12-02 11:16:45 -0800 | [diff] [blame] | 181 | test_integration_get_random_LDADD = $(TESTS_LDADD) |
| 182 | test_integration_get_random_SOURCES = test/integration/get-random.c \ |
| 183 | test/integration/main.c |
| 184 | |
hp | ab961cb | 2016-12-03 00:05:07 +0800 | [diff] [blame] | 185 | test_integration_self_test_LDADD = $(TESTS_LDADD) |
| 186 | test_integration_self_test_SOURCES = test/integration/self-test.c \ |
| 187 | test/integration/main.c |
| 188 | |
hp | b4bebc7 | 2016-12-20 18:22:28 +0800 | [diff] [blame] | 189 | test_integration_pcr_extension_LDADD = $(TESTS_LDADD) |
| 190 | test_integration_pcr_extension_SOURCES = test/integration/pcr-extension.c \ |
| 191 | test/integration/main.c |
| 192 | |
hp | 328ae1b | 2017-01-10 17:16:46 +0800 | [diff] [blame] | 193 | test_integration_asymmetric_encrypt_decrypt_LDADD = $(TESTS_LDADD) |
| 194 | test_integration_asymmetric_encrypt_decrypt_SOURCES = test/integration/asymmetric-encrypt-decrypt.c \ |
| 195 | test/integration/main.c |
| 196 | |
Philip Tricca | e72f257 | 2016-12-02 11:26:59 -0800 | [diff] [blame] | 197 | TESTS_LDADD = $(noinst_LTLIBRARIES) $(lib_LTLIBRARIES) |
| 198 | |
Philip Tricca | 7ae0154 | 2016-05-05 18:45:03 -0700 | [diff] [blame] | 199 | %.pc : %.pc.in |
Philip Tricca | fdce98d | 2016-05-23 15:47:16 -0700 | [diff] [blame] | 200 | if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi |
Philip Tricca | 7ae0154 | 2016-05-05 18:45:03 -0700 | [diff] [blame] | 201 | sed -e "s,[@]VERSION[@],$(PACKAGE_VERSION),g; \ |
| 202 | s,[@]includedir[@],$(includedir),g;" $^ > $@ |
| 203 | |
Philip Tricca | b1a6406 | 2016-04-05 15:26:47 -0700 | [diff] [blame] | 204 | LIBRARY_LDFLAGS = -fPIC -Wl,--no-undefined |
Philip Tricca | 125bb32 | 2016-03-31 16:11:51 -0700 | [diff] [blame] | 205 | |
Philip Tricca | 475a02c | 2016-12-04 20:36:59 -0800 | [diff] [blame] | 206 | # simulator build / run scripts |
| 207 | CLEANFILES += test/simulator-build.sh test/simulator-run.sh test/simulator.inc |
| 208 | .PHONY = simulator-build simulator-start simulator-stop clean-local-ibmtpm |
| 209 | clean-local : clean-local-ibmtpm |
| 210 | clean-local-ibmtpm : |
| 211 | rm -rf test/ibmtpm* |
| 212 | |
| 213 | test/simulator.inc : $(srcdir)/script/simulator.inc |
| 214 | cp $< $@ |
| 215 | test/simulator-build.sh : $(srcdir)/script/simulator-build.sh |
| 216 | cp $< $@ |
| 217 | chmod 755 $@ |
| 218 | simulator-build : test/simulator-build.sh test/simulator.inc |
| 219 | test/simulator-build.sh |
| 220 | test/simulator-run.sh : $(srcdir)/script/simulator-run.sh |
| 221 | cp $< $@ |
| 222 | chmod 755 $@ |
| 223 | simulator-start : test/simulator-run.sh test/simulator.inc |
| 224 | test/simulator-run.sh start |
| 225 | simulator-stop : test/simulator-run.sh test/simulator.inc |
| 226 | test/simulator-run.sh stop |
| 227 | |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 228 | # simple variables |
Philip Tricca | c3dedc2 | 2016-01-15 13:47:22 -0800 | [diff] [blame] | 229 | RESOURCEMGR_INC = -I$(srcdir)/include -I$(srcdir)/common \ |
Philip Tricca | 785e88d | 2016-02-13 12:02:44 -0800 | [diff] [blame] | 230 | -I$(srcdir)/sysapi/include -I$(srcdir)/resourcemgr \ |
| 231 | -I$(srcdir)/test/tpmclient |
Philip Tricca | 4c1b4a0 | 2016-06-21 05:44:51 -0700 | [diff] [blame] | 232 | RESOURCEMGR_C = resourcemgr/resourcemgr.c resourcemgr/criticalsection_linux.c \ |
| 233 | resourcemgr/getcommands.c |
Philip Tricca | 10d1aa2 | 2015-09-07 10:55:58 -0700 | [diff] [blame] | 234 | |
Philip Tricca | 785e88d | 2016-02-13 12:02:44 -0800 | [diff] [blame] | 235 | TCTICOMMON_INC = -I$(srcdir)/include -I$(srcdir)/common \ |
| 236 | -I$(srcdir)/sysapi/include |
| 237 | TCTICOMMON_C = tcti/commonchecks.c |
Will-nuc | 8d4f967 | 2015-11-25 16:48:20 -0500 | [diff] [blame] | 238 | |
Philip Tricca | 785e88d | 2016-02-13 12:02:44 -0800 | [diff] [blame] | 239 | TCTIDEVICE_INC = $(TCTICOMMON_INC) |
| 240 | TCTIDEVICE_C = tcti/tcti_device.c |
Will-nuc | f2ea1f1 | 2015-11-25 16:29:57 -0500 | [diff] [blame] | 241 | |
Philip Tricca | 785e88d | 2016-02-13 12:02:44 -0800 | [diff] [blame] | 242 | TCTISOCKET_INC = $(TCTICOMMON_INC) |
Philip Tricca | 56fec89 | 2017-02-25 11:31:55 -0800 | [diff] [blame] | 243 | TCTISOCKET_C = tcti/platformcommand.c tcti/tcti_socket.c |
Philip Tricca | 97e869f | 2015-11-03 20:19:44 -0500 | [diff] [blame] | 244 | |
Gang Wei | 5f0d4e4 | 2016-08-17 12:11:22 +0800 | [diff] [blame] | 245 | TPMCLIENT_INC = -I$(srcdir)/include -I$(srcdir)/common \ |
| 246 | -I$(srcdir)/test/tpmclient -I$(srcdir)/sysapi/include \ |
Philip Tricca | e2c1679 | 2016-01-05 12:07:22 -0800 | [diff] [blame] | 247 | -I$(srcdir)/test/common/sample -I$(srcdir)/resourcemgr |
Philip Tricca | e690e08 | 2015-09-07 18:17:35 -0700 | [diff] [blame] | 248 | |
Gang Wei | 5f0d4e4 | 2016-08-17 12:11:22 +0800 | [diff] [blame] | 249 | TPMTEST_INC = -I$(srcdir)/include -I$(srcdir)/common \ |
| 250 | -I$(srcdir)/test/tpmclient -I$(srcdir)/sysapi/include \ |
Gang Wei | e960069 | 2015-09-10 14:07:14 +0800 | [diff] [blame] | 251 | -I$(srcdir)/test/common/sample -I$(srcdir)/resourcemgr |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 252 | |
Philip Tricca | d69337a | 2016-05-26 16:16:01 -0700 | [diff] [blame] | 253 | libsapi = sysapi/libsapi.la |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 254 | libtcti_device = tcti/libtcti-device.la |
| 255 | libtcti_socket = tcti/libtcti-socket.la |
Philip Tricca | 7360972 | 2017-02-10 10:50:06 -0800 | [diff] [blame] | 256 | libmarshal = marshal/libmarshal.la |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 257 | resourcemgr = resourcemgr/resourcemgr |
| 258 | tpmclient = test/tpmclient/tpmclient |
| 259 | tpmtest = test/tpmtest/tpmtest |