Makefile.am 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. # SPDX-License-Identifier: BSD-3-Clause
  2. # ax_code_coverage
  3. if AUTOCONF_CODE_COVERAGE_2019_01_06
  4. include $(top_srcdir)/aminclude_static.am
  5. clean-local: code-coverage-clean
  6. distclean-local: code-coverage-dist-clean
  7. else
  8. @CODE_COVERAGE_RULES@
  9. endif
  10. include src_vars.mk
  11. ACLOCAL_AMFLAGS = -I m4 --install
  12. INCLUDE_DIRS = -I$(top_srcdir)/tools -I$(top_srcdir)/lib
  13. LIB_COMMON := lib/libcommon.a
  14. AM_CFLAGS := \
  15. $(INCLUDE_DIRS) $(EXTRA_CFLAGS) $(TSS2_ESYS_CFLAGS) $(TSS2_MU_CFLAGS) \
  16. $(CRYPTO_CFLAGS) $(CODE_COVERAGE_CFLAGS) $(TSS2_TCTILDR_CFLAGS) \
  17. $(TSS2_RC_CFLAGS) $(TSS2_SYS_CFLAGS) $(UUID_CFLAGS)
  18. AM_LDFLAGS := $(EXTRA_LDFLAGS) $(CODE_COVERAGE_LIBS)
  19. LDADD = \
  20. $(LIB_COMMON) $(TSS2_ESYS_LIBS) $(TSS2_MU_LIBS) $(CRYPTO_LIBS) $(TSS2_TCTILDR_LIBS) \
  21. $(TSS2_RC_LIBS) $(TSS2_SYS_LIBS) $(UUID_LIBS) $(EFIVAR_LIBS)
  22. AM_DISTCHECK_CONFIGURE_FLAGS = --with-bashcompdir='$$(datarootdir)/bash-completion/completions'
  23. # keep me sorted
  24. bin_PROGRAMS =
  25. FAPI_CFLAGS = $(EXTRA_CFLAGS) $(TSS2_FAPI_CFLAGS) $(CODE_COVERAGE_CFLAGS)
  26. TESTS =
  27. if HAVE_FAPI
  28. bin_PROGRAMS += tools/fapi/tss2
  29. endif
  30. noinst_LIBRARIES = $(LIB_COMMON)
  31. lib_libcommon_a_SOURCES = $(LIB_SRC)
  32. lib_libcommon_a_CFLAGS = -fPIC $(AM_CFLAGS)
  33. tools_fapi_tss2_CFLAGS = $(FAPI_CFLAGS) -DTSS2_TOOLS_MAX="$(words $(tss2_tools))"
  34. tools_fapi_tss2_LDFLAGS = $(EXTRA_LDFLAGS) $(TSS2_FAPI_LIBS)
  35. tools_fapi_tss2_SOURCES = \
  36. tools/fapi/tss2_template.c \
  37. tools/fapi/tss2_template.h \
  38. $(tss2_tools)
  39. tss2_tools = \
  40. tools/fapi/tss2_decrypt.c \
  41. tools/fapi/tss2_encrypt.c \
  42. tools/fapi/tss2_list.c \
  43. tools/fapi/tss2_changeauth.c \
  44. tools/fapi/tss2_delete.c \
  45. tools/fapi/tss2_import.c \
  46. tools/fapi/tss2_getinfo.c \
  47. tools/fapi/tss2_createkey.c \
  48. tools/fapi/tss2_createseal.c \
  49. tools/fapi/tss2_exportkey.c \
  50. tools/fapi/tss2_getcertificate.c \
  51. tools/fapi/tss2_getplatformcertificates.c \
  52. tools/fapi/tss2_gettpmblobs.c \
  53. tools/fapi/tss2_getappdata.c \
  54. tools/fapi/tss2_setappdata.c \
  55. tools/fapi/tss2_setcertificate.c \
  56. tools/fapi/tss2_sign.c \
  57. tools/fapi/tss2_verifysignature.c \
  58. tools/fapi/tss2_verifyquote.c \
  59. tools/fapi/tss2_createnv.c \
  60. tools/fapi/tss2_nvextend.c \
  61. tools/fapi/tss2_nvincrement.c \
  62. tools/fapi/tss2_nvread.c \
  63. tools/fapi/tss2_nvsetbits.c \
  64. tools/fapi/tss2_nvwrite.c \
  65. tools/fapi/tss2_getdescription.c \
  66. tools/fapi/tss2_setdescription.c \
  67. tools/fapi/tss2_pcrextend.c \
  68. tools/fapi/tss2_quote.c \
  69. tools/fapi/tss2_pcrread.c \
  70. tools/fapi/tss2_authorizepolicy.c \
  71. tools/fapi/tss2_exportpolicy.c \
  72. tools/fapi/tss2_import.c \
  73. tools/fapi/tss2_provision.c \
  74. tools/fapi/tss2_getrandom.c \
  75. tools/fapi/tss2_unseal.c \
  76. tools/fapi/tss2_writeauthorizenv.c
  77. # Bundle all the tools into a single program similar to busybox
  78. bin_PROGRAMS += tools/tpm2
  79. tools_tpm2_LDADD = $(LDADD) $(CURL_LIBS)
  80. tools_tpm2_CFLAGS = $(AM_CFLAGS) -DTPM2_TOOLS_MAX="$(words $(tpm2_tools))"
  81. tools_tpm2_SOURCES = \
  82. tools/tpm2_tool.c \
  83. tools/tpm2_tool.h \
  84. $(tpm2_tools)
  85. tpm2_tools = \
  86. tools/misc/tpm2_certifyX509certutil.c \
  87. tools/misc/tpm2_checkquote.c \
  88. tools/misc/tpm2_eventlog.c \
  89. tools/misc/tpm2_print.c \
  90. tools/misc/tpm2_rc_decode.c \
  91. tools/tpm2_activatecredential.c \
  92. tools/tpm2_certify.c \
  93. tools/tpm2_changeauth.c \
  94. tools/tpm2_changeeps.c \
  95. tools/tpm2_changepps.c \
  96. tools/tpm2_clear.c \
  97. tools/tpm2_clearcontrol.c \
  98. tools/tpm2_clockrateadjust.c \
  99. tools/tpm2_create.c \
  100. tools/tpm2_createak.c \
  101. tools/tpm2_createek.c \
  102. tools/tpm2_createpolicy.c \
  103. tools/tpm2_setprimarypolicy.c \
  104. tools/tpm2_createprimary.c \
  105. tools/tpm2_dictionarylockout.c \
  106. tools/tpm2_duplicate.c \
  107. tools/tpm2_getcap.c \
  108. tools/tpm2_gettestresult.c \
  109. tools/tpm2_encryptdecrypt.c \
  110. tools/tpm2_evictcontrol.c \
  111. tools/tpm2_flushcontext.c \
  112. tools/tpm2_getekcertificate.c \
  113. tools/tpm2_getrandom.c \
  114. tools/tpm2_gettime.c \
  115. tools/tpm2_hash.c \
  116. tools/tpm2_hierarchycontrol.c \
  117. tools/tpm2_hmac.c \
  118. tools/tpm2_import.c \
  119. tools/tpm2_incrementalselftest.c \
  120. tools/tpm2_load.c \
  121. tools/tpm2_loadexternal.c \
  122. tools/tpm2_makecredential.c \
  123. tools/tpm2_nvdefine.c \
  124. tools/tpm2_nvextend.c \
  125. tools/tpm2_nvincrement.c \
  126. tools/tpm2_nvreadpublic.c \
  127. tools/tpm2_nvread.c \
  128. tools/tpm2_nvreadlock.c \
  129. tools/tpm2_nvundefine.c \
  130. tools/tpm2_nvwrite.c \
  131. tools/tpm2_nvwritelock.c \
  132. tools/tpm2_nvsetbits.c \
  133. tools/tpm2_pcrallocate.c \
  134. tools/tpm2_pcrevent.c \
  135. tools/tpm2_pcrextend.c \
  136. tools/tpm2_pcrread.c \
  137. tools/tpm2_pcrreset.c \
  138. tools/tpm2_policypcr.c \
  139. tools/tpm2_policyauthorize.c \
  140. tools/tpm2_policyauthorizenv.c \
  141. tools/tpm2_policynv.c \
  142. tools/tpm2_policycountertimer.c \
  143. tools/tpm2_policyor.c \
  144. tools/tpm2_policynamehash.c \
  145. tools/tpm2_policytemplate.c \
  146. tools/tpm2_policycphash.c \
  147. tools/tpm2_policypassword.c \
  148. tools/tpm2_policysigned.c \
  149. tools/tpm2_policyticket.c \
  150. tools/tpm2_policyauthvalue.c \
  151. tools/tpm2_policysecret.c \
  152. tools/tpm2_policyrestart.c \
  153. tools/tpm2_policycommandcode.c \
  154. tools/tpm2_policynvwritten.c \
  155. tools/tpm2_policyduplicationselect.c \
  156. tools/tpm2_policylocality.c \
  157. tools/tpm2_quote.c \
  158. tools/tpm2_readclock.c \
  159. tools/tpm2_readpublic.c \
  160. tools/tpm2_rsadecrypt.c \
  161. tools/tpm2_rsaencrypt.c \
  162. tools/tpm2_send.c \
  163. tools/tpm2_selftest.c \
  164. tools/tpm2_setclock.c \
  165. tools/tpm2_shutdown.c \
  166. tools/tpm2_sign.c \
  167. tools/tpm2_certifycreation.c \
  168. tools/tpm2_nvcertify.c \
  169. tools/tpm2_startauthsession.c \
  170. tools/tpm2_startup.c \
  171. tools/tpm2_stirrandom.c \
  172. tools/tpm2_testparms.c \
  173. tools/tpm2_unseal.c \
  174. tools/tpm2_verifysignature.c \
  175. tools/tpm2_setcommandauditstatus.c \
  176. tools/tpm2_getcommandauditdigest.c \
  177. tools/tpm2_getsessionauditdigest.c \
  178. tools/tpm2_geteccparameters.c \
  179. tools/tpm2_ecephemeral.c \
  180. tools/tpm2_commit.c \
  181. tools/tpm2_ecdhkeygen.c \
  182. tools/tpm2_ecdhzgen.c \
  183. tools/tpm2_zgen2phase.c \
  184. tools/tpm2_sessionconfig.c \
  185. tools/tpm2_getpolicydigest.c
  186. # Create the symlinks for each tool to the tpm2 and optional tss2 bundled executables
  187. install-exec-hook:
  188. for tool in $(notdir $(basename $(tpm2_tools))) ; do \
  189. $(LN_S) -f \
  190. "tpm2$(EXEEXT)" \
  191. "$(DESTDIR)$(bindir)/$$tool$(EXEEXT)" ; \
  192. done
  193. if HAVE_FAPI
  194. for tool in $(notdir $(basename $(tss2_tools))) ; do \
  195. $(LN_S) -f \
  196. "tss2$(EXEEXT)" \
  197. "$(DESTDIR)$(bindir)/$$tool$(EXEEXT)" ; \
  198. done
  199. endif
  200. if UNIT
  201. TESTS += $(check_PROGRAMS)
  202. check_PROGRAMS = \
  203. test/unit/test_string_bytes \
  204. test/unit/test_files \
  205. test/unit/test_tpm2_header \
  206. test/unit/test_tpm2_attr_util \
  207. test/unit/test_tpm2_alg_util \
  208. test/unit/test_pcr \
  209. test/unit/test_tpm2_auth_util \
  210. test/unit/test_tpm2_errata \
  211. test/unit/test_tpm2_session \
  212. test/unit/test_tpm2_policy \
  213. test/unit/test_tpm2_util \
  214. test/unit/test_options \
  215. test/unit/test_cc_util \
  216. test/unit/test_tpm2_eventlog \
  217. test/unit/test_tpm2_eventlog_yaml
  218. TESTS += $(ALL_SYSTEM_TESTS)
  219. if HAVE_FAPI
  220. TESTS += $(ALL_FAPI_TESTS)
  221. endif
  222. test_unit_test_string_bytes_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  223. test_unit_test_string_bytes_LDADD = $(CMOCKA_LIBS) $(LDADD)
  224. test_unit_test_files_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  225. test_unit_test_files_LDADD = $(CMOCKA_LIBS) $(LDADD)
  226. test_unit_test_tpm2_header_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  227. test_unit_test_tpm2_header_LDADD = $(CMOCKA_LIBS) $(LDADD)
  228. test_unit_test_tpm2_attr_util_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  229. test_unit_test_tpm2_attr_util_LDADD = $(CMOCKA_LIBS) $(LDADD)
  230. test_unit_test_tpm2_alg_util_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  231. test_unit_test_tpm2_alg_util_LDADD = $(CMOCKA_LIBS) $(LDADD)
  232. test_unit_test_pcr_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  233. test_unit_test_pcr_LDADD = $(CMOCKA_LIBS) $(LDADD)
  234. test_unit_test_tpm2_auth_util_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  235. test_unit_test_tpm2_auth_util_LDFLAGS = -Wl,--wrap=Esys_TR_SetAuth \
  236. -Wl,--wrap=Esys_StartAuthSession \
  237. -Wl,--wrap=fopen \
  238. -Wl,--wrap=fread \
  239. -Wl,--wrap=fseek \
  240. -Wl,--wrap=ftell \
  241. -Wl,--wrap=feof, \
  242. -Wl,--wrap=fclose
  243. test_unit_test_tpm2_auth_util_LDADD = $(CMOCKA_LIBS) $(LDADD)
  244. test_unit_test_tpm2_errata_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  245. test_unit_test_tpm2_errata_LDFLAGS = -Wl,--wrap=Esys_GetCapability
  246. test_unit_test_tpm2_errata_LDADD = $(CMOCKA_LIBS) $(LDADD)
  247. test_unit_test_tpm2_session_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  248. test_unit_test_tpm2_session_LDFLAGS = -Wl,--wrap=Esys_StartAuthSession \
  249. -Wl,--wrap=tpm2_context_save \
  250. -Wl,--wrap=Esys_ContextLoad \
  251. -Wl,--wrap=Esys_PolicyRestart \
  252. -Wl,--wrap=Esys_TR_GetName \
  253. -Wl,--wrap=tpm2_flush_context
  254. test_unit_test_tpm2_session_LDADD = $(CMOCKA_LIBS) $(LDADD)
  255. test_unit_test_tpm2_policy_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  256. test_unit_test_tpm2_policy_LDFLAGS = -Wl,--wrap=Esys_StartAuthSession \
  257. -Wl,--wrap=Esys_PolicyPCR \
  258. -Wl,--wrap=Esys_PCR_Read \
  259. -Wl,--wrap=Esys_PolicyGetDigest \
  260. -Wl,--wrap=Esys_FlushContext
  261. test_unit_test_tpm2_policy_LDADD = $(CMOCKA_LIBS) $(LDADD)
  262. test_unit_test_tpm2_util_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  263. test_unit_test_tpm2_util_LDADD = $(CMOCKA_LIBS) $(LDADD)
  264. test_unit_test_options_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  265. test_unit_test_options_LDFLAGS = -Wl,--wrap=Tss2_TctiLdr_Initialize \
  266. -Wl,--wrap=tpm2_util_getenv
  267. test_unit_test_options_LDADD = $(CMOCKA_LIBS) $(LDADD)
  268. test_unit_test_cc_util_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  269. test_unit_test_cc_util_LDADD = $(CMOCKA_LIBS) $(LDADD)
  270. test_unit_test_tpm2_eventlog_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  271. test_unit_test_tpm2_eventlog_LDADD = $(CMOCKA_LIBS) $(LDADD)
  272. test_unit_test_tpm2_eventlog_yaml_CFLAGS = $(AM_CFLAGS) $(CMOCKA_CFLAGS)
  273. test_unit_test_tpm2_eventlog_yaml_LDADD = $(CMOCKA_LIBS) $(LDADD)
  274. AM_TESTS_ENVIRONMENT = \
  275. export TPM2_ABRMD=$(TPM2_ABRMD); \
  276. export TPM2_SIM=$(TPM2_SIM); \
  277. export PATH=$(abs_builddir)/tools:$(abs_builddir)/tools/misc:$(abs_top_srcdir)/test/integration:$(abs_builddir)/tools/fapi:$(PATH); \
  278. export TPM2_TOOLS_TEST_FIXTURES=$(abs_top_srcdir)/test/integration/fixtures; \
  279. export abs_builddir=$(abs_builddir); \
  280. export abs_srcdir=$(abs_srcdir); \
  281. export PYTHON=$(PYTHON); \
  282. export TPM2_TOOLS_TEST_FIXTURES;
  283. if PERSISTENT
  284. AM_TESTS_ENVIRONMENT += \
  285. TPM2TOOLS_TEST_PERSISTENT=true;
  286. else
  287. AM_TESTS_ENVIRONMENT += \
  288. TPM2TOOLS_TEST_PERSISTENT=false;
  289. endif
  290. SH_LOG_COMPILER = dbus-run-session bash
  291. AM_SH_LOG_FLAGS = --
  292. endif
  293. TEST_EXTENSIONS = .sh
  294. check-hook:
  295. rm -rf .lock_file
  296. EXTRA_DIST_IGNORE = \
  297. .gitignore \
  298. .deps
  299. EXTRA_DIST = \
  300. bootstrap \
  301. doc/AUTHORS.md \
  302. doc/CHANGELOG.md \
  303. doc/CONTRIBUTING.md \
  304. doc/INSTALL.md \
  305. doc/LICENSE \
  306. doc/MAINTAINERS.md \
  307. README.md \
  308. doc/RELEASE.md \
  309. man \
  310. scripts \
  311. test
  312. if HAVE_MAN_PAGES
  313. dist_man1_MANS := \
  314. man/man1/tpm2_activatecredential.1 \
  315. man/man1/tpm2_certify.1 \
  316. man/man1/tpm2_certifyX509certutil.1 \
  317. man/man1/tpm2_changeauth.1 \
  318. man/man1/tpm2_changeeps.1 \
  319. man/man1/tpm2_changepps.1 \
  320. man/man1/tpm2_checkquote.1 \
  321. man/man1/tpm2_clear.1 \
  322. man/man1/tpm2_clearcontrol.1 \
  323. man/man1/tpm2_clockrateadjust.1 \
  324. man/man1/tpm2_create.1 \
  325. man/man1/tpm2_createak.1 \
  326. man/man1/tpm2_createek.1 \
  327. man/man1/tpm2_createpolicy.1 \
  328. man/man1/tpm2_setprimarypolicy.1 \
  329. man/man1/tpm2_createprimary.1 \
  330. man/man1/tpm2_dictionarylockout.1 \
  331. man/man1/tpm2_duplicate.1 \
  332. man/man1/tpm2_getcap.1 \
  333. man/man1/tpm2_encryptdecrypt.1 \
  334. man/man1/tpm2_eventlog.1 \
  335. man/man1/tpm2_evictcontrol.1 \
  336. man/man1/tpm2_flushcontext.1 \
  337. man/man1/tpm2_getekcertificate.1 \
  338. man/man1/tpm2_getrandom.1 \
  339. man/man1/tpm2_gettestresult.1 \
  340. man/man1/tpm2_gettime.1 \
  341. man/man1/tpm2_hierarchycontrol.1 \
  342. man/man1/tpm2_hash.1 \
  343. man/man1/tpm2_hmac.1 \
  344. man/man1/tpm2_import.1 \
  345. man/man1/tpm2_incrementalselftest.1 \
  346. man/man1/tpm2_load.1 \
  347. man/man1/tpm2_loadexternal.1 \
  348. man/man1/tpm2_makecredential.1 \
  349. man/man1/tpm2_nvdefine.1 \
  350. man/man1/tpm2_nvextend.1 \
  351. man/man1/tpm2_nvincrement.1 \
  352. man/man1/tpm2_nvreadpublic.1 \
  353. man/man1/tpm2_nvread.1 \
  354. man/man1/tpm2_nvreadlock.1 \
  355. man/man1/tpm2_nvundefine.1 \
  356. man/man1/tpm2_nvwrite.1 \
  357. man/man1/tpm2_nvwritelock.1 \
  358. man/man1/tpm2_nvsetbits.1 \
  359. man/man1/tpm2_pcrallocate.1 \
  360. man/man1/tpm2_pcrevent.1 \
  361. man/man1/tpm2_pcrextend.1 \
  362. man/man1/tpm2_pcrread.1 \
  363. man/man1/tpm2_pcrreset.1 \
  364. man/man1/tpm2_policypcr.1 \
  365. man/man1/tpm2_policyrestart.1 \
  366. man/man1/tpm2_policycommandcode.1 \
  367. man/man1/tpm2_policynvwritten.1 \
  368. man/man1/tpm2_policyduplicationselect.1 \
  369. man/man1/tpm2_policylocality.1 \
  370. man/man1/tpm2_policyauthorize.1 \
  371. man/man1/tpm2_policyauthorizenv.1 \
  372. man/man1/tpm2_policynv.1 \
  373. man/man1/tpm2_policycountertimer.1 \
  374. man/man1/tpm2_policyor.1 \
  375. man/man1/tpm2_policynamehash.1 \
  376. man/man1/tpm2_policytemplate.1 \
  377. man/man1/tpm2_policycphash.1 \
  378. man/man1/tpm2_policypassword.1 \
  379. man/man1/tpm2_policysigned.1 \
  380. man/man1/tpm2_policyticket.1 \
  381. man/man1/tpm2_policyauthvalue.1 \
  382. man/man1/tpm2_policysecret.1 \
  383. man/man1/tpm2_print.1 \
  384. man/man1/tpm2_quote.1 \
  385. man/man1/tpm2_rc_decode.1 \
  386. man/man1/tpm2_readclock.1 \
  387. man/man1/tpm2_readpublic.1 \
  388. man/man1/tpm2_rsadecrypt.1 \
  389. man/man1/tpm2_rsaencrypt.1 \
  390. man/man1/tpm2_send.1 \
  391. man/man1/tpm2_selftest.1 \
  392. man/man1/tpm2_setclock.1 \
  393. man/man1/tpm2_shutdown.1 \
  394. man/man1/tpm2_sign.1 \
  395. man/man1/tpm2_certifycreation.1 \
  396. man/man1/tpm2_nvcertify.1 \
  397. man/man1/tpm2_startauthsession.1 \
  398. man/man1/tpm2_startup.1 \
  399. man/man1/tpm2_stirrandom.1 \
  400. man/man1/tpm2_testparms.1 \
  401. man/man1/tpm2_unseal.1 \
  402. man/man1/tpm2_verifysignature.1 \
  403. man/man1/tpm2_setcommandauditstatus.1 \
  404. man/man1/tpm2_getcommandauditdigest.1 \
  405. man/man1/tpm2_getsessionauditdigest.1 \
  406. man/man1/tpm2_geteccparameters.1 \
  407. man/man1/tpm2_ecephemeral.1 \
  408. man/man1/tpm2_commit.1 \
  409. man/man1/tpm2_ecdhkeygen.1 \
  410. man/man1/tpm2_ecdhzgen.1 \
  411. man/man1/tpm2_zgen2phase.1 \
  412. man/man1/tpm2_sessionconfig.1 \
  413. man/man1/tpm2_getpolicydigest.1 \
  414. man/man1/tpm2.1
  415. if HAVE_FAPI
  416. dist_man1_MANS += \
  417. man/man1/tss2_list.1 \
  418. man/man1/tss2_changeauth.1 \
  419. man/man1/tss2_delete.1 \
  420. man/man1/tss2_import.1 \
  421. man/man1/tss2_decrypt.1 \
  422. man/man1/tss2_encrypt.1 \
  423. man/man1/tss2_getinfo.1 \
  424. man/man1/tss2_createnv.1 \
  425. man/man1/tss2_nvread.1 \
  426. man/man1/tss2_nvextend.1 \
  427. man/man1/tss2_nvincrement.1 \
  428. man/man1/tss2_nvsetbits.1 \
  429. man/man1/tss2_nvwrite.1 \
  430. man/man1/tss2_createkey.1 \
  431. man/man1/tss2_createseal.1 \
  432. man/man1/tss2_getcertificate.1 \
  433. man/man1/tss2_getplatformcertificates.1 \
  434. man/man1/tss2_gettpmblobs.1 \
  435. man/man1/tss2_getappdata.1 \
  436. man/man1/tss2_setappdata.1 \
  437. man/man1/tss2_setcertificate.1 \
  438. man/man1/tss2_exportkey.1 \
  439. man/man1/tss2_sign.1 \
  440. man/man1/tss2_verifysignature.1 \
  441. man/man1/tss2_verifyquote.1 \
  442. man/man1/tss2_getdescription.1 \
  443. man/man1/tss2_setdescription.1 \
  444. man/man1/tss2_pcrextend.1 \
  445. man/man1/tss2_quote.1 \
  446. man/man1/tss2_pcrread.1 \
  447. man/man1/tss2_provision.1 \
  448. man/man1/tss2_authorizepolicy.1 \
  449. man/man1/tss2_exportpolicy.1 \
  450. man/man1/tss2_unseal.1 \
  451. man/man1/tss2_import.1 \
  452. man/man1/tss2_getrandom.1 \
  453. man/man1/tss2_writeauthorizenv.1
  454. endif
  455. endif
  456. MARKDOWN_COMMON_DEPS = \
  457. man/common/alg.md \
  458. man/common/authorizations.md \
  459. man/common/ctxobj.md \
  460. man/common/footer.md \
  461. man/common/hash.md \
  462. man/common/obj-attrs.md \
  463. man/common/object-alg.md \
  464. man/common/options.md \
  465. man/common/policy-limitations.md \
  466. man/common/pubkey.md \
  467. man/common/returns.md \
  468. man/common/signature.md \
  469. man/common/signschemes.md \
  470. man/common/tcti.md
  471. man/man1/%.1 : man/%.1.md $(MARKDOWN_COMMON_DEPS)
  472. $(AM_V_GEN)rm -f $@ && \
  473. mkdir -p man/man1 && \
  474. sed -e '/\[common options\]/r $(top_srcdir)/man/common/options.md' \
  475. -e '/\[common options\]/d' \
  476. -e '/\[common tcti options\]/r $(top_srcdir)/man/common/tcti.md' \
  477. -e '/\[common tcti options\]/d' \
  478. -e '/\[common tss2 options\]/r $(top_srcdir)/man/common/tss2-options.md' \
  479. -e '/\[common tss2 options\]/d' \
  480. -e '/\[common fapi references\]/r $(top_srcdir)/man/common/tss2-fapi-references.md' \
  481. -e '/\[common fapi references\]/d' \
  482. -e '/\[authorization formatting\]/r $(top_srcdir)/man/common/authorizations.md' \
  483. -e '/\[authorization formatting\]/d' \
  484. -e '/\[context object format\]/r $(top_srcdir)/man/common/ctxobj.md' \
  485. -e '/\[context object format\]/d' \
  486. -e '/\[supported hash algorithms\]/r $(top_srcdir)/man/common/hash.md' \
  487. -e '/\[supported hash algorithms\]/d' \
  488. -e '/\[algorithm specifiers\]/r $(top_srcdir)/man/common/alg.md' \
  489. -e '/\[algorithm specifiers\]/d' \
  490. -e '/\[supported public object algorithms\]/r $(top_srcdir)/man/common/object-alg.md' \
  491. -e '/\[supported public object algorithms\]/d' \
  492. -e '/\[supported signing algorithms\]/r $(top_srcdir)/man/common/sign-alg.md' \
  493. -e '/\[supported signing algorithms\]/d' \
  494. -e '/\[nv attributes\]/r $(top_srcdir)/man/common/nv-attrs.md' \
  495. -e '/\[nv attributes\]/d' \
  496. -e '/\[pcr bank specifiers\]/r $(top_srcdir)/man/common/pcr.md' \
  497. -e '/\[pcr bank specifiers\]/d' \
  498. -e '/\[pubkey options\]/r $(top_srcdir)/man/common/pubkey.md' \
  499. -e '/\[pubkey options\]/d' \
  500. -e '/\[signature format specifiers\]/r $(top_srcdir)/man/common/signature.md' \
  501. -e '/\[signature format specifiers\]/d' \
  502. -e '/\[object attribute specifiers\]/r $(top_srcdir)/man/common/obj-attrs.md' \
  503. -e '/\[object attribute specifiers\]/d' \
  504. -e '/\[supported signing schemes\]/r $(top_srcdir)/man/common/signschemes.md' \
  505. -e '/\[supported signing schemes\]/d' \
  506. -e '/\[limitations\]/r $(top_srcdir)/man/common/policy-limitations.md' \
  507. -e '/\[limitations\]/d' \
  508. -e '/\[returns\]/r $(top_srcdir)/man/common/returns.md' \
  509. -e '/\[returns\]/d' \
  510. -e '/\[footer\]/r $(top_srcdir)/man/common/footer.md' \
  511. -e '/\[footer\]/d' \
  512. -e '/\[protection details\]/r $(top_srcdir)/man/common/protection-details.md' \
  513. -e '/\[protection details\]/d' \
  514. < $< | pandoc -s -t man > $@
  515. CLEANFILES = $(dist_man1_MANS)
  516. bashcompdir=@bashcompdir@
  517. dist_bashcomp_DATA=dist/bash-completion/tpm2-tools/tpm2_completion.bash
  518. if HAVE_FAPI
  519. dist_bashcomp_DATA+= \
  520. dist/bash-completion/tpm2-tools/tss2_decrypt \
  521. dist/bash-completion/tpm2-tools/tss2_encrypt \
  522. dist/bash-completion/tpm2-tools/tss2_list \
  523. dist/bash-completion/tpm2-tools/tss2_changeauth \
  524. dist/bash-completion/tpm2-tools/tss2_delete \
  525. dist/bash-completion/tpm2-tools/tss2_import \
  526. dist/bash-completion/tpm2-tools/tss2_getinfo \
  527. dist/bash-completion/tpm2-tools/tss2_createkey \
  528. dist/bash-completion/tpm2-tools/tss2_createseal \
  529. dist/bash-completion/tpm2-tools/tss2_exportkey \
  530. dist/bash-completion/tpm2-tools/tss2_getcertificate \
  531. dist/bash-completion/tpm2-tools/tss2_getplatformcertificates \
  532. dist/bash-completion/tpm2-tools/tss2_gettpmblobs \
  533. dist/bash-completion/tpm2-tools/tss2_setcertificate \
  534. dist/bash-completion/tpm2-tools/tss2_getappdata \
  535. dist/bash-completion/tpm2-tools/tss2_setappdata \
  536. dist/bash-completion/tpm2-tools/tss2_sign \
  537. dist/bash-completion/tpm2-tools/tss2_verifysignature \
  538. dist/bash-completion/tpm2-tools/tss2_verifyquote \
  539. dist/bash-completion/tpm2-tools/tss2_createnv \
  540. dist/bash-completion/tpm2-tools/tss2_nvextend \
  541. dist/bash-completion/tpm2-tools/tss2_nvincrement \
  542. dist/bash-completion/tpm2-tools/tss2_nvread \
  543. dist/bash-completion/tpm2-tools/tss2_nvsetbits \
  544. dist/bash-completion/tpm2-tools/tss2_nvwrite \
  545. dist/bash-completion/tpm2-tools/tss2_getdescription \
  546. dist/bash-completion/tpm2-tools/tss2_setdescription \
  547. dist/bash-completion/tpm2-tools/tss2_pcrextend \
  548. dist/bash-completion/tpm2-tools/tss2_quote \
  549. dist/bash-completion/tpm2-tools/tss2_pcrread \
  550. dist/bash-completion/tpm2-tools/tss2_authorizepolicy \
  551. dist/bash-completion/tpm2-tools/tss2_exportpolicy \
  552. dist/bash-completion/tpm2-tools/tss2_provision \
  553. dist/bash-completion/tpm2-tools/tss2_getrandom \
  554. dist/bash-completion/tpm2-tools/tss2_unseal \
  555. dist/bash-completion/tpm2-tools/tss2_writeauthorizenv \
  556. dist/bash-completion/tpm2-tools/tss2
  557. endif
  558. install-data-hook:
  559. cd $(DESTDIR)$(bashcompdir) && \
  560. for tool in $(bin_PROGRAMS); do \
  561. [ "$${tool}" = "$${tool#tools/fapi/*}" ] && $(LN_S) -f tpm2_completion.bash $${tool##*/}; \
  562. done
  563. uninstall-hook:
  564. cd $(DESTDIR)$(bashcompdir) && \
  565. for tool in $(bin_PROGRAMS); do \
  566. [ "$${tool}" = "$${tool#tools/fapi/*}" -a -L $${tool##*/} ] && rm -f $${tool##*/}; \
  567. done
  568. dist-hook:
  569. for f in $(EXTRA_DIST_IGNORE); do \
  570. rm -rf `find $(distdir) -name $$f`; \
  571. done;
  572. if !HAVE_PANDOC
  573. # If pandoc is not enabled, we want to complain that you need pandoc for make dist,
  574. # so hook the target and complain.
  575. @(>&2 echo "You do not have pandoc, a requirement for the distribution of manpages")
  576. @exit 1
  577. endif