]> git.proxmox.com Git - libtpms.git/blobdiff - src/Makefile.am
Move common debug, memory & nvfile units to src/
[libtpms.git] / src / Makefile.am
index 8671d71ad2005d9be37130e6640abecd41ce1c9d..fc1066369173b8244221f55ba8f9e04b52b7ddd7 100644 (file)
@@ -4,17 +4,23 @@
 # For the license, see the LICENSE file in the root directory.
 #
 
+AM_CFLAGS = @AM_CFLAGS@
+AM_LDFLAGS = @AM_LDFLAGS@ $(HARDENING_LDFLAGS) $(SANITIZERS) $(FUZZER) 
+
 lib_LTLIBRARIES=libtpms.la
 
 common_CFLAGS = -include tpm_library_conf.h \
                 -I$(top_srcdir)/include/libtpms \
                -I$(top_builddir)/include/libtpms \
+               $(AM_CFLAGS) \
                 $(HARDENING_CFLAGS) \
                $(SANITIZERS) \
                $(FUZZER)
 
-
-LDFLAGS += $(HARDENING_LDFLAGS) $(SANITIZERS) $(FUZZER)
+# build with libtpms callback support
+common_CFLAGS += -DTPM_LIBTPMS_CALLBACKS
+# let the default NVRAM write to disk
+common_CFLAGS += -DTPM_NV_DISK
 
 #
 # TPM1.2
@@ -38,10 +44,6 @@ libtpms_tpm12_la_CFLAGS += -DTPM_VOLATILE_LOAD
 libtpms_tpm12_la_CFLAGS += -DTPM_ENABLE_ACTIVATE
 # build with AES support for symmetric crypto
 libtpms_tpm12_la_CFLAGS += -DTPM_AES
-# build with libtpms callback support
-libtpms_tpm12_la_CFLAGS += -DTPM_LIBTPMS_CALLBACKS
-# let the default NVRAM write to disk
-libtpms_tpm12_la_CFLAGS += -DTPM_NV_DISK
 # build a POSIX type of TPM
 libtpms_tpm12_la_CFLAGS += -DTPM_POSIX
 # build without maintenance commands
@@ -58,7 +60,6 @@ libtpms_tpm12_la_SOURCES = \
        tpm12/tpm_cryptoh.c \
        tpm12/tpm_counter.c \
        tpm12/tpm_daa.c \
-       tpm12/tpm_debug.c \
        tpm12/tpm_delegate.c \
        tpm12/tpm_digest.c \
        tpm12/tpm_error.c \
@@ -69,11 +70,10 @@ libtpms_tpm12_la_SOURCES = \
        tpm12/tpm_key.c \
        tpm12/tpm_load.c \
        tpm12/tpm_maint.c \
-       tpm12/tpm_memory.c \
        tpm12/tpm_migration.c \
        tpm12/tpm_nonce.c \
-       tpm12/tpm_nvfile.c \
        tpm12/tpm_nvram.c \
+       tpm12/tpm_openssl_helpers.c \
        tpm12/tpm_owner.c \
        tpm12/tpm_pcr.c \
        tpm12/tpm_permanent.c \
@@ -103,7 +103,7 @@ noinst_HEADERS = \
        tpm12/tpm_crypto.h \
        tpm12/tpm_cryptoh.h \
        tpm12/tpm_daa.h \
-       tpm12/tpm_debug.h \
+       tpm_debug.h \
        tpm12/tpm_delegate.h \
        tpm12/tpm_digest.h \
        tpm12/tpm_global.h \
@@ -117,9 +117,10 @@ noinst_HEADERS = \
        tpm12/tpm_maint.h \
        tpm12/tpm_migration.h \
        tpm12/tpm_nonce.h \
-       tpm12/tpm_nvfile.h \
+       tpm_nvfile.h \
        tpm12/tpm_nvram_const.h \
        tpm12/tpm_nvram.h \
+       tpm12/tpm_openssl_helpers.h \
        tpm12/tpm_owner.h \
        tpm12/tpm_pcr.h \
        tpm12/tpm_permanent.h \
@@ -178,10 +179,10 @@ libtpms_tpm2_la_CFLAGS = $(common_CFLAGS)
 
 libtpms_tpm2_la_CFLAGS += -D_POSIX_
 libtpms_tpm2_la_CFLAGS += -DTPM_POSIX
-# build with libtpms callback support
-libtpms_tpm2_la_CFLAGS += -DTPM_LIBTPMS_CALLBACKS
 
 libtpms_tpm2_la_SOURCES = \
+       tpm2/ACT_spt.c \
+       tpm2/ACTCommands.c \
        tpm2/AlgorithmCap.c \
        tpm2/AlgorithmTests.c \
        tpm2/AsymmetricCommands.c \
@@ -205,6 +206,7 @@ libtpms_tpm2_la_SOURCES = \
        tpm2/CryptSelfTest.c \
        tpm2/CryptUtil.c \
        tpm2/DA.c \
+       tpm2/DebugHelpers.c \
        tpm2/DictionaryCommands.c \
        tpm2/DuplicationCommands.c \
        tpm2/EACommands.c \
@@ -236,6 +238,7 @@ libtpms_tpm2_la_SOURCES = \
        tpm2/ObjectCommands.c \
        tpm2/Object_spt.c \
        tpm2/PCR.c \
+       tpm2/PlatformACT.c \
        tpm2/PlatformData.c \
        tpm2/Policy_spt.c \
        tpm2/Power.c \
@@ -257,15 +260,20 @@ libtpms_tpm2_la_SOURCES = \
        tpm2/TestingCommands.c \
        tpm2/Ticket.c \
        tpm2/Time.c \
+       tpm2/TpmAsn1.c \
        tpm2/TpmSizeChecks.c \
        tpm2/TPMCmdp.c \
        tpm2/TpmFail.c \
        tpm2/Unique.c \
        tpm2/Unmarshal.c \
        tpm2/Vendor_TCG_Test.c \
+       tpm2/X509_ECC.c \
+       tpm2/X509_RSA.c \
+       tpm2/X509_spt.c \
        tpm_tpm2_interface.c \
        tpm_tpm2_tis.c \
        \
+       tpm2/BackwardsCompatibilityObject.c \
        tpm2/LibtpmsCallbacks.c \
        tpm2/NVMarshal.c \
        tpm2/StateMarshal.c \
@@ -276,6 +284,7 @@ noinst_HEADERS += \
        tpm2/crypto/CryptCmac_fp.h \
        tpm2/crypto/CryptDes_fp.h \
        tpm2/crypto/CryptEcc.h \
+       tpm2/crypto/CryptEccCrypt_fp.h \
        tpm2/crypto/CryptEccKeyExchange_fp.h \
        tpm2/crypto/CryptEccMain_fp.h \
        tpm2/crypto/CryptEccSignature_fp.h \
@@ -293,6 +302,9 @@ noinst_HEADERS += \
        tpm2/crypto/CryptSym_fp.h \
        tpm2/crypto/CryptTest.h \
        tpm2/crypto/CryptUtil_fp.h \
+       tpm2/ACT.h \
+       tpm2/ACT_spt_fp.h \
+       tpm2/ACT_SetTimeout_fp.h \
        tpm2/ActivateCredential_fp.h \
        tpm2/AlgorithmCap_fp.h \
        tpm2/AlgorithmTests_fp.h \
@@ -301,6 +313,7 @@ noinst_HEADERS += \
        tpm2/Bits_fp.h \
        tpm2/Capabilities.h \
        tpm2/CertifyCreation_fp.h \
+       tpm2/CertifyX509_fp.h \
        tpm2/Certify_fp.h \
        tpm2/ChangeEPS_fp.h \
        tpm2/ChangePPS_fp.h \
@@ -324,6 +337,7 @@ noinst_HEADERS += \
        tpm2/CreatePrimary_fp.h \
        tpm2/CryptSelfTest_fp.h \
        tpm2/DA_fp.h \
+       tpm2/DebugHelpers_fp.h \
        tpm2/DictionaryAttackLockReset_fp.h \
        tpm2/DictionaryAttackParameters_fp.h \
        tpm2/Duplicate_fp.h \
@@ -391,7 +405,7 @@ noinst_HEADERS += \
        tpm2/NV_UndefineSpaceSpecial_fp.h \
        tpm2/NV_Write_fp.h \
        tpm2/NV_WriteLock_fp.h \
-       tpm2/OIDS.h \
+       tpm2/OIDs.h \
        tpm2/ObjectChangeAuth_fp.h \
        tpm2/Object_fp.h \
        tpm2/Object_spt_fp.h \
@@ -404,6 +418,9 @@ noinst_HEADERS += \
        tpm2/PCR_SetAuthPolicy_fp.h \
        tpm2/PCR_SetAuthValue_fp.h \
        tpm2/Platform.h \
+       tpm2/PlatformACT.h \
+       tpm2/PlatformACT_fp.h \
+       tpm2/PlatformClock.h \
        tpm2/PlatformData.h \
        tpm2/Platform_fp.h \
        tpm2/PolicyAuthorize_fp.h \
@@ -467,6 +484,8 @@ noinst_HEADERS += \
        tpm2/Time_fp.h \
        tpm2/TPMB.h \
        tpm2/TpmAlgorithmDefines.h \
+       tpm2/TpmAsn1.h \
+       tpm2/TpmAsn1_fp.h \
        tpm2/TpmBuildSwitches.h \
        tpm2/TpmError.h \
        tpm2/TpmFail_fp.h \
@@ -484,8 +503,14 @@ noinst_HEADERS += \
        tpm2/VendorString.h \
        tpm2/Vendor_TCG_Test_fp.h \
        tpm2/VerifySignature_fp.h \
+       tpm2/X509.h \
+       tpm2/X509_ECC_fp.h \
+       tpm2/X509_RSA_fp.h \
+       tpm2/X509_spt_fp.h \
        tpm2/ZGen_2Phase_fp.h \
        \
+       tpm2/BackwardsCompatibility.h \
+       tpm2/BackwardsCompatibilityObject.h \
        tpm2/LibtpmsCallbacks.h \
        tpm2/NVMarshal.h \
        tpm2/StateMarshal.h \
@@ -501,23 +526,25 @@ libtpms_tpm2_la_SOURCES += \
        tpm2/crypto/openssl/CryptEccMain.c \
        tpm2/crypto/openssl/CryptEccSignature.c \
        tpm2/crypto/openssl/CryptHash.c \
-       tpm2/crypto/openssl/CryptHashData.c \
        tpm2/crypto/openssl/CryptPrime.c \
        tpm2/crypto/openssl/CryptPrimeSieve.c \
        tpm2/crypto/openssl/CryptRand.c \
        tpm2/crypto/openssl/CryptRsa.c \
        tpm2/crypto/openssl/CryptSmac.c \
        tpm2/crypto/openssl/CryptSym.c \
+       tpm2/crypto/openssl/ExpDCache.c \
        tpm2/crypto/openssl/Helpers.c \
        tpm2/crypto/openssl/TpmToOsslDesSupport.c \
        tpm2/crypto/openssl/TpmToOsslMath.c \
        tpm2/crypto/openssl/TpmToOsslSupport.c
 
 noinst_HEADERS += \
+       tpm2/crypto/openssl/ConsttimeUtils.h \
        tpm2/crypto/openssl/BnConvert_fp.h \
        tpm2/crypto/openssl/BnMath_fp.h \
        tpm2/crypto/openssl/BnMemory_fp.h \
        tpm2/crypto/openssl/BnValues.h \
+       tpm2/crypto/openssl/ExpDCache_fp.h \
        tpm2/crypto/openssl/Helpers_fp.h \
        tpm2/crypto/openssl/LibSupport.h \
        tpm2/crypto/openssl/TpmToOsslDesSupport_fp.h \
@@ -541,21 +568,24 @@ endif # WITH_TPM2
 #
 
 libtpms_la_SOURCES = \
-       tpm_library.c
+       tpm_debug.c \
+       tpm_library.c \
+       tpm_memory.c \
+       tpm_nvfile.c
 
 libtpms_la_CFLAGS = $(common_CFLAGS)
 
 libtpms_la_LDFLAGS = -version-info $(LIBTPMS_VERSION_INFO) \
-                     -no-undefined
+                     -no-undefined $(AM_LDFLAGS)
 
 if HAVE_VERSION_SCRIPT
 libtpms_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtpms.syms
 endif
 
-LDFLAGS_ARCH  = $(findstring -m32, $(CFLAGS))
-LDFLAGS_ARCH += $(findstring -m64, $(CFLAGS))
-LDFLAGS_ARCH += $(findstring -m32, $(LDFLAGS))
-LDFLAGS_ARCH += $(findstring -m64, $(LDFLAGS))
+LDFLAGS_ARCH  = $(findstring -m32, $(AM_CFLAGS))
+LDFLAGS_ARCH += $(findstring -m64, $(AM_CFLAGS))
+LDFLAGS_ARCH += $(findstring -m32, $(AM_LDFLAGS))
+LDFLAGS_ARCH += $(findstring -m64, $(AM_LDFLAGS))
 
 check-local: SHELL?="/usr/bin/env bash"
 check-local: