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 | 6e2b115 | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 32 | AM_CFLAGS = -I$(srcdir)/include -I$(srcdir)/sysapi/include |
Philip Tricca | daeb5bb | 2016-05-26 19:27:45 -0700 | [diff] [blame] | 33 | AM_CXXFLAGS = $(AM_CFLAGS) |
Philip Tricca | a509a68 | 2015-09-14 15:34:52 -0700 | [diff] [blame] | 34 | |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 35 | # stuff to build, what that stuff is, and where/if to install said stuff |
Philip Tricca | 00074b7 | 2017-05-10 13:14:53 -0700 | [diff] [blame] | 36 | noinst_PROGRAMS = $(tpmclient) |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 37 | lib_LTLIBRARIES = $(libsapi) $(libtcti_device) $(libtcti_socket) |
Philip Tricca | b77704e | 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 | b77704e | 2016-12-02 11:26:59 -0800 | [diff] [blame] | 43 | TESTS_UNIT = \ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 44 | test/unit/CheckOverflow \ |
| 45 | test/unit/CommonPreparePrologue \ |
| 46 | test/unit/CopyCommandHeader \ |
| 47 | test/unit/GetNumHandles \ |
| 48 | test/unit/marshal-TPM2B-simple \ |
| 49 | test/unit/marshal-UINT16 \ |
| 50 | test/unit/marshal-UINT32 \ |
| 51 | test/unit/tcti-device \ |
| 52 | test/unit/unmarshal-UINT16 \ |
| 53 | test/unit/unmarshal-UINT32 |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 54 | endif #UNIT |
| 55 | |
hp | 7ae176b | 2016-12-02 11:16:45 -0800 | [diff] [blame] | 56 | TESTS_INTEGRATION = \ |
hp | 1b9ccfa | 2016-12-03 00:05:07 +0800 | [diff] [blame^] | 57 | test/integration/get-random \ |
| 58 | test/integration/self-test |
hp | 7ae176b | 2016-12-02 11:16:45 -0800 | [diff] [blame] | 59 | |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 60 | TESTS = $(check_PROGRAMS) |
Philip Tricca | 632c431 | 2017-06-05 11:58:08 -0700 | [diff] [blame] | 61 | CLEANFILES = \ |
| 62 | $(nodist_pkgconfig_DATA) \ |
Philip Tricca | fe67168 | 2017-06-04 19:14:31 -0700 | [diff] [blame] | 63 | $(man3_MANS) \ |
Philip Tricca | 632c431 | 2017-06-05 11:58:08 -0700 | [diff] [blame] | 64 | $(man7_MANS) |
Philip Tricca | 7d3515f | 2015-09-07 10:06:56 -0700 | [diff] [blame] | 65 | |
Philip Tricca | b77704e | 2016-12-02 11:26:59 -0800 | [diff] [blame] | 66 | AM_TESTS_ENVIRONMENT = \ |
| 67 | export TPM20TEST_TCTI_NAME="socket"; \ |
| 68 | export TPM20TEST_SOCKET_ADDRESS="127.0.0.1"; \ |
| 69 | export TPM20TEST_SOCKET_PORT="2321"; |
| 70 | |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 71 | # headers and where to install them |
Philip Tricca | d69337a | 2016-05-26 16:16:01 -0700 | [diff] [blame] | 72 | libsapidir = $(includedir)/sapi |
| 73 | libsapi_HEADERS = $(srcdir)/include/sapi/*.h |
Philip Tricca | c3dedc2 | 2016-01-15 13:47:22 -0800 | [diff] [blame] | 74 | libtctidir = $(includedir)/tcti |
| 75 | libtcti_HEADERS = $(srcdir)/include/tcti/*.h |
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 | 632c431 | 2017-06-05 11:58:08 -0700 | [diff] [blame] | 79 | # man pages / documentation |
Philip Tricca | 1fa2f4d | 2017-06-04 20:01:39 -0700 | [diff] [blame] | 80 | man3_MANS = man/man3/InitDeviceTcti.3 man/man3/InitSocketTcti.3 |
Philip Tricca | 632c431 | 2017-06-05 11:58:08 -0700 | [diff] [blame] | 81 | man7_MANS = man/man7/tcti-device.7 man/man7/tcti-socket.7 |
| 82 | |
Philip Tricca | fe67168 | 2017-06-04 19:14:31 -0700 | [diff] [blame] | 83 | EXTRA_DIST = \ |
| 84 | man/InitDeviceTcti.3.in \ |
| 85 | man/tcti-device.7.in \ |
| 86 | man/tcti-socket.7.in |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 87 | |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 88 | if UNIT |
Philip Tricca | 6e2b115 | 2017-03-14 09:29:54 -0700 | [diff] [blame] | 89 | test_unit_tcti_device_CFLAGS = $(CMOCKA_CFLAGS) $(AM_CFLAGS) |
| 90 | test_unit_tcti_device_LDADD = $(CMOCKA_LIBS) |
| 91 | test_unit_tcti_device_LDFLAGS = -Wl,--wrap=read -Wl,-wrap=write |
| 92 | test_unit_tcti_device_SOURCES = tcti/commonchecks.c tcti/tcti_device.c \ |
| 93 | ./sysapi/sysapi_util/changeEndian.c test/unit/tcti-device.c |
Philip Tricca | b194be9 | 2016-03-15 13:27:09 -0700 | [diff] [blame] | 94 | |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 95 | test_unit_CommonPreparePrologue_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include \ |
Philip Tricca | 6f634c4 | 2016-07-23 12:32:15 -0700 | [diff] [blame] | 96 | -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 97 | test_unit_CommonPreparePrologue_LDFLAGS = -Wl,--unresolved-symbols=ignore-all |
| 98 | test_unit_CommonPreparePrologue_LDADD = $(CMOCKA_LIBS) |
| 99 | test_unit_CommonPreparePrologue_SOURCES = \ |
| 100 | test/unit/CommonPreparePrologue.c sysapi/sysapi_util/CommandUtil.c \ |
Philip Tricca | 90363cd | 2016-07-23 15:22:37 -0700 | [diff] [blame] | 101 | sysapi/sysapi/ContextManagement.c |
Philip Tricca | 6f634c4 | 2016-07-23 12:32:15 -0700 | [diff] [blame] | 102 | |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 103 | test_unit_GetNumHandles_CFLAGS = $(CMOCKA_CFLAGS) \ |
Philip Tricca | 364c0ce | 2016-07-23 16:48:37 -0700 | [diff] [blame] | 104 | -I$(srcdir)/include -I$(srcdir)/sysapi/include |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 105 | test_unit_GetNumHandles_LDADD = $(CMOCKA_LIBS) |
| 106 | test_unit_GetNumHandles_SOURCES = \ |
| 107 | test/unit/GetNumHandles.c sysapi/sysapi_util/GetNumHandles.c |
Philip Tricca | 1f3a1fd | 2016-08-14 11:48:45 -0700 | [diff] [blame] | 108 | |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 109 | test_unit_CopyCommandHeader_CFLAGS = $(CMOCKA_CFLAGS) -I$(srcdir)/include \ |
Philip Tricca | 81223f4 | 2016-07-28 19:50:08 -0700 | [diff] [blame] | 110 | -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 111 | test_unit_CopyCommandHeader_LDFLAGS = -Wl,--unresolved-symbols=ignore-all |
| 112 | test_unit_CopyCommandHeader_LDADD = $(CMOCKA_LIBS) |
| 113 | test_unit_CopyCommandHeader_SOURCES = \ |
| 114 | test/unit/CopyCommandHeader.c sysapi/sysapi_util/CommandUtil.c \ |
Philip Tricca | 81223f4 | 2016-07-28 19:50:08 -0700 | [diff] [blame] | 115 | sysapi/sysapi/ContextManagement.c sysapi/sysapi_util/changeEndian.c |
Philip Tricca | f1811f0 | 2016-08-28 11:02:31 -0700 | [diff] [blame] | 116 | |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 117 | test_unit_marshal_UINT16_CFLAGS = $(CMOCKA_CFLAGS) \ |
Philip Tricca | f1811f0 | 2016-08-28 11:02:31 -0700 | [diff] [blame] | 118 | -I$(srcdir)/include -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 119 | test_unit_marshal_UINT16_LDADD = $(CMOCKA_LIBS) |
| 120 | test_unit_marshal_UINT16_SOURCES = \ |
Philip Tricca | f1811f0 | 2016-08-28 11:02:31 -0700 | [diff] [blame] | 121 | sysapi/sysapi_util/changeEndian.c \ |
| 122 | sysapi/sysapi_util/checkoverflow.c \ |
| 123 | sysapi/sysapi_util/marshal_uint16.c \ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 124 | test/unit/marshal-UINT16.c |
Philip Tricca | 80d81bd | 2016-08-29 09:48:16 -0700 | [diff] [blame] | 125 | |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 126 | test_unit_unmarshal_UINT16_CFLAGS = $(CMOCKA_CFLAGS) \ |
Philip Tricca | 0038a17 | 2016-09-01 11:30:06 -0700 | [diff] [blame] | 127 | -I$(srcdir)/include -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 128 | test_unit_unmarshal_UINT16_LDADD = $(CMOCKA_LIBS) |
| 129 | test_unit_unmarshal_UINT16_SOURCES = \ |
Philip Tricca | 0038a17 | 2016-09-01 11:30:06 -0700 | [diff] [blame] | 130 | sysapi/sysapi_util/changeEndian.c \ |
| 131 | sysapi/sysapi_util/checkoverflow.c \ |
| 132 | sysapi/sysapi_util/unmarshal_uint16.c \ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 133 | test/unit/unmarshal-UINT16.c |
Philip Tricca | 0038a17 | 2016-09-01 11:30:06 -0700 | [diff] [blame] | 134 | |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 135 | test_unit_marshal_UINT32_CFLAGS = $(CMOCKA_CFLAGS) \ |
Philip Tricca | 80d81bd | 2016-08-29 09:48:16 -0700 | [diff] [blame] | 136 | -I$(srcdir)/include -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 137 | test_unit_marshal_UINT32_LDADD = $(CMOCKA_LIBS) |
| 138 | test_unit_marshal_UINT32_SOURCES = \ |
Philip Tricca | 80d81bd | 2016-08-29 09:48:16 -0700 | [diff] [blame] | 139 | sysapi/sysapi_util/changeEndian.c \ |
| 140 | sysapi/sysapi_util/checkoverflow.c \ |
| 141 | sysapi/sysapi_util/marshal_uint32.c \ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 142 | test/unit/marshal-UINT32.c |
Philip Tricca | f2f595d | 2016-09-01 11:47:31 -0700 | [diff] [blame] | 143 | |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 144 | test_unit_unmarshal_UINT32_CFLAGS = $(CMOCKA_CFLAGS) \ |
Philip Tricca | f2f595d | 2016-09-01 11:47:31 -0700 | [diff] [blame] | 145 | -I$(srcdir)/include -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 146 | test_unit_unmarshal_UINT32_LDADD = $(CMOCKA_LIBS) |
| 147 | test_unit_unmarshal_UINT32_SOURCES = \ |
Philip Tricca | f2f595d | 2016-09-01 11:47:31 -0700 | [diff] [blame] | 148 | sysapi/sysapi_util/changeEndian.c \ |
| 149 | sysapi/sysapi_util/checkoverflow.c \ |
| 150 | sysapi/sysapi_util/unmarshal_uint32.c \ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 151 | test/unit/unmarshal-UINT32.c |
Philip Tricca | f2f595d | 2016-09-01 11:47:31 -0700 | [diff] [blame] | 152 | |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 153 | test_unit_marshal_TPM2B_simple_CFLAGS = $(CMOCKA_CFLAGS) \ |
Philip Tricca | 430cda2 | 2016-09-01 15:41:53 -0700 | [diff] [blame] | 154 | -I$(srcdir)/include -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 155 | test_unit_marshal_TPM2B_simple_LDADD = $(CMOCKA_LIBS) |
| 156 | test_unit_marshal_TPM2B_simple_SOURCES = \ |
Philip Tricca | 430cda2 | 2016-09-01 15:41:53 -0700 | [diff] [blame] | 157 | sysapi/sysapi_util/changeEndian.c \ |
| 158 | sysapi/sysapi_util/checkoverflow.c \ |
| 159 | sysapi/sysapi_util/marshal_uint8.c \ |
| 160 | sysapi/sysapi_util/unmarshal_uint8.c \ |
| 161 | sysapi/sysapi_util/marshal_uint16.c \ |
| 162 | sysapi/sysapi_util/unmarshal_uint16.c \ |
| 163 | sysapi/sysapi_util/marshal_uint32.c \ |
| 164 | sysapi/sysapi_util/CopySessionData.c \ |
| 165 | sysapi/sysapi_util/marshal_simple_tpm2b.c \ |
| 166 | sysapi/sysapi_util/unmarshal_simple_tpm2b.c \ |
| 167 | sysapi/sysapi_util/unmarshal_simple_tpm2b_no_size_check.c \ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 168 | test/unit/marshal-TPM2B-simple.c |
Philip Tricca | 430cda2 | 2016-09-01 15:41:53 -0700 | [diff] [blame] | 169 | |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 170 | test_unit_CheckOverflow_CFLAGS = $(CMOCKA_CFLAGS) \ |
Philip Tricca | 1008bf5 | 2016-08-29 15:02:43 -0700 | [diff] [blame] | 171 | -I$(srcdir)/include -I$(srcdir)/include/sapi -I$(srcdir)/sysapi/include/ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 172 | test_unit_CheckOverflow_LDADD = $(CMOCKA_LIBS) |
| 173 | test_unit_CheckOverflow_SOURCES = \ |
Philip Tricca | 1008bf5 | 2016-08-29 15:02:43 -0700 | [diff] [blame] | 174 | sysapi/sysapi_util/checkoverflow.c \ |
Philip Tricca | 7340742 | 2016-12-01 15:37:50 -0800 | [diff] [blame] | 175 | test/unit/CheckOverflow.c |
Philip Tricca | 4334dee | 2016-08-09 19:56:28 -0700 | [diff] [blame] | 176 | endif # UNIT |
Philip Tricca | 364c0ce | 2016-07-23 16:48:37 -0700 | [diff] [blame] | 177 | |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 178 | # how to build stuff |
Philip Tricca | d69337a | 2016-05-26 16:16:01 -0700 | [diff] [blame] | 179 | sysapi_libsapi_la_CFLAGS = -I$(srcdir)/sysapi/include $(AM_CFLAGS) |
| 180 | sysapi_libsapi_la_LDFLAGS = $(LIBRARY_LDFLAGS) |
| 181 | sysapi_libsapi_la_SOURCES = $(SYSAPI_C) $(SYSAPIUTIL_C) |
Philip Tricca | 7d3515f | 2015-09-07 10:06:56 -0700 | [diff] [blame] | 182 | |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 183 | tcti_libtcti_device_la_CFLAGS = $(TCTIDEVICE_INC) $(AM_CFLAGS) |
| 184 | tcti_libtcti_device_la_LDFLAGS = $(LIBRARY_LDFLAGS) \ |
Philip Tricca | 92fb8a7 | 2016-03-31 15:33:57 -0700 | [diff] [blame] | 185 | -Wl,--version-script=$(srcdir)/tcti/tcti_device.map |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 186 | tcti_libtcti_device_la_SOURCES = $(TCTIDEVICE_C) \ |
Philip Tricca | 3d48635 | 2016-04-18 11:26:25 -0700 | [diff] [blame] | 187 | sysapi/sysapi_util/changeEndian.c $(TCTICOMMON_C) common/debug.c |
Philip Tricca | 97e869f | 2015-11-03 20:19:44 -0500 | [diff] [blame] | 188 | |
Philip Tricca | b0927df | 2016-06-21 06:28:44 -0700 | [diff] [blame] | 189 | tcti_libtcti_socket_la_CFLAGS = $(TCTISOCKET_INC) $(AM_CFLAGS) |
| 190 | tcti_libtcti_socket_la_CXXFLAGS = $(TCTISOCKET_INC) $(AM_CXXFLAGS) |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 191 | tcti_libtcti_socket_la_LDFLAGS = $(LIBRARY_LDFLAGS) \ |
Philip Tricca | 92fb8a7 | 2016-03-31 15:33:57 -0700 | [diff] [blame] | 192 | -Wl,--version-script=$(srcdir)/tcti/tcti_socket.map |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 193 | tcti_libtcti_socket_la_SOURCES = $(TCTISOCKET_C) \ |
Philip Tricca | 98b285a | 2016-03-11 20:50:04 -0800 | [diff] [blame] | 194 | sysapi/sysapi_util/changeEndian.c $(TCTISOCKET_CXX) $(TCTICOMMON_C) \ |
Philip Tricca | 4f2bdd7 | 2016-04-22 15:03:27 -0400 | [diff] [blame] | 195 | common/sockets.cpp common/debug.c |
Philip Tricca | a51ca97 | 2015-11-04 00:13:42 -0500 | [diff] [blame] | 196 | |
Philip Tricca | b0927df | 2016-06-21 06:28:44 -0700 | [diff] [blame] | 197 | test_tpmclient_tpmclient_CFLAGS = $(TPMCLIENT_INC) $(AM_CFLAGS) |
Philip Tricca | 00074b7 | 2017-05-10 13:14:53 -0700 | [diff] [blame] | 198 | test_tpmclient_tpmclient_CXXFLAGS = $(TPMCLIENT_INC) $(TCTICOMMON_INC) $(TCTIDEVICE_INC) $(AM_CXXFLAGS) -DNO_RM_TESTS |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 199 | test_tpmclient_tpmclient_LDADD = $(libsapi) $(libtcti_socket) $(libtcti_device) |
Philip Tricca | a51ca97 | 2015-11-04 00:13:42 -0500 | [diff] [blame] | 200 | test_tpmclient_tpmclient_SOURCES = $(TPMCLIENT_CXX) $(COMMON_C) $(SAMPLE_C) |
Philip Tricca | 38de202 | 2015-09-07 11:46:28 -0700 | [diff] [blame] | 201 | |
Philip Tricca | b77704e | 2016-12-02 11:26:59 -0800 | [diff] [blame] | 202 | test_integration_libtest_utils_la_SOURCES = test/integration/test-options.c \ |
| 203 | test/integration/context-util.c |
| 204 | |
hp | 7ae176b | 2016-12-02 11:16:45 -0800 | [diff] [blame] | 205 | test_integration_get_random_LDADD = $(TESTS_LDADD) |
| 206 | test_integration_get_random_SOURCES = test/integration/get-random.c \ |
| 207 | test/integration/main.c |
| 208 | |
hp | 1b9ccfa | 2016-12-03 00:05:07 +0800 | [diff] [blame^] | 209 | test_integration_self_test_LDADD = $(TESTS_LDADD) |
| 210 | test_integration_self_test_SOURCES = test/integration/self-test.c \ |
| 211 | test/integration/main.c |
| 212 | |
Philip Tricca | b77704e | 2016-12-02 11:26:59 -0800 | [diff] [blame] | 213 | TESTS_LDADD = $(noinst_LTLIBRARIES) $(lib_LTLIBRARIES) |
| 214 | |
Philip Tricca | 7ae0154 | 2016-05-05 18:45:03 -0700 | [diff] [blame] | 215 | %.pc : %.pc.in |
Philip Tricca | 632c431 | 2017-06-05 11:58:08 -0700 | [diff] [blame] | 216 | $(call make_parent_dir,$@) |
Philip Tricca | 7ae0154 | 2016-05-05 18:45:03 -0700 | [diff] [blame] | 217 | sed -e "s,[@]VERSION[@],$(PACKAGE_VERSION),g; \ |
| 218 | s,[@]includedir[@],$(includedir),g;" $^ > $@ |
| 219 | |
Philip Tricca | fe67168 | 2017-06-04 19:14:31 -0700 | [diff] [blame] | 220 | man/man3/%.3 : man/%.3.in $(srcdir)/man/man-postlude.troff |
| 221 | $(call make_man,$@,$<,$(srcdir)/man/man-postlude.troff) |
| 222 | |
Philip Tricca | 632c431 | 2017-06-05 11:58:08 -0700 | [diff] [blame] | 223 | man/man7/%.7 : man/%.7.in $(srcdir)/man/man-postlude.troff |
Philip Tricca | fe67168 | 2017-06-04 19:14:31 -0700 | [diff] [blame] | 224 | $(call make_man,$@,$<,$(srcdir)/man/man-postlude.troff) |
Philip Tricca | 632c431 | 2017-06-05 11:58:08 -0700 | [diff] [blame] | 225 | |
Philip Tricca | b1a6406 | 2016-04-05 15:26:47 -0700 | [diff] [blame] | 226 | LIBRARY_LDFLAGS = -fPIC -Wl,--no-undefined |
Philip Tricca | 125bb32 | 2016-03-31 16:11:51 -0700 | [diff] [blame] | 227 | |
Philip Tricca | 334b675 | 2016-12-04 20:36:59 -0800 | [diff] [blame] | 228 | # simulator build / run scripts |
| 229 | CLEANFILES += test/simulator-build.sh test/simulator-run.sh test/simulator.inc |
| 230 | .PHONY = simulator-build simulator-start simulator-stop clean-local-ibmtpm |
| 231 | clean-local : clean-local-ibmtpm |
| 232 | clean-local-ibmtpm : |
| 233 | rm -rf test/ibmtpm* |
| 234 | |
| 235 | test/simulator.inc : $(srcdir)/script/simulator.inc |
| 236 | cp $< $@ |
| 237 | test/simulator-build.sh : $(srcdir)/script/simulator-build.sh |
| 238 | cp $< $@ |
| 239 | chmod 755 $@ |
| 240 | simulator-build : test/simulator-build.sh test/simulator.inc |
| 241 | test/simulator-build.sh |
| 242 | test/simulator-run.sh : $(srcdir)/script/simulator-run.sh |
| 243 | cp $< $@ |
| 244 | chmod 755 $@ |
| 245 | simulator-start : test/simulator-run.sh test/simulator.inc |
| 246 | test/simulator-run.sh start |
| 247 | simulator-stop : test/simulator-run.sh test/simulator.inc |
| 248 | test/simulator-run.sh stop |
| 249 | |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 250 | # simple variables |
Philip Tricca | 785e88d | 2016-02-13 12:02:44 -0800 | [diff] [blame] | 251 | TCTICOMMON_INC = -I$(srcdir)/include -I$(srcdir)/common \ |
| 252 | -I$(srcdir)/sysapi/include |
| 253 | TCTICOMMON_C = tcti/commonchecks.c |
Will-nuc | 8d4f967 | 2015-11-25 16:48:20 -0500 | [diff] [blame] | 254 | |
Philip Tricca | 785e88d | 2016-02-13 12:02:44 -0800 | [diff] [blame] | 255 | TCTIDEVICE_INC = $(TCTICOMMON_INC) |
| 256 | TCTIDEVICE_C = tcti/tcti_device.c |
Will-nuc | f2ea1f1 | 2015-11-25 16:29:57 -0500 | [diff] [blame] | 257 | |
Philip Tricca | 785e88d | 2016-02-13 12:02:44 -0800 | [diff] [blame] | 258 | TCTISOCKET_INC = $(TCTICOMMON_INC) |
| 259 | TCTISOCKET_C = tcti/platformcommand.c |
| 260 | TCTISOCKET_CXX = tcti/tcti_socket.cpp |
Philip Tricca | 97e869f | 2015-11-03 20:19:44 -0500 | [diff] [blame] | 261 | |
Gang Wei | 5f0d4e4 | 2016-08-17 12:11:22 +0800 | [diff] [blame] | 262 | TPMCLIENT_INC = -I$(srcdir)/include -I$(srcdir)/common \ |
| 263 | -I$(srcdir)/test/tpmclient -I$(srcdir)/sysapi/include \ |
Philip Tricca | 7966ef8 | 2017-05-10 09:32:36 -0700 | [diff] [blame] | 264 | -I$(srcdir)/test/common/sample |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 265 | TPMCLIENT_CXX = test/tpmclient/tpmclient.cpp |
Philip Tricca | e690e08 | 2015-09-07 18:17:35 -0700 | [diff] [blame] | 266 | |
Philip Tricca | d69337a | 2016-05-26 16:16:01 -0700 | [diff] [blame] | 267 | libsapi = sysapi/libsapi.la |
Philip Tricca | 826f590 | 2016-05-26 16:44:31 -0700 | [diff] [blame] | 268 | libtcti_device = tcti/libtcti-device.la |
| 269 | libtcti_socket = tcti/libtcti-socket.la |
Philip Tricca | 2bd4adb | 2015-09-25 00:14:16 -0700 | [diff] [blame] | 270 | tpmclient = test/tpmclient/tpmclient |
Philip Tricca | 632c431 | 2017-06-05 11:58:08 -0700 | [diff] [blame] | 271 | |
| 272 | define make_parent_dir |
| 273 | if [ ! -d $(dir $1) ]; then mkdir -p $(dir $1); fi |
| 274 | endef |
Philip Tricca | fe67168 | 2017-06-04 19:14:31 -0700 | [diff] [blame] | 275 | # function to transform man .in files to man pages |
| 276 | # $1: target |
| 277 | # $2: .in file |
| 278 | # $3: man postlude file |
| 279 | define make_man |
| 280 | $(call make_parent_dir,$1) |
| 281 | cat $2 $3 > $1 |
| 282 | sed -i -e "s,[@]VERSION[@],$(PACKAGE_VERSION),g;" $1 |
| 283 | endef |