一尘不染

make文件中的错误:***缺少分隔符。停止

linux

我在CentOS 6.02
64位中的make文件中遇到错误。我需要知道应该怎么做才能使makefile可行。任何建议将大有帮助。我的make文件粘贴在下面:-

#



.SUFFIXES: .cc $(.SUFFIXES)



ALL = libpal.a



#all = $(ALL)

all: $(ALL)



.cpp.o:

            $(C++) -o $@ -c $(PROF) $(CFLAGS) $*.cpp

.cc.o:

            $(C++) -o $@ -c $(PROF) $(CFLAGS) $*.cc

.c.o:

            $(CC) -o $@ -c $(PROF) $(CFLAGS) $*.c



top_srcdir = ..

OPENSSL_LIB_DIR = ../../ThirdPartyLibs/openssl-0.9.8e/include
BOOST_DIR = ../../ThirdPartyLibs/boost/stage/lib

BOOST_INCLUDE_DIR = ../../ThirdPartyLibs/boost





CC = gcc

C++ = g++

CCOPT = -Os -Wall -Wno-deprecated

CCOPT_DEBUG = -Wall -g -Wno-deprecated

PROF =



STATIC = -static





INCLUDE = \
 -I./usr/include/sys

 -I./Headers \

 -I$(top_srcdir)/PAL/Headers \

 -I$(top_srcdir)/BaseMulti/Headers \

 -I$(top_srcdir)/NetworkMulti/Headers \

 -I$(top_srcdir)/RTP/Headers \

 -I$(BOOST_INCLUDE_DIR) \

 -I$(OPENSSL_LIB_DIR) \



LIBDIRS = \

    -L$(BOOST_DIR) \





#XXX NLAYER define / MB_DEBUG

DEFINE =  -D_LINUX -DDEBUGLOG -D_INDENT_DB_PRINT -fsigned-char -fno-inline -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PER_PROCESS_TIMER_SOURCE -D_PTHREADS -DUNICODE #-DDISABLE_LOG



SHLIB_SUFFIX   = .so

SHLIB_LD       = gcc -shared

SHLIB_LD_LIBS  =

SHLIB_CFLAGS   = -fPIC



BFLAGS = $(DEFINE) $(INCLUDE)

CFLAGS = $(CCOPT) $(BFLAGS)



OBJ_C =



OBJ_CC = \

    ./Sources/PALsystime.o \

    ./Sources/PALdebug.o \

    ./Sources/PALdebuglog.o \

    ./Sources/PALthread.o \

    ./Sources/PALcritsec.o \

    ./Sources/PALprofiler.o \

    ./Sources/PALserializable.o \

    ./Sources/PALinet.o \

    ./Sources/PALnetwork.o \

    ./Sources/PALsocket.o \

    ./Sources/PALlocalhostUdpEvent.o \

    ./Sources/PALpollarray.o \

    ./Sources/PALrandom.o \



OBJS = $(OBJ_C) $(OBJ_CC)



SRCS = $(OBJ_C:.o=.c) $(OBJ_CC:.o=.cc)



debug: DEFINE += -DDEBUG

debug: BFLAGS = $(DEFINE) $(INCLUDE)

debug: CFLAGS = $(CCOPT_DEBUG) $(BFLAGS)

debug: $(OBJS)

    ar crsu libpal_debug.a $(OBJS)



libpal.a: $(OBJS)

    ar crsu libpal.a $(OBJS)



cleandeps:

    $(RM) ./Sources/*.o .depend* core



clean: cleandeps

    $(RM) ./libpal.a ./libpal_debug.a

    $(RM) $(ALL)

结果错误是:

Makefile:34: *** missing separator.  Stop.

阅读 458

收藏
2020-06-07

共1个答案

一尘不染

您可以在Make产生的附录B错误中找到此错误的说明。

配方中的每一行必须以制表符开头。从文件顶部开始$(C++)$(CC)附近的配方似乎都不以制表符开头。

此外,本节

INCLUDE = \
    -I./usr/include/sys
    -I./Headers \

sys同一节(以及更多节)具有多余的空行之后,似乎缺少了一个反斜杠。

2020-06-07