-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
108 lines (84 loc) · 2.7 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
help:
@cat Makefile
.EXPORT_ALL_VARIABLES:
# create an .env file to override the default settings
-include .env
export $(shell sed 's/=.*//' .env)
.PHONY: build docs bin json
# VARIABLES
OUTPUT=output
SCHEMADIR=src/skypy/assets/schema
BINDIR=bin
APPNAME=MoveEditor
EXT=bfbs
# --------------------------------
# Installation
# --------------------------------
install:
pip install --upgrade pip
pip install --upgrade poetry
poetry install
# --------------------------------
# Testing
# --------------------------------
pytest:
pytest -x --testmon --mypy --pylint --cov-fail-under 85
# --------------------------------
# Run main script
# --------------------------------
run:
python main.py
# --------------------------------
# Create binary files (the MODS)
# --------------------------------
bin:
rm $(BINDIR)/*.bin || echo "no bins"
flatc -b $(SCHEMADIR)/personal_array.fbs $(OUTPUT)/personal_array.json || echo "ERROR for personal_array"
flatc -b $(SCHEMADIR)/waza_array.fbs $(OUTPUT)/waza_array.json || echo "ERROR for waza_array"
flatc -b $(SCHEMADIR)/trdata_array.bfbs $(OUTPUT)/trdata_array.json || echo "ERROR for trdata_array"
mv *.bin $(BINDIR)/.
mod: MODDIR=$(BINDIR)/__mod__
mod: bin
mkdir -p $(MODDIR)/romfs/avalon/data
mv $(BINDIR)/personal_array.bin $(MODDIR)/romfs/avalon/data/.
mv $(BINDIR)/waza_array.bin $(MODDIR)/romfs/avalon/data/.
mkdir -p $(MODDIR)/romfs/world/data/trainer/trdata
mv $(BINDIR)/trdata_array.bin $(MODDIR)/romfs/world/data/trainer/trdata/.
cp info.toml $(MODDIR)/.
cp -r sandbox/arc $(MODDIR)/romfs/.
# --------------------------------
# Decode binary files to JSON
# --------------------------------
json-decode:
rm $(FILENAME).json || echo ""
flatc --json --strict-json --raw-binary $(SCHEMADIR)/$(FILENAME).$(EXT) -- $(BINDIR)/$(FILENAME).bin
mv $(FILENAME).json $(OUTPUT)/. || echo ""
json-personal: FILENAME=personal_array
json-personal: EXT=fbs
json-personal: json-decode
json-trainer: FILENAME=trdata_array
json-trainer: json-decode
json-waza: FILENAME=waza_array
json-waza: EXT=fbs
json-waza: json-decode
json: json-personal json-trainer json-waza
# --------------------------------
# Deserialize data.trpfd
# --------------------------------
trpfd:
flatc --json --strict-json --raw-binary -- $(BINDIR)/data.trpfd
# --------------------------------
# App
# --------------------------------
# Use --add-data="$(LOC):customtkinter/" or not
app: LOC=$(shell pip show customtkinter | grep Location | awk '{print $$NF}')
app:
pyinstaller --noconfirm --onedir --windowed \
--icon "icon.ico" \
--name $(APPNAME) \
--add-data="$(LOC):customtkinter/" \
--add-data "pyproject.toml:." \
--add-data "src/skypy/assets:skypy/assets" \
app.py
test-app:
./dist/$(APPNAME)/$(APPNAME)