summaryrefslogtreecommitdiffstats
path: root/ninja/rules.ninja
blob: 667467267e220d3cee4adb0417bb782b736e1638 (plain)
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
includes = -I lib/include -I engine/include
cflags = -g -Wall -pedantic -fPIC -std=c++17 -DDEBUG $includes

libs = -lSDL2 lib/libmm/build/libmm.a lib/libwsdl2/build/libwsdl2.a
lflags = $libs

flags = -fdiagnostics-color

rule mkdir
    command = mkdir -p $out
    description = creating directory $out

rule cpp
    command = g++ $flags $cflags -c $in -o $out
    description = compiling $in

rule link
    command = g++ $flags $cflags -o $out $in $lflags
    description = linking $out

rule link-shared
    command = g++ $flags $cflags -shared -o $out $in $lflags
    description = linking shared object $out

rule link-static
    command = ar rvs $out $in
    description = creating archive $out

rule ninja
    command = ninja -C $in
    description = running ninja in subdirectory $in