-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tupfile
33 lines (26 loc) · 1.83 KB
/
Tupfile
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
include_rules
# XXX: These ones are nasty.
: lib/glfw/CMakeLists.txt |> mkdir -p glfw-build/; cd glfw-build/; cmake ../lib/glfw; make; cp src/libglfw3.a ..; cd ..; rm -rf glfw-build/ |> libglfw3.a
: foreach lib/stb/*.c |> !cc |> %B.o {stb_objs}
: {stb_objs} |> !ar |> libstb.a
# Need to use generated rules to manage Rust's crate output name mangling. Grab
# the outputs into named bins so we can refer to them later as dependencies.
run ./rust-rule.sh lib/cgmath-rs/src/cgmath/lib.rs {libcgmath}
# XXX: Add the code-generation bit from glfw-rs's Makefile. Just calling the Makefile
# would create a mess of output files that made Tup complain.
# Could use the tempdir hack used above for portaudio, but then I'd also need to re-do
# the output filename inference part.
: lib/glfw-rs/etc/link-rs.sh |> sh lib/glfw-rs/etc/link-rs.sh "`sh lib/glfw-rs/etc/glfw-link-args.sh`" > %o |> lib/glfw-rs/src/lib/link.rs
run ./rust-rule.sh lib/glfw-rs/src/lib/lib.rs {libglfw} \| lib/glfw-rs/src/lib/link.rs
run ./rust-rule.sh lib/gl-rs/src/gl/lib.rs {libgl}
run ./rust-rule.sh lib/color-rs/src/lib.rs {libcolor}
run ./rust-rule.sh lib/hgl-rs/src/lib.rs {libhgl} \| {libgl}
run ./rust-rule.sh src/stb/lib.rs {libstb}
: assets/font.png |> !databake |> gen/font_data.rs
run ./rust-rule.sh src/calx/lib.rs {libcalx} \| {libcgmath} {libcolor} {libstb} gen/font_data.rs
run ./rust-rule.sh src/glutil/lib.rs {libglutil} \| {libstb} {libcalx} {libgl} {libhgl} {libcolor} {libcgmath} {libglfw}
: assets/tile.png |> !databake |> gen/tile_data.rs
: src/morlock/main.rs | {libcgmath} {libglfw} {libgl} {libstb} {libglutil} libstb.a libglfw3.a gen/tile_data.rs |> !rustbin $(GLFW_LINKARGS) |> morlock
# Testing. All unit test runners are expected to start with 'test_'.
: src/runtests/main.rs |> !rustbin |> runtests
: src/calx/lib.rs | {libcalx} libstb.a |> !rustbin --test |> test_calx