-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (53 loc) · 1.72 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
BG=$(HOME)/jeux/bg/game
TARGET=./infinity_compiler
DB=./game.sqlite
RUN=RUST_BACKTRACE=1 $(TARGET) -G $(BG) -L 5
all: run
.PHONY: all run doc watch check test
doc:
mdbook build guide
r: run
run:
cargo b
$(MAKE) test
b: build
build:
cargo b
init: build
$(RUN) -O init.log init -B
save: build
$(RUN) -O save.log save
c: clippy
clippy:
cargo clippy --color=always 2>&1 | less -R
w: watch
watch:
cargo watch -s 'clear;cargo c --color=always 2>&1 | head -30'
# low-level (SQL) test
sqltest:
rm -rf $(BG)/simod_out
# $(RUN) -O init.log init -B
echo "update \"items\" set price=5,name='A new name for Albruin' where id='sw1h34';" | sqlite3 $(DB)
echo "select * from save_items where id='sw1h34'"|sqlite3 game.sqlite
echo "select * from save_items_abilities where root='sw1h34'"|sqlite3 game.sqlite
echo "select * from strref_dict"|sqlite3 game.sqlite
# $(RUN) -O show.log show sw1h34.itm
# $(RUN) -O add.log add target
$(RUN) -O save.log save
# high-level (Lua) test
t: test
test:
cargo build
@-echo "delete from add_items" | sqlite3 game.sqlite
@-echo "delete from add_items_abilities" | sqlite3 game.sqlite
@-echo "delete from add_items_effects" | sqlite3 game.sqlite
@-echo "delete from edit_items" | sqlite3 game.sqlite
@-echo "delete from edit_items_abilities" | sqlite3 game.sqlite
@-echo "delete from edit_items_effects" | sqlite3 game.sqlite
# $(RUN) -O init.log init -B
$(RUN) -O add.log add phony_target
@-echo "select * from add_items" | sqlite3 game.sqlite
@-echo "select parent,id from items_abilities where parent in (select id from add_items)" |sqlite3 game.sqlite
@-echo "select parent,root,id,opcode from items_effects where root in (select id from add_items)" |sqlite3 game.sqlite
restore:
$(RUN) restore