白笔留墨 2024-07-02 14:08 采纳率: 0%
浏览 0

c (标签-bug|关键词-file)

为什么运行会出现C:\Users\Administrator\Desktop\tcm2-simulator-master\tcm2-simulator\tpm2-sim-src\src>make -f makefile.mak debug
makefile.mak:98: *** multiple target patterns. Stop.

#################################################################################
#                                       #
#       Windows MinGW TPM2 Makefile OpenSSL 1.1.1 32-bit          #
#                Written by Ken Goldman                #
#           IBM Thomas J. Watson Research Center            #
#         $Id: makefile.mak 1540 2019-12-04 22:33:10Z kgoldman $        #
#                                       #
# (c) Copyright IBM Corporation 2014 - 2019                   #
#                                       #
# All rights reserved.                               #
#                                       #
# Redistribution and use in source and binary forms, with or without    #
# modification, are permitted provided that the following conditions are    #
# met:                                       #
#                                       #
# Redistributions of source code must retain the above copyright notice,    #
# this list of conditions and the following disclaimer.             #
#                                       #
# Redistributions in binary form must reproduce the above copyright    #
# notice, this list of conditions and the following disclaimer in the    #
# documentation and/or other materials provided with the distribution.    #
#                                       #
# Neither the names of the IBM Corporation nor the names of its            #
# contributors may be used to endorse or promote products derived from    #
# this software without specific prior written permission.            #
#                                       #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS    #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT    #
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    #
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT    #
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,    #
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT    #
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,    #
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY    #
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT    #
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE    #
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.    #
#                                       #
#################################################################################

# Windows OpenSSL 1.1.1 32-bit with mingw

# Please contribute a solution for OpenSSL 64-bit (Shining Light),
# which does not include the mingw .a files.

# For this to work, copy the file .../openssl/bin/libcrypto-1.1.dll to
# libcrypto.dll.  Please contribute a solution that does not require
# this step.

CC = "C:/Program Files/mingw64/bin/gcc.exe"

CCFLAGS = -Wall \
          -Wnested-externs -ggdb -O0 -c \
          -DTPM_WINDOWS \
          -D__USE_MINGW_ANSI_STDIO \
          -DRADIX_BITS=64 \
          -I"c:/program files/mingw64/include" \
          -I"C:/Program Files/OpenSSL/include" \
          -I.

LNFLAGS = -D_MT \
          -DTPM_WINDOWS \
          -DRADIX_BITS=64 \
          -I. \
          -ggdb \
          -L.

# Shining Light OpenSSL 1.1 32-bit

LNLIBS = -L"E:/evi" -lcrypto  -lws2_32

all: tpm_server.exe

CRYPTO_SUBSYSTEM = openssl
include makefile-common

OBJFILES = ACTCommands.o ACT_spt.o AlgorithmCap.o AlgorithmTests.o AsymmetricCommands.o Attest_spt.o \
           AttestationCommands.o AuditCommands.o Bits.o BnConvert.o BnMath.o BnMemory.o Cancel.o \
           CapabilityCommands.o Clock.o ClockCommands.o CommandAudit.o CommandCodeAttributes.o \
           CommandDispatcher.o ContextCommands.o Context_spt.o CryptDes.o CryptCmac.o CryptEccData.o \
           CryptEccKeyExchange.o CryptEccMain.o CryptEccSignature.o CryptHash.o CryptPrime.o \
           CryptPrimeSieve.o CryptRand.o CryptRsa.o CryptSelfTest.o CryptSmac.o CryptSym.o CryptUtil.o \
           DA.o DebugHelpers.o DictionaryCommands.o DuplicationCommands.o EACommands.o EncryptDecrypt_spt.o \
           Entity.o Entropy.o EphemeralCommands.o ExecCommand.o Global.o Handle.o HashCommands.o Hierarchy.o \
           HierarchyCommands.o IoBuffers.o IntegrityCommands.o Locality.o LocalityPlat.o ManagementCommands.o \
           Manufacture.o Marshal.o MathOnByteBuffers.o Memory.o NVCommands.o NVDynamic.o NVMem.o NVReserved.o \
           NV_spt.o Object.o ObjectCommands.o Object_spt.o PCR.o PP.o PPPlat.o PlatformACT.o PlatformData.o \
           Policy_spt.o Power.o PowerPlat.o PrimeData.o PropertyCap.o RandomCommands.o Response.o \
           ResponseCodeProcessing.o RsaKeyCache.o RunCommand.o Session.o SessionCommands.o SessionProcess.o \
           SigningCommands.o StartupCommands.o SymmetricCommands.o TPMCmdp.o TPMCmds.o TestingCommands.o \
           Ticket.o Time.o TpmAsn1.o TpmFail.o TpmSizeChecks.o TpmToOsslDesSupport.o TpmToOsslMath.o \
           TpmToOsslSupport.o Unique.o Unmarshal.o Vendor_TCG_Test.o X509_ECC.o X509_RSA.o X509_spt.o ntc2lib.o \
           ntc2.o TcpServer.o

.PHONY: clean debug

tpm_server.exe: $(OBJFILES) applink.o
    $(CC) $(LNFLAGS) $(OBJFILES) -o $@ applink.o $(LNLIBS)

debug:
    @echo "OBJFILES=$(OBJFILES)"
    @echo "LNLIBS=$(LNLIBS)"

clean:
    rm -f *.o *.exe

怎么排除修正

  • 写回答

1条回答 默认 最新

  • 阿里嘎多学长 2024-07-02 14:22
    关注

    以下内容由CHATGPT及阿里嘎多学长共同生成、有用望采纳:


    这个错误信息 "makefile.mak:98: *** multiple target patterns. Stop." 表示在 makefile.mak 文件的第98行,存在语法错误,通常是因为存在多个目标模式。在Makefile中,每个规则应该只有一个目标,后面跟着一系列依赖项。如果一行中出现了多个目标,就会引发这个错误。

    根据你提供的 makefile.mak 文件内容,错误可能出在以下这一行:

    tpm_server.exe: $(OBJFILES) applink.o
        $(CC) $(LNFLAGS) $(OBJFILES) -o $@ applink.o $(LNLIBS)
    

    这里看起来 tpm_server.exe 是目标,而 $(OBJFILES) applink.o 是依赖项。但是,如果 $(OBJFILES) 变量中包含了空格(例如,如果某个对象文件名中有空格),这可能会导致Makefile解释错误,认为有多个目标。

    解决方案

    1. 检查对象文件名:确保 OBJFILES 变量中的对象文件名没有包含空格。如果有,你可能需要修改文件名,或者在Makefile中使用引号将它们包围起来。

    2. 使用引号:如果 OBJFILES 变量中的文件名确实包含空格,你可以在依赖项列表中使用引号来包围整个列表,如下所示:

      tpm_server.exe: "$(OBJFILES)" applink.o
          $(CC) $(LNFLAGS) "$(OBJFILES)" -o $@ applink.o $(LNLIBS)
      
    3. 检查 OBJFILES 变量:如果 OBJFILES 变量是通过某种方式动态生成的,确保生成过程中没有引入空格或其他特殊字符。

    4. 检查 makefile-common 包含:由于 makefile.mak 中包含了 makefile-common,可能存在一些冲突或错误。检查 makefile-common 文件,确保它没有引入任何不兼容的规则或变量。

    5. 使用调试模式:你可以使用 make --debug=v7 命令来运行Makefile,这将提供详细的调试信息,帮助你找到问题所在。

    6. 清理和重新编译:有时候,清理旧的编译文件然后重新编译可以解决问题。你可以使用 make clean 命令来清理,然后重新编译。

    如果上述方法都不能解决问题,你可能需要检查 makefile.mak 文件的其他部分,或者提供更多的上下文信息,以便进一步分析问题。

    至于参考链接,由于你的问题比较具体,可能需要直接查看Makefile的官方文档或相关社区论坛来获取更详细的帮助。这里没有特定的参考链接,但是你可以搜索 "Makefile multiple target patterns error" 来找到相关的讨论和解决方案。

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 7月2日

悬赏问题

  • ¥30 STM32 INMP441无法读取数据
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境