1
0

Fixed linux compilation in regard to SQLite dependency on libdl

For some reason newer G++ linker requires libraries to come after object files, yuck!

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1371 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-04-07 21:15:10 +00:00
parent f10386bad5
commit ee1e0d0eff

View File

@ -33,15 +33,19 @@ all: MCServer/MCServer
# CC_OPTIONS ... options for the C code compiler
# CXX_OPTIONS ... options for the C++ code compiler
# LNK_OPTIONS ... options for the linker
# LNK_LIBS ... libraries to link in
# -- according to http://stackoverflow.com/questions/6183899/undefined-reference-to-dlopen, libs must come after all sources
# BUILDDIR ... folder where the intermediate object files are built
LNK_LIBS = -lstdc++ -ldl
ifeq ($(release),1)
################
# release build - fastest run-time, no gdb support
################
CC_OPTIONS = -s -g -O3 -DNDEBUG
CXX_OPTIONS = -s -g -O3 -DNDEBUG
LNK_OPTIONS = -lstdc++ -ldl -pthread -O3
LNK_OPTIONS = -pthread -O3
BUILDDIR = build/release/
else
@ -51,7 +55,7 @@ ifeq ($(profile),1)
################
CC_OPTIONS = -s -g -ggdb -O3 -pg -DNDEBUG
CXX_OPTIONS = -s -g -ggdb -O3 -pg -DNDEBUG
LNK_OPTIONS = -lstdc++ -ldl -pthread -ggdb -O3 -pg
LNK_OPTIONS = -pthread -ggdb -O3 -pg
BUILDDIR = build/profile/
else
@ -61,7 +65,7 @@ ifeq ($(pedantic),1)
################
CC_OPTIONS = -s -g -ggdb -D_DEBUG -Wall -Wextra -pedantic -ansi -Wno-long-long
CXX_OPTIONS = -s -g -ggdb -D_DEBUG -Wall -Wextra -pedantic -ansi -Wno-long-long
LNK_OPTIONS = -lstdc++ -ldl -pthread -ggdb
LNK_OPTIONS = -pthread -ggdb
BUILDDIR = build/pedantic/
else
@ -71,7 +75,7 @@ else
################
CC_OPTIONS = -s -ggdb -g -D_DEBUG -O3
CXX_OPTIONS = -s -ggdb -g -D_DEBUG
LNK_OPTIONS = -lstdc++ -ldl -pthread -g -ggdb
LNK_OPTIONS = -pthread -g -ggdb
BUILDDIR = build/debug/
endif
endif
@ -123,7 +127,7 @@ OBJECTS := $(patsubst %.cpp,$(BUILDDIR)%.o,$(OBJECTS))
-include $(patsubst %.o,%.d,$(OBJECTS))
MCServer/MCServer : $(OBJECTS)
$(CC) $(LNK_OPTIONS) $(OBJECTS) -o MCServer/MCServer
$(CC) $(LNK_OPTIONS) $(OBJECTS) $(LNK_LIBS) -o MCServer/MCServer
clean :
rm -rf $(BUILDDIR) MCServer/MCServer