I am facing errors in make file in CentOS 6.02 64 bit. I need to know what should be done to make the makefile workable. Any suggestion will be greatly helpful. My make file is pasted below: -
# .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)
And the resultant error is:
Makefile:34: *** missing separator. Stop.
Means that the makefile contains spaces instead of Tab's. The make utility is notoriously picky about the use of Space instead of Tab . So it's likely that the makefile contains Space at the beginning of rule stanzas within the file.
Makefile is a tool to simplify or to organize code for compilation. Makefile is a set of commands (similar to terminal commands) with variable names and targets to create object file and to remove them. In a single make file we can create multiple targets to compile and to remove object, binary files.
Recipies in a makefile must be preceeded by a single standard tab character, nothing else. ^I is the representation of the tab character (see the table on the Wikipedia ASCII page), and therefore this should be correct. So you should be able to enter it using Tab or Ctrl + I .
You can find an explanation of this error in Appendix B Errors Generated by Make.
Every line in a recipe must begin with a tab character. The recipes starting with $(C++)
and $(CC)
near the top of your file do not seem to start with a tab character.
Additionally, the section
INCLUDE = \ -I./usr/include/sys -I./Headers \
seems to be missing a backslash after sys
and that same section (and many more) have superfluous empty lines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With