diff options
author | worktycho <work.tycho@gmail.com> | 2013-12-09 18:51:12 +0100 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2013-12-09 18:51:12 +0100 |
commit | 843605d59ebc128be0a578dc6f45ef8c05da6e79 (patch) | |
tree | 3ffebc6ba27baf7a9e1d4bc51501ffeea9b14226 /GNUmakefile | |
parent | merged makefile changes (diff) | |
parent | Fix Undefined behavior at Bindings/LuaWindow line 32 (diff) | |
download | cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.gz cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.bz2 cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.lz cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.xz cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.tar.zst cuberite-843605d59ebc128be0a578dc6f45ef8c05da6e79.zip |
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 90 |
1 files changed, 35 insertions, 55 deletions
diff --git a/GNUmakefile b/GNUmakefile index 00778a8f5..c8cdd35e1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -46,9 +46,11 @@ ifeq ($(release),1) ################ # release build - fastest run-time, no gdb support ################ -CC_OPTIONS = -s -g -O3 -DNDEBUG -CXX_OPTIONS = -s -g -O3 -DNDEBUG + +CC_OPTIONS = -O3 -DNDEBUG -DLUA_USE_DLOPEN +CXX_OPTIONS = -O3 -DNDEBUG -DLUA_USE_DLOPEN LNK_OPTIONS = -pthread -O3 + BUILDDIR = build/release/ else @@ -56,42 +58,39 @@ ifeq ($(profile),1) ################ # profile build - a release build with symbols and profiling engine built in ################ -CC_OPTIONS = -s -g -ggdb -O3 -pg -DNDEBUG -CXX_OPTIONS = -s -g -ggdb -O3 -pg -DNDEBUG + +CC_OPTIONS = -g -ggdb -O3 -pg -DNDEBUG -DLUA_USE_DLOPEN +CXX_OPTIONS = -g -ggdb -O3 -pg -DNDEBUG -DLUA_USE_DLOPEN LNK_OPTIONS = -pthread -ggdb -O3 -pg -BUILDDIR = build/profile/ -else -ifeq ($(pedantic),1) -################ -# pedantic build - basically a debug build with lots of warnings -################ -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 = -pthread -ggdb -BUILDDIR = build/pedantic/ +BUILDDIR = build/profile/ else ################ # debug build - fully traceable by gdb in C++ code, slowest -# Since C code is used only for supporting libraries (zlib, lua), it is still O3-optimized +# Since C code is used only for supporting libraries (zlib, lua), it is still Ofast-optimized ################ -CC_OPTIONS = -s -ggdb -g -D_DEBUG -O3 -CXX_OPTIONS = -s -ggdb -g -D_DEBUG -LNK_OPTIONS = -pthread -g -ggdb + +CC_OPTIONS = -ggdb -g -D_DEBUG -O3 -DLUA_USE_DLOPEN +CXX_OPTIONS = -ggdb -g -D_DEBUG -O1 -DLUA_USE_DLOPEN +LNK_OPTIONS = -pthread -g -ggdb -O1 + BUILDDIR = build/debug/ -endif + endif endif +################################################## +# Always be warning. + +CXX_OPTIONS += -Wall ################################################### # Fix Crypto++ warnings in clang -ifeq ($(shell $(CXX) --version 2>&1 | grep -i -c "clang version"),0) -CC_OPTIONS += -Wno-tautological-compare -CXX_OPTIONS += -Wno-tautological-compare -disableasm = 1 +ifeq ($(shell $(CXX) --version 2>&1 | grep -i -c "clang version"),1) +CC_OPTIONS += -DCRYPTOPP_DISABLE_ASM +CXX_OPTIONS += -DCRYPTOPP_DISABLE_ASM endif @@ -103,7 +102,7 @@ endif UNAME := $(shell uname -s) ifeq ($(UNAME),Linux) - LNK_LIBS = -lstdc++ -ldl + LNK_LIBS = -lstdc++ -ldl -lm else LNK_LIBS = -lstdc++ -lltdl endif @@ -113,49 +112,33 @@ endif ################################################### -# 32-bit build override in 64-bit build environments - -ifeq ($(addm32),1) -CC_OPTIONS += -m32 -CXX_OPTIONS += -m32 -LNK_OPTIONS += -m32 -endif - +# Export all symbols from the executable, so that LuaRocks may bind to Lua routines: +LNK_OPTIONS += -rdynamic ################################################### -# Clang doesn't seem to support CryptoPP's assembly mode, disable it for now (CryptoPP 5.6.2) +# 32-bit build override in 64-bit build environments -ifeq ($(disableasm),1) - CC_OPTIONS += -DCRYPTOPP_DISABLE_ASM - CXX_OPTIONS += -DCRYPTOPP_DISABLE_ASM +ifeq ($(addm32),1) +CC_OPTIONS += -m32 +CXX_OPTIONS += -m32 +LNK_OPTIONS += -m32 endif + ################################################### # INCLUDE directories for MCServer -# -INCLUDE = -I.\ - -Isource\ - -Isource/md5\ - -IWebServer\ - -Isource/items\ - -Isource/blocks\ - -Itolua++-1.0.93/src/lib\ - -Ilua-5.1.4/src\ - -Izlib-1.2.7\ - -IiniFile\ - -Itolua++-1.0.93/include\ - -Ijsoncpp-src-0.5.0/include\ - -Ijsoncpp-src-0.5.0/src/lib_json\ - -Iexpat +INCLUDE = -Isrc\ + -Ilib\ + -Ilib/jsoncpp/include @@ -163,11 +146,8 @@ INCLUDE = -I.\ ################################################### # Build MCServer -# - -# 2012_11_08 _X: Removed: squirrel_3_0_1_stable -SOURCES := $(shell find CryptoPP lua-5.1.4 jsoncpp-src-0.5.0 zlib-1.2.7 source tolua++-1.0.93 iniFile WebServer expat '(' -name '*.cpp' -o -name '*.c' ')') +SOURCES := $(shell find src lib '(' -name '*.cpp' -o -name '*.c' ')') SOURCES := $(filter-out %minigzip.c %lua.c %tolua.c %toluabind.c %LeakFinder.cpp %StackWalker.cpp %example.c,$(SOURCES)) OBJECTS := $(patsubst %.c,$(BUILDDIR)%.o,$(SOURCES)) OBJECTS := $(patsubst %.cpp,$(BUILDDIR)%.o,$(OBJECTS)) |