File Makefile changed (mode: 100644) (index 2698129..011b8a7) |
... |
... |
SDL2_DIR=SDL2-$(SDL2_VER) |
10 |
10 |
SDL2_TAR=$(SDL2_DIR).tar.gz |
SDL2_TAR=$(SDL2_DIR).tar.gz |
11 |
11 |
SDL2_WIN_TAR=SDL2-devel-$(SDL2_VER)-mingw.tar.gz |
SDL2_WIN_TAR=SDL2-devel-$(SDL2_VER)-mingw.tar.gz |
12 |
12 |
|
|
13 |
|
# Poco |
|
14 |
|
POCO_OPTIONS=-DENABLE_DATA=OFF -DENABLE_DATA_MYSQL=OFF |
|
15 |
|
POCO_VER=1.10.1 |
|
16 |
|
# Checks libversion every invocation. |
|
17 |
|
POCO_LIBVER=$(shell tr -d '\r\n' < $(POCO_DIR)/libversion) |
|
18 |
|
POCO_DIR=poco-$(POCO_VER)-all |
|
19 |
|
POCO_TAR=$(POCO_DIR).tar.bz2 |
|
20 |
|
POCO_FOUNDATION=libPocoFoundation.so.$(POCO_LIBVER) |
|
21 |
|
POCO_NET=libPocoNet.so.$(POCO_LIBVER) |
|
22 |
|
POCO_NETSSL=libPocoNetSSL.so.$(POCO_LIBVER) |
|
23 |
|
POCO_CRYPTO=libPocoCrypto.so.$(POCO_LIBVER) |
|
24 |
|
POCO_LINKS=-l:$(POCO_FOUNDATION) -l:$(POCO_NET) -l:$(POCO_NETSSL) -l:$(POCO_CRYPTO) |
|
25 |
|
|
|
26 |
13 |
# Boost |
# Boost |
27 |
14 |
BOOST_VER_MAJOR=1 |
BOOST_VER_MAJOR=1 |
28 |
15 |
BOOST_VER_MINOR=76 |
BOOST_VER_MINOR=76 |
|
... |
... |
LINCXX := $(CXX) -march=x86-64 -include $(shell readlink -f include/force_link_g |
45 |
32 |
CXXDYNAMIC=$(LINCXX) $(CXXFLAGS) -O3 -D__LIGHT__ -o $(PROGRAM)-dynamic $(PROGRAM).cpp libs.o -Wl,-rpath,. -L. -l:libSDL2.so -pthread |
CXXDYNAMIC=$(LINCXX) $(CXXFLAGS) -O3 -D__LIGHT__ -o $(PROGRAM)-dynamic $(PROGRAM).cpp libs.o -Wl,-rpath,. -L. -l:libSDL2.so -pthread |
46 |
33 |
MACCXX=clang++ -march=x86-64 |
MACCXX=clang++ -march=x86-64 |
47 |
34 |
WINCXX=i686-w64-mingw32-g++-posix -march=pentium4 -static-libgcc -static-libstdc++ |
WINCXX=i686-w64-mingw32-g++-posix -march=pentium4 -static-libgcc -static-libstdc++ |
48 |
|
#CXXFLAGS=-Iinclude -I$(OPENSSL_DIR)/include -I$(BOOST_DIR) -I$(POCO_DIR)/Foundation/include -I$(POCO_DIR)/Net/include -I$(POCO_DIR)/NetSSL_OpenSSL/include -I$(POCO_DIR)/Crypto/include -std=$(CXXSTD) -Wall -Wextra -Wfatal-errors |
|
|
35 |
|
#CXXFLAGS=-Iinclude -I$(OPENSSL_DIR)/include -I$(BOOST_DIR) -std=$(CXXSTD) -Wall -Wextra -Wfatal-errors |
49 |
36 |
CXXFLAGS=-Iinclude -I$(BOOST_DIR) -std=$(CXXSTD) -Wall -Wextra -Wfatal-errors |
CXXFLAGS=-Iinclude -I$(BOOST_DIR) -std=$(CXXSTD) -Wall -Wextra -Wfatal-errors |
50 |
37 |
WIN_CMAKE_FLAGS=-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc-win32 -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++-win32 -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER_WORKS=1 |
WIN_CMAKE_FLAGS=-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc-win32 -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++-win32 -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER_WORKS=1 |
51 |
38 |
MAC_OPENSSL_SSL=libssl-mac.a |
MAC_OPENSSL_SSL=libssl-mac.a |
|
... |
... |
ccvr: libs.o libboost_system.a libSDL2.a $(PROGRAM).cpp $(INCLUDES) |
89 |
76 |
|
|
90 |
77 |
# debug build settings may be outdated and broken |
# debug build settings may be outdated and broken |
91 |
78 |
debug: clean libs.o libboost_system.a libSDL2.a $(PROGRAM).cpp |
debug: clean libs.o libboost_system.a libSDL2.a $(PROGRAM).cpp |
92 |
|
$(LINCXX) -Iinclude -I$(BOOST_DIR) -std=$(CXXSTD) -Wall -Wextra -Wfatal-errors -g -D__STEAM__ -o $@ $(PROGRAM).cpp libs.o libboost_system.a libSDL2.a -Wl,-rpath,. -L. -ldl -lssl -lcrypto -pthread -lsteam_api $(POCO_LINKS) |
|
|
79 |
|
$(LINCXX) -Iinclude -I$(BOOST_DIR) -std=$(CXXSTD) -Wall -Wextra -Wfatal-errors -g -D__STEAM__ -o $@ $(PROGRAM).cpp libs.o libboost_system.a libSDL2.a -Wl,-rpath,. -L. -ldl -lssl -lcrypto -pthread -lsteam_api |
93 |
80 |
|
|
94 |
81 |
lint: |
lint: |
95 |
82 |
clang-tidy $(PROGRAM).cpp -checks=cert-*-cpp -header-filter=fdungeon.h -- $(CXXDYNAMIC) |
clang-tidy $(PROGRAM).cpp -checks=cert-*-cpp -header-filter=fdungeon.h -- $(CXXDYNAMIC) |
|
... |
... |
$(PROGRAM)-demo.exe: libs-win.o libboost_system-win.a $(WIN_OPENSSL_SSL) $(WIN_O |
108 |
95 |
-L. -l:$(WIN_OPENSSL_SSL) -l:$(WIN_OPENSSL_CRYPTO) -lwsock32 -lws2_32 -lmingw32 -l:SDL2.dll -l:libSDL2main.a -l:steam_api.dll \ |
-L. -l:$(WIN_OPENSSL_SSL) -l:$(WIN_OPENSSL_CRYPTO) -lwsock32 -lws2_32 -lmingw32 -l:SDL2.dll -l:libSDL2main.a -l:steam_api.dll \ |
109 |
96 |
-static -lpthread |
-static -lpthread |
110 |
97 |
|
|
|
98 |
|
# TODO: Rewrite server. |
111 |
99 |
ccserver: ccserver.cpp $(INCLUDES) |
ccserver: ccserver.cpp $(INCLUDES) |
112 |
|
$(LINCXX) $(CXXFLAGS) -O3 -o $@ ccserver.cpp -Wl,-rpath,. -L. -pthread -l:$(POCO_FOUNDATION) -l:$(POCO_NET) |
|
|
100 |
|
$(LINCXX) $(CXXFLAGS) -O3 -o $@ ccserver.cpp -Wl,-rpath,. -L. -pthread |
113 |
101 |
|
|
114 |
102 |
# Uncomment the line with the $(BOOST_DIR) dependency when building with Boost::Beast. |
# Uncomment the line with the $(BOOST_DIR) dependency when building with Boost::Beast. |
115 |
103 |
#libs.o: libs.cpp micropather.cpp include/tm_json.h $(BOOST_DIR) |
#libs.o: libs.cpp micropather.cpp include/tm_json.h $(BOOST_DIR) |
|
... |
... |
$(SDL2_DIR): $(SDL2_TAR) |
217 |
205 |
$(SDL2_TAR): |
$(SDL2_TAR): |
218 |
206 |
wget https://libsdl.org/release/$(SDL2_TAR) |
wget https://libsdl.org/release/$(SDL2_TAR) |
219 |
207 |
|
|
220 |
|
$(POCO_NET): $(POCO_DIR) |
|
221 |
|
mkdir -p $(POCO_DIR)/build |
|
222 |
|
cd $(POCO_DIR)/build; cmake $(POCO_OPTIONS) -DCMAKE_BUILD_TYPE=Release .. && make |
|
223 |
|
mv $(POCO_DIR)/build/lib/$(POCO_FOUNDATION) . |
|
224 |
|
mv $(POCO_DIR)/build/lib/$(POCO_NET) . |
|
225 |
|
mv $(POCO_DIR)/build/lib/$(POCO_NETSSL) . |
|
226 |
|
mv $(POCO_DIR)/build/lib/$(POCO_CRYPTO) . |
|
227 |
|
|
|
228 |
|
winpoco: $(POCO_DIR) |
|
229 |
|
mkdir -p $(POCO_DIR)/build |
|
230 |
|
cd $(POCO_DIR)/build; cmake $(POCO_OPTIONS) $(WIN_CMAKE_FLAGS) -DCMAKE_TOOLCHAIN_FILE=../../cross-mingw32-linux.cmake -DCMAKE_BUILD_TYPE=Release .. && make |
|
231 |
|
#mv $(POCO_DIR)/build/lib/$(WIN_POCO_FOUNDATION) . |
|
232 |
|
#mv $(POCO_DIR)/build/lib/$(WIN_POCO_NET) . |
|
233 |
|
#mv $(POCO_DIR)/build/lib/$(WIN_POCO_NETSSL) . |
|
234 |
|
#mv $(POCO_DIR)/build/lib/$(WIN_POCO_CRYPTO) . |
|
235 |
|
|
|
236 |
|
$(POCO_DIR): $(POCO_TAR) |
|
237 |
|
$(RM) -r $@ |
|
238 |
|
tar xvf $(POCO_TAR) |
|
239 |
|
touch $@ |
|
240 |
|
|
|
241 |
|
$(POCO_TAR): |
|
242 |
|
wget https://pocoproject.org/releases/poco-$(POCO_VER)/$(POCO_TAR) |
|
243 |
|
|
|
244 |
208 |
libboost_system.a: $(BOOST_DIR) |
libboost_system.a: $(BOOST_DIR) |
245 |
209 |
cp $(BOOST_DIR)/stage/lib/$@ . |
cp $(BOOST_DIR)/stage/lib/$@ . |
246 |
210 |
touch $@ |
touch $@ |