forked from Next-Flip/Asset-Packs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (45 loc) · 1.41 KB
/
Copy pathMakefile
File metadata and controls
56 lines (45 loc) · 1.41 KB
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
VERSION := 0.0.0
# If the first argument is "repack"...
ifeq (repack,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "repack"
REPACK_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(REPACK_ARGS):;@:)
endif
.PHONY: repack
repack: venv requirements
./.venv/bin/python3 .utils/repack.py $(REPACK_ARGS)
# If the first argument is "check"...
ifeq (check,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "check"
CHECK_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(CHECK_ARGS):;@:)
endif
.PHONY: check
check: venv requirements
./.venv/bin/python3 .utils/check.py $(CHECK_ARGS)
# Handle previews arguments for pack processing
ifneq (,$(filter previews,$(MAKECMDGOALS)))
# use the rest as arguments for "previews"
PREVIEWS_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(PREVIEWS_ARGS):;@:)
endif
.PHONY: previews
previews: venv requirements
./.venv/bin/python3 .utils/previews.py $(PREVIEWS_ARGS)
venv:
python3 -m venv .venv
.PHONY: requirements
requirements: venv
./.venv/bin/pip install -q -r requirements.txt
.PHONY: clean
clean:
rm -rf .venv
.PHONY: lint
lint: venv requirements
./.venv/bin/black .utils --check
.PHONY: format
format: venv requirements
./.venv/bin/black .utils