-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbase.ninja
57 lines (42 loc) · 1.87 KB
/
base.ninja
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
ninja_required_version = 1.3
builddir = build
#partial option sets
common = -I. -ISDL2 -Ilib -mmacosx-version-min=10.10.0
cppflags = -std=c++14
cflags = -std=c11
opt = -Ofast -march=native
libflags = $common $opt
srcflags = $common -Wall -Wno-unused-variable $opt
linkflags = -lSDL2 -headerpad_max_install_names
#compiler = /usr/local/opt/llvm/bin/clang
compiler = gcc-8
img_size = 512
rule img
command = convert $in -resize $img_size $out
description = Resizing image $in
rule img_lin
command = convert $in -gamma 1 -resize $img_size -gamma 1 $out
description = Resizing texture $in
rule ply
command = ply/ply -i $in -o $out
description = Converting model $in
rule lib
command = $compiler -MMD -MF $out.d $libflags $cppflags -c $in -o $out
description = Building library $in
depfile = $out.d
rule clib
command = $compiler -MMD -MF $out.d $libflags $cflags -c $in -o $out
description = Building library $in
depfile = $out.d
rule src
# command = $compiler -MD -MF $out.d $srcflags $cppflags -c $in -o $out && $compiler $srcflags $cppflags -c $in -E > $out.cpp
command = $compiler -MMD -MF $out.d $srcflags $cppflags -c $in -o $out
description = Building source $in
depfile = $out.d
rule link
command = $compiler $linkflags -mmacosx-version-min=10.10.0 $in -o $out
description = Linking executable $out
rule img_pack
command = res/build.sh
description = Packing images
build res/tomato_c.png: img_pack res/src/BrokenTiles_01_BC.png res/src/Sword9_diffuse.png res/src/CobbleStone_01_BC.png res/src/Tomato_diffuse.png res/src/Sword7_diffuse.png res/src/Sword9_normal.png res/src/CobbleStone_01_N.png res/src/Sword7_roughness.png res/src/Tomato_MetalSmooth.png res/src/BrokenTiles_01_N.png res/src/Sword9_roughness.png res/src/Tomato_normal.png res/src/BrokenTiles_01_R.png res/src/CobbleStone_01_R.png res/src/Sword7_normal.png