forked from crownengine/crown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
169 lines (151 loc) · 8.75 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#
# Copyright (c) 2012-2018 Daniele Bartolini and individual contributors.
# License: https://github.com/dbartolini/crown/blob/master/LICENSE
#
UNAME := $(shell uname)
ifeq ($(UNAME), $(filter $(UNAME), Linux))
OS=linux
else
OS=windows
endif
GENIE=3rdparty/bx/tools/bin/$(OS)/genie
MAKE_JOBS=1
NDKABI=14
NDKCC=$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-
NDKFLAGS=--sysroot $(ANDROID_NDK_ROOT)/platforms/android-$(NDKABI)/arch-arm
NDKARCH=-march=armv7-a -mfloat-abi=softfp -mfpu=neon -mthumb -Wl,--fix-cortex-a8
build/android-arm/bin/libluajit.a:
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src HOST_CC="gcc -m32" CROSS=$(NDKCC) TARGET_FLAGS="$(NDKFLAGS) $(NDKARCH)"
mkdir -p build/android-arm/bin
cp -r 3rdparty/luajit/src/jit 3rdparty/luajit/src/libluajit.a build/android-arm/bin
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src clean
build/linux32/bin/luajit:
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src CC="gcc -m32" CCOPT="-O2 -fomit-frame-pointer -msse2" TARGET_SYS=Linux BUILDMODE=static
mkdir -p build/linux32/bin
cp -r 3rdparty/luajit/src/jit 3rdparty/luajit/src/luajit 3rdparty/luajit/src/libluajit.a build/linux32/bin
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src clean
build/linux64/bin/luajit:
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src CC="gcc -m64" CCOPT="-O2 -fomit-frame-pointer -msse2" TARGET_SYS=Linux BUILDMODE=static
mkdir -p build/linux64/bin
cp -r 3rdparty/luajit/src/jit 3rdparty/luajit/src/luajit 3rdparty/luajit/src/libluajit.a build/linux64/bin
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src clean
build/mingw32/bin/luajit.exe:
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src CC="$(MINGW)/bin/x86_64-w64-mingw32-gcc -m32" CCOPT="-O2 -fomit-frame-pointer -msse2" TARGET_SYS=Windows BUILDMODE=static
mkdir -p build/mingw32/bin
cp -r 3rdparty/luajit/src/jit 3rdparty/luajit/src/luajit.exe 3rdparty/luajit/src/libluajit.a build/mingw32/bin
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src clean
build/mingw64/bin/luajit.exe:
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src CC="$(MINGW)/bin/x86_64-w64-mingw32-gcc -m64" CCOPT="-O2 -fomit-frame-pointer -msse2" TARGET_SYS=Windows BUILDMODE=static
mkdir -p build/mingw64/bin
cp -r 3rdparty/luajit/src/jit 3rdparty/luajit/src/luajit.exe 3rdparty/luajit/src/libluajit.a build/mingw64/bin
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/luajit/src clean
build/win32/bin/luajit.exe:
-mkdir "build/win32/bin"
cd "3rdparty/luajit/src" && msvcbuild.bat
cp -r 3rdparty/luajit/src/jit 3rdparty/luajit/src/luajit.exe 3rdparty/luajit/src/lua51.dll 3rdparty/luajit/src/lua51.lib build/win32/bin
-@rm -f 3rdparty/luajit/src/buildvm.*
-@rm -f 3rdparty/luajit/src/jit/vmdef.lua
-@rm -f 3rdparty/luajit/src/lua51.*
-@rm -f 3rdparty/luajit/src/luajit.exe
-@rm -f 3rdparty/luajit/src/luajit.exp
-@rm -f 3rdparty/luajit/src/luajit.lib
-@rm -f 3rdparty/luajit/src/minilua.*
build/win64/bin/luajit.exe:
-mkdir "build/win64/bin"
cd "3rdparty/luajit/src" && msvcbuild.bat
cp -r 3rdparty/luajit/src/jit 3rdparty/luajit/src/luajit.exe 3rdparty/luajit/src/lua51.dll 3rdparty/luajit/src/lua51.lib build/win64/bin
-@rm -f 3rdparty/luajit/src/buildvm.*
-@rm -f 3rdparty/luajit/src/jit/vmdef.lua
-@rm -f 3rdparty/luajit/src/lua51.*
-@rm -f 3rdparty/luajit/src/luajit.exe
-@rm -f 3rdparty/luajit/src/luajit.exp
-@rm -f 3rdparty/luajit/src/luajit.lib
-@rm -f 3rdparty/luajit/src/minilua.*
build/projects/android:
$(GENIE) --file=scripts/genie.lua --with-luajit --compiler=android-arm gmake
android-arm-debug: build/projects/android build/android-arm/bin/libluajit.a
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/android config=debug
android-arm-development: build/projects/android build/android-arm/bin/libluajit.a
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/android config=development
android-arm-release: build/projects/android build/android-arm/bin/libluajit.a
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/android config=release
android-arm: android-arm-debug android-arm-development android-arm-release
build/linux64/bin/texturec:
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/bgfx/.build/projects/gmake-linux config=release64 texturec
cp -r 3rdparty/bgfx/.build/linux64_gcc/bin/texturecRelease $@
build/linux64/bin/shaderc:
$(MAKE) -j$(MAKE_JOBS) -R -C 3rdparty/bgfx/.build/projects/gmake-linux config=release64 shaderc
cp -r 3rdparty/bgfx/.build/linux64_gcc/bin/shadercRelease $@
build/projects/linux:
$(GENIE) --file=3rdparty/bgfx/scripts/genie.lua --with-tools --gcc=linux-gcc gmake
$(GENIE) --with-luajit --with-tools --compiler=linux-gcc gmake
linux-debug32: build/projects/linux build/linux32/bin/luajit
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/linux config=debug32
linux-development32: build/projects/linux build/linux32/bin/luajit
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/linux config=development32
linux-release32: build/projects/linux build/linux32/bin/luajit
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/linux config=release32
linux-debug64: build/projects/linux build/linux64/bin/luajit build/linux64/bin/texturec build/linux64/bin/shaderc
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/linux config=debug64
linux-development64: build/projects/linux build/linux64/bin/luajit build/linux64/bin/texturec build/linux64/bin/shaderc
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/linux config=development64
linux-release64: build/projects/linux build/linux64/bin/luajit build/linux64/bin/texturec build/linux64/bin/shaderc
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/linux config=release64
linux: linux-debug32 linux-development32 linux-release32 linux-debug64 linux-development64 linux-release64
build/projects/mingw:
$(GENIE) --file=scripts/genie.lua --with-luajit --with-tools --compiler=mingw-gcc gmake
mingw-debug32: build/projects/mingw build/mingw32/bin/luajit.exe
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/mingw config=debug32
mingw-development32: build/projects/mingw build/mingw32/bin/luajit.exe
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/mingw config=development32
mingw-release32: build/projects/mingw build/mingw32/bin/luajit.exe
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/mingw config=release32
mingw-debug64: build/projects/mingw build/mingw64/bin/luajit.exe
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/mingw config=debug64
mingw-development64: build/projects/mingw build/mingw64/bin/luajit.exe
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/mingw config=development64
mingw-release64: build/projects/mingw build/mingw64/bin/luajit.exe
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/mingw config=release64
mingw: mingw-debug32 mingw-development32 mingw-release32 mingw-debug64 mingw-development64 mingw-release64
build/win64/bin/texturec.exe:
devenv 3rdparty/bgfx/.build/projects/vs2017/bgfx.sln /Build "Release|x64" /Project shaderc.vcxproj
cp -r 3rdparty/bgfx/.build/win64_vs2017/bin/texturecRelease.exe $@
build/win64/bin/shaderc.exe:
devenv 3rdparty/bgfx/.build/projects/vs2017/bgfx.sln /Build "Release|x64" /Project texturec.vcxproj
cp -r 3rdparty/bgfx/.build/win64_vs2017/bin/shadercRelease.exe $@
build/projects/vs2017:
$(GENIE) --file=3rdparty\\bgfx\\scripts\\genie.lua --with-tools vs2017
$(GENIE) --with-luajit --with-tools --no-level-editor vs2017
windows-debug32: build/projects/vs2017 build/win32/bin/luajit.exe
devenv build/projects/vs2017/crown.sln /Build "debug|Win32"
windows-development32: build/projects/vs2017 build/win32/bin/luajit.exe
devenv build/projects/vs2017/crown.sln /Build "development|Win32"
windows-release32: build/projects/vs2017 build/win32/bin/luajit.exe
devenv build/projects/vs2017/crown.sln /Build "release|Win32"
windows-debug64: build/projects/vs2017 build/win64/bin/luajit.exe build/win64/bin/texturec.exe build/win64/bin/shaderc.exe
devenv build/projects/vs2017/crown.sln /Build "debug|x64"
windows-development64: build/projects/vs2017 build/win64/bin/luajit.exe build/win64/bin/texturec.exe build/win64/bin/shaderc.exe
devenv build/projects/vs2017/crown.sln /Build "development|x64"
windows-release64: build/projects/vs2017 build/win64/bin/luajit.exe build/win64/bin/texturec.exe build/win64/bin/shaderc.exe
devenv build/projects/vs2017/crown.sln /Build "release|x64"
.PHONY: rebuild-glib-resources
rebuild-glib-resources:
$(MAKE) -j$(MAKE_JOBS) -R -C tools rebuild
tools-linux-debug64: linux-development64
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/linux level-editor config=debug
tools-linux-release64: linux-development64
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/linux level-editor config=release
tools-mingw-debug64: mingw-development64
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/mingw level-editor config=debug
tools-mingw-release64: mingw-development64
$(MAKE) -j$(MAKE_JOBS) -R -C build/projects/mingw level-editor config=release
.PHONY: docs
docs:
$(MAKE) -C docs/ html
doxygen docs/doxygen/Doxyfile.doxygen
.PHONY: clean
clean:
@echo Cleaning...
-@rm -rf build
-@$(MAKE) -R -C 3rdparty/luajit/src clean -s
-@rm -rf 3rdparty/bgfx/.build