-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
73 lines (56 loc) · 1.58 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
ATLAS = "tools/atlas"
ATLAS_SRC = $(ATLAS)/main.c $(ATLAS)/util.c $(ATLAS)/bitmap.c $(ATLAS)/lib/stb/stb_image.c $(ATLAS)/lib/stb/stb_image_write.c $(ATLAS)/lib/stb/stb_rect_pack.c $(ATLAS)/lib/stb/stb_truetype.c
CC ?= gcc
all: run
.PHONY: exe run rerun debug release test retest check recheck sloc sloc_crates atlas clean unsave
run:
cargo run
exe:
./target/debug/rl.exe
rerun:
cargo watch -x run
debug:
cargo build
release:
cargo build --release
test:
cargo test
retest:
cargo watch -x test
recheck:
cargo watch -x check
check:
cargo check
sloc:
cloc */src/*.rs --by-file
sloc_crates:
cloc roguelike_utils/src/*.rs
cloc roguelike_core/src/*.rs
cloc roguelike_lib/src/*.rs
cloc roguelike_display/src/*.rs
cloc roguelike_draw/src/*.rs
cloc roguelike_engine/src/*.rs
cloc roguelike_main/src/*.rs
cloc roguelike_map/src/*.rs
atlas:
@echo "building atlas executable"
@$(CC) -std=gnu99 -O0 -o atlas $(ATLAS_SRC) -lm
@echo "collecting images"
@rm collectImages -rf
@mkdir collectImages
@find resources/animations -name "*.png" | xargs -I{} cp {} collectImages/
@find resources/UI -name "*.png" | xargs -I{} cp {} collectImages/
@find resources/misc -name "*.png" | xargs -I{} cp {} collectImages/
@find resources/tileset -name "*.png" | xargs -I{} cp {} collectImages/
#@cp resources/rustrogueliketiles.png collectImages/
@echo "building atlas image"
@./atlas collectImages/ --imageout resources/spriteAtlas.png --textout resources/spriteAtlas.txt
@rm collectImages -rf
@echo "done"
unsave:
-@rm game.save
clean:
@rm atlas
@cargo clean
@rm collectImages -rf
@rm game.save