gpt4 book ai didi

linux - makefile 错误 *** 缺少分隔符。停止

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:04:51 26 4
gpt4 key购买 nike

谁能指出生成文件问题的根本原因和修复方法?在 Suse 12 SP2 x64 上构建时出现此错误:

tony@linux-31cz:~/sandbox> gmake -f gnumake.sys
gnumake.sys:18: *** missing separator. Stop.
tony@linux-31cz:~/sandbox>

我有这个 make 版本:

tony@linux-31cz:~/sandbox> make --version
GNU Make 4.0
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

下面是 gnumake.sys,其中 [TAB] 是一个制表符。

#-----------------------------------------------------------------------#
# Common definitions, can be overridden in Platform specific part
#-----------------------------------------------------------------------#
CC = cc
CCPP = CC
LIB = ar rv
CP = cp
RM = rm -f
MV = mv -f
TOUCH = touch
NEEDMOVE =
CPP_NEED_C_SUFFIX =
GREP_SEARCH = "^\# .* .*\.[ch]"
AWK_COLUMN = $$3
AWK_COLUMN_CPP = $$3
WD := $(shell pwd)

%if %env (BUILD_PRODUCT_VERSION, 712)
[TAB]export BUILDFLAGVER = -DBUILD_PRODUCT_V712
[TAB]export TSMVERSIONTXT =7.1.2.0
[TAB]%if %env (VERSION_BASED_OUTPUT,1)
[TABTAB]export TSMVERSION=$(BUILD_PRODUCT_VERSION)
[TAB]%endif
%elseif %env (BUILD_PRODUCT_VERSION, 812)
[TAB]export BUILDFLAGVER = -DBUILD_PRODUCT_V713
[TAB]export TSMVERSIONTXT =7.1.3.0
[TAB]%if %env (VERSION_BASED_OUTPUT,1)
[TABTAB]export TSMVERSION=$(BUILD_PRODUCT_VERSION)
[TAB]%endif
%endif

最佳答案

在给定的示例中使用了错误的语法。正确的语法是这样的:

#-----------------------------------------------------------------------#
# Common definitions, can be overridden in Platform specific part
#-----------------------------------------------------------------------#
CC = cc
CCPP = CC
LIB = ar rv
CP = cp
RM = rm -f
MV = mv -f
TOUCH = touch
NEEDMOVE =
CPP_NEED_C_SUFFIX =
GREP_SEARCH = "^\# .* .*\.[ch]"
AWK_COLUMN = $$3
AWK_COLUMN_CPP = $$3
WD := $(shell pwd)

ifeq ($(BUILD_PRODUCT_VERSION), 712)
export BUILDFLAGVER = -DBUILD_PRODUCT_V712
export TSMVERSIONTXT = 7.1.2.0
ifeq ($(VERSION_BASED_OUTPUT), 1)
export TSMVERSION=$(BUILD_PRODUCT_VERSION)
endif
else ifeq ($(BUILD_PRODUCT_VERSION), 812)
export BUILDFLAGVER = -DBUILD_PRODUCT_V713
export TSMVERSIONTXT = 7.1.3.0
ifeq ($(VERSION_BASED_OUTPUT), 1)
export TSMVERSION=$(BUILD_PRODUCT_VERSION)
endif
endif

您可以在此处找到详细说明:http://www.gnu.org/software/make/manual/make.html

关于linux - makefile 错误 *** 缺少分隔符。停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49066888/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com