2019-04-04 00:13:32 -07:00
|
|
|
Q ?= @
|
|
|
|
UPDATEDIR := /tmp
|
2019-08-11 10:20:26 -07:00
|
|
|
BUILDTYPE ?= Debug
|
2019-04-04 00:13:32 -07:00
|
|
|
BUILDDIR ?= ./build
|
|
|
|
BUILDDIR_NINJA ?= ./build-ninja
|
2019-08-11 10:20:26 -07:00
|
|
|
INSTALL_DIR ?= $(BUILDDIR)/$(shell uname)
|
2019-04-04 00:13:32 -07:00
|
|
|
NINJA := ninja
|
2016-05-13 11:56:58 -07:00
|
|
|
|
2018-09-09 02:04:47 -07:00
|
|
|
all:
|
2019-03-12 09:40:53 -07:00
|
|
|
$(Q)if [ ! -f $(BUILDDIR)/CMakeCache.txt ]; then cmake -H. -B$(BUILDDIR) -DCMAKE_BUILD_TYPE=$(BUILDTYPE) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR); fi
|
2018-06-19 11:55:33 -07:00
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(BUILDDIR) $@
|
2017-02-25 06:01:49 -08:00
|
|
|
|
2019-04-04 00:13:32 -07:00
|
|
|
ninja:
|
|
|
|
$(Q)if [ ! -f $(BUILDDIR_NINJA)/CMakeCache.txt ]; then cmake -H. -B$(BUILDDIR_NINJA) -DRCON=OFF -DCMAKE_BUILD_TYPE=$(BUILDTYPE) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -GNinja; fi
|
|
|
|
$(Q)$(NINJA) -C $(BUILDDIR_NINJA)
|
|
|
|
|
2018-09-09 02:04:47 -07:00
|
|
|
%:
|
2019-03-12 09:40:53 -07:00
|
|
|
$(Q)if [ ! -f $(BUILDDIR)/CMakeCache.txt ]; then cmake -H. -B$(BUILDDIR) -DCMAKE_BUILD_TYPE=$(BUILDTYPE) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR); fi
|
2018-09-09 02:04:47 -07:00
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(BUILDDIR) $@
|
2016-04-19 11:18:28 -07:00
|
|
|
|
2019-07-23 06:12:10 -07:00
|
|
|
cppcheck:
|
|
|
|
$(Q)$(MAKE) BUILDDIR=$(BUILDDIR)/$@
|
|
|
|
|
2016-12-03 10:38:38 -08:00
|
|
|
define UPDATE_GIT
|
2017-06-04 01:12:06 -07:00
|
|
|
$(Q)if [ ! -d $(UPDATEDIR)/$(1).sync ]; then \
|
2017-08-08 23:54:36 -07:00
|
|
|
git clone --depth=1 $(2) $(UPDATEDIR)/$(1).sync; \
|
2016-12-03 10:38:38 -08:00
|
|
|
else \
|
2017-08-08 23:54:36 -07:00
|
|
|
cd $(UPDATEDIR)/$(1).sync && git pull --depth=1 --rebase; \
|
2016-12-03 10:38:38 -08:00
|
|
|
fi;
|
|
|
|
endef
|
|
|
|
|
|
|
|
define UPDATE_HG
|
2017-06-04 01:12:06 -07:00
|
|
|
$(Q)if [ ! -d $(UPDATEDIR)/$(1).sync ]; then \
|
|
|
|
hg clone $(2) $(UPDATEDIR)/$(1).sync; \
|
2016-12-03 10:38:38 -08:00
|
|
|
else \
|
2017-06-04 01:12:06 -07:00
|
|
|
cd $(UPDATEDIR)/$(1).sync && hg pull && hg update; \
|
2016-12-03 10:38:38 -08:00
|
|
|
fi;
|
|
|
|
endef
|
|
|
|
|
2017-09-10 21:47:47 -07:00
|
|
|
update-restclient-cpp:
|
2017-09-10 10:33:17 -07:00
|
|
|
$(call UPDATE_GIT,restclient-cpp,https://github.com/mrtazz/restclient-cpp.git)
|
|
|
|
rm -rf contrib/libs/restclient-cpp/restclient-cpp/*.h
|
|
|
|
rm -rf contrib/libs/restclient-cpp/*.cc
|
|
|
|
cp $(UPDATEDIR)/restclient-cpp.sync/include/restclient-cpp/*.h contrib/libs/restclient-cpp/restclient-cpp
|
|
|
|
cp $(UPDATEDIR)/restclient-cpp.sync/source/*.cc contrib/libs/restclient-cpp
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-libuv:
|
2017-09-06 10:34:12 -07:00
|
|
|
$(call UPDATE_GIT,libuv,https://github.com/libuv/libuv.git)
|
2018-06-29 11:04:39 -07:00
|
|
|
rm -rf contrib/libs/libuv/include/uv/*.[ch]
|
2017-09-10 10:33:17 -07:00
|
|
|
rm -rf contrib/libs/libuv/include/*.[ch]
|
|
|
|
rm -rf contrib/libs/libuv/src/unix/*.[ch]
|
|
|
|
rm -rf contrib/libs/libuv/src/win32/*.[ch]
|
|
|
|
rm -rf contrib/libs/libuv/src/*.[ch]
|
2017-09-06 10:34:12 -07:00
|
|
|
cp $(UPDATEDIR)/libuv.sync/include/*.h contrib/libs/libuv/include
|
2018-06-29 11:04:39 -07:00
|
|
|
cp $(UPDATEDIR)/libuv.sync/include/uv/*.h contrib/libs/libuv/include/uv
|
2017-09-06 10:34:12 -07:00
|
|
|
cp $(UPDATEDIR)/libuv.sync/src/unix/*.[ch] contrib/libs/libuv/src/unix
|
|
|
|
cp $(UPDATEDIR)/libuv.sync/src/win/*.[ch] contrib/libs/libuv/src/win
|
|
|
|
cp $(UPDATEDIR)/libuv.sync/src/*.[ch] contrib/libs/libuv/src
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-stb:
|
2017-08-20 11:25:59 -07:00
|
|
|
$(call UPDATE_GIT,stb,https://github.com/nothings/stb.git)
|
|
|
|
cp $(UPDATEDIR)/stb.sync/stb_image.h src/modules/image/stb_image.h
|
|
|
|
cp $(UPDATEDIR)/stb.sync/stb_image_write.h src/modules/image/stb_image_write.h
|
2018-05-07 16:59:56 -07:00
|
|
|
cp $(UPDATEDIR)/stb.sync/stb_truetype.h src/modules/voxelfont/stb_truetype.h
|
2019-02-06 05:11:59 -08:00
|
|
|
cp $(UPDATEDIR)/stb.sync/stb_truetype.h src/modules/ui/turbobadger/tb/thirdparty
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-googletest:
|
2017-06-26 20:58:18 -07:00
|
|
|
$(call UPDATE_GIT,googletest,https://github.com/google/googletest.git)
|
2017-07-24 12:40:17 -07:00
|
|
|
rm -rf contrib/libs/gtest/src
|
|
|
|
rm -rf contrib/libs/gtest/include
|
2018-10-14 11:48:45 -07:00
|
|
|
mkdir -p contrib/libs/gtest/src
|
|
|
|
mkdir -p contrib/libs/gtest/include
|
|
|
|
cp -r $(UPDATEDIR)/googletest.sync/googletest/src/ contrib/libs/gtest
|
|
|
|
cp -r $(UPDATEDIR)/googletest.sync/googletest/include/ contrib/libs/gtest
|
|
|
|
cp -r $(UPDATEDIR)/googletest.sync/googlemock/src/ contrib/libs/gtest
|
|
|
|
cp -r $(UPDATEDIR)/googletest.sync/googlemock/include/ contrib/libs/gtest
|
2017-07-19 06:33:05 -07:00
|
|
|
git checkout -f contrib/libs/gtest/include/gtest/internal/custom
|
2018-07-06 07:19:49 -07:00
|
|
|
git checkout -f contrib/libs/gtest/include/gmock/internal/custom
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-benchmark:
|
2017-06-20 11:35:23 -07:00
|
|
|
$(call UPDATE_GIT,benchmark,https://github.com/google/benchmark.git)
|
|
|
|
cp -r $(UPDATEDIR)/benchmark.sync/src/* contrib/libs/benchmark/src
|
|
|
|
cp -r $(UPDATEDIR)/benchmark.sync/include/* contrib/libs/benchmark/include
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-backward:
|
2017-06-11 10:41:00 -07:00
|
|
|
$(call UPDATE_GIT,backward-cpp,https://github.com/bombela/backward-cpp.git)
|
|
|
|
cp $(UPDATEDIR)/backward-cpp.sync/backward.cpp contrib/libs/backward
|
|
|
|
cp -f $(UPDATEDIR)/backward-cpp.sync/backward.hpp contrib/libs/backward/backward.h
|
|
|
|
sed -i 's/backward.hpp/backward.h/g' contrib/libs/backward/backward.cpp
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-dearimgui:
|
2017-06-04 01:12:06 -07:00
|
|
|
$(call UPDATE_GIT,imgui,https://github.com/ocornut/imgui.git)
|
2018-10-14 11:25:28 -07:00
|
|
|
cp $(UPDATEDIR)/imgui.sync/im*.h $(UPDATEDIR)/imgui.sync/im*.cpp $(UPDATEDIR)/imgui.sync/misc/cpp/* contrib/libs/dearimgui/dearimgui
|
2017-08-08 23:27:47 -07:00
|
|
|
mv contrib/libs/dearimgui/dearimgui/imgui_demo.cpp src/tests/testimgui/Demo.cpp
|
2018-01-09 07:36:49 -08:00
|
|
|
sed -i 's/"imgui.h"/"ui\/imgui\/IMGUI.h"/g' src/tests/testimgui/Demo.cpp
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-flatbuffers:
|
2016-12-03 10:38:38 -08:00
|
|
|
$(call UPDATE_GIT,flatbuffers,https://github.com/google/flatbuffers.git)
|
|
|
|
rm -rf contrib/libs/flatbuffers/flatbuffers/* contrib/libs/flatbuffers/compiler/*
|
|
|
|
mkdir -p contrib/libs/flatbuffers/compiler/src
|
2017-06-04 01:12:06 -07:00
|
|
|
cp -r $(UPDATEDIR)/flatbuffers.sync/include/flatbuffers/* contrib/libs/flatbuffers/flatbuffers
|
|
|
|
cp -r $(UPDATEDIR)/flatbuffers.sync/src/* contrib/libs/flatbuffers/compiler
|
|
|
|
cp -r $(UPDATEDIR)/flatbuffers.sync/grpc/src/* contrib/libs/flatbuffers/compiler/src
|
2016-12-03 10:38:38 -08:00
|
|
|
rm contrib/libs/flatbuffers/compiler/flathash.cpp
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-enet:
|
2016-12-03 10:38:38 -08:00
|
|
|
$(call UPDATE_GIT,libenet,https://github.com/lsalzman/enet.git)
|
2017-06-04 01:12:06 -07:00
|
|
|
cp -r $(UPDATEDIR)/libenet.sync/*.[ch] contrib/libs/libenet
|
|
|
|
cp -r $(UPDATEDIR)/libenet.sync/include/* contrib/libs/libenet/include
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-glm:
|
2016-12-03 10:38:38 -08:00
|
|
|
$(call UPDATE_GIT,glm,https://github.com/g-truc/glm.git)
|
|
|
|
rm -rf contrib/libs/glm/glm/*
|
2017-06-04 01:12:06 -07:00
|
|
|
cp -r $(UPDATEDIR)/glm.sync/glm/* contrib/libs/glm/glm
|
2016-12-03 10:38:38 -08:00
|
|
|
rm contrib/libs/glm/glm/CMakeLists.txt
|
2017-09-10 21:47:47 -07:00
|
|
|
|
|
|
|
update-sdl2:
|
2016-12-03 10:38:38 -08:00
|
|
|
$(call UPDATE_HG,sdl2,https://hg.libsdl.org/SDL)
|
2017-10-15 03:55:18 -07:00
|
|
|
rm -rf contrib/libs/sdl2/src/* contrib/libs/sdl2/include/* contrib/libs/sdl2/cmake/*
|
2017-06-04 01:12:06 -07:00
|
|
|
cp -r $(UPDATEDIR)/sdl2.sync/src/* contrib/libs/sdl2/src
|
2018-11-25 08:23:30 -08:00
|
|
|
cp -r $(UPDATEDIR)/sdl2.sync/wayland-protocols/* contrib/libs/sdl2/wayland-protocols
|
2017-06-04 01:12:06 -07:00
|
|
|
cp -r $(UPDATEDIR)/sdl2.sync/include/* contrib/libs/sdl2/include
|
2017-10-15 03:55:18 -07:00
|
|
|
cp -r $(UPDATEDIR)/sdl2.sync/cmake/* contrib/libs/sdl2/cmake
|
2017-09-10 21:47:47 -07:00
|
|
|
|
2019-12-12 13:26:42 -08:00
|
|
|
update-sdl2mixer:
|
|
|
|
$(call UPDATE_HG,sdl2_mixer,https://hg.libsdl.org/SDL_mixer)
|
|
|
|
rm -rf contrib/libs/sdl2_mixer/*
|
|
|
|
cp -r $(UPDATEDIR)/sdl2_mixer.sync/src/* contrib/libs/sdl2_mixer
|
|
|
|
cp -r $(UPDATEDIR)/sdl2_mixer.sync/include/* contrib/libs/sdl2_mixer
|
|
|
|
cp -r $(UPDATEDIR)/sdl2_mixer.sync/external/libogg* contrib/libs/sdl2_mixer
|
|
|
|
cp -r $(UPDATEDIR)/sdl2_mixer.sync/external/libvorbis* contrib/libs/sdl2_mixer
|
|
|
|
git checkout -f contrib/libs/sdl2_mixer/CMakeLists.txt
|
|
|
|
|
2017-09-11 07:54:07 -07:00
|
|
|
update-glslang:
|
|
|
|
$(call UPDATE_GIT,glslang,https://github.com/KhronosGroup/glslang.git)
|
|
|
|
rm -rf src/tools/glslang/External
|
|
|
|
cp -r $(UPDATEDIR)/glslang.sync/External src/tools/glslang/
|
|
|
|
rm -rf src/tools/glslang/glslang
|
|
|
|
cp -r $(UPDATEDIR)/glslang.sync/glslang src/tools/glslang/
|
|
|
|
rm -rf src/tools/glslang/OGLCompilersDLL
|
|
|
|
cp -r $(UPDATEDIR)/glslang.sync/OGLCompilersDLL src/tools/glslang/
|
|
|
|
rm -rf src/tools/glslang/SPIRV
|
|
|
|
cp -r $(UPDATEDIR)/glslang.sync/SPIRV src/tools/glslang/
|
|
|
|
rm -rf src/tools/glslang/StandAlone
|
|
|
|
cp -r $(UPDATEDIR)/glslang.sync/StandAlone src/tools/glslang/
|
|
|
|
|
2017-09-10 21:47:47 -07:00
|
|
|
# currently not part of updatelibs - intentional - we adopted the original code.
|
|
|
|
update-simplexnoise:
|
|
|
|
$(call UPDATE_GIT,simplexnoise,https://github.com/simongeilfus/SimplexNoise.git)
|
|
|
|
cp $(UPDATEDIR)/simplexnoise.sync/include/Simplex.h src/modules/noise
|
|
|
|
|
2018-06-02 11:37:22 -07:00
|
|
|
update-curl:
|
|
|
|
$(call UPDATE_GIT,curl,https://github.com/curl/curl.git)
|
2018-06-12 23:59:20 -07:00
|
|
|
cp $(UPDATEDIR)/curl.sync/lib/*.[ch]* contrib/libs/libcurl/lib
|
2018-07-02 11:14:49 -07:00
|
|
|
cp $(UPDATEDIR)/curl.sync/lib/CMakeLists.txt contrib/libs/libcurl/lib
|
|
|
|
cp $(UPDATEDIR)/curl.sync/CMakeLists.txt contrib/libs/libcurl
|
2018-07-02 10:52:42 -07:00
|
|
|
cp -r $(UPDATEDIR)/curl.sync/CMake/* contrib/libs/libcurl/CMake
|
2018-06-12 23:59:20 -07:00
|
|
|
cp $(UPDATEDIR)/curl.sync/lib/vauth/*.[ch]* contrib/libs/libcurl/lib/vauth
|
|
|
|
cp $(UPDATEDIR)/curl.sync/lib/vtls/*.[ch]* contrib/libs/libcurl/lib/vtls
|
|
|
|
cp $(UPDATEDIR)/curl.sync/include/curl/*.[ch]* contrib/libs/libcurl/include/curl
|
2018-06-02 11:37:22 -07:00
|
|
|
|
2018-01-10 00:15:11 -08:00
|
|
|
# TODO native file dialog support
|
2018-01-12 06:15:04 -08:00
|
|
|
# TODO simpleai support
|
2018-06-22 07:21:12 -07:00
|
|
|
# TODO lua support
|
2019-12-18 22:28:13 -08:00
|
|
|
updatelibs: update-restclient-cpp update-libuv update-stb update-googletest update-benchmark update-backward update-dearimgui update-flatbuffers update-enet update-glm update-sdl2 update-curl update-glslang
|
2018-06-19 11:40:13 -07:00
|
|
|
$(MAKE) -C $(BUILDDIR) update-libs
|
2019-01-29 09:34:11 -08:00
|
|
|
|
|
|
|
windows:
|
2019-03-05 11:38:00 -08:00
|
|
|
$(Q)if [ ! -f $(BUILDDIR)-windows/CMakeCache.txt ]; then i686-w64-mingw32.static-cmake -H. -B$(BUILDDIR)-windows -DCURL_CA_PATH=none -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR); fi
|
2019-01-29 09:34:11 -08:00
|
|
|
$(Q)$(MAKE) --no-print-directory -C $(BUILDDIR)-windows install
|