-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (68 loc) · 1.45 KB
/
Copy pathMakefile
File metadata and controls
86 lines (68 loc) · 1.45 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
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
include ./Makefile.base.mk
# -- cosmetics --
help-column-width = 12
# -- context --
proj-root = .
proj-lib = $(proj-root)/Sources/Onitama
proj-lib-res = $(proj-lib)/Resources
tools-swift = swift
tools-swiftfmt = swift-format --configuration .swift-format.json --recursive ./
# -- init --
## initializes dev environment
init: init/pre init/base
.PHONY: init
# -- init/helpers
init/base:
brew bundle -v
.PHONY: init/base
init/pre:
ifeq ("$(shell command -v brew)", "")
$(info ✘ brew is not installed, please see:)
$(info - https://brew.sh)
$(error 1)
endif
.PHONY: init/pre
# -- run --
## runs the cli
run:
$(tools-swift) run
.PHONY: run
## cleans and runs the cli
r/clean: b/clean build run
.PHONY: r/clean
## runs the cli in the debugger
r/debug: build
lldb ./.build/debug/OnitamaCLI
.PHONY: r/debug
# -- build --
build = $(tools-swift) build
## builds the cli
build: b/sources b/resources
.PHONY: build
## cleans the cli
b/clean:
$(tools-swift) package clean
.PHONY: clean
# -- build/helpers
b/sources:
$(build)
.PHONY: b/sources
b/resources:
cp $(proj-lib-res)/* $$($(build) --show-bin-path)
.PHONY: b/resources
# -- verify --
## runs all verification steps
verify: v/format v/test
.PHONY: verify
## checks the code formatting
v/format:
$(tools-swiftfmt) --mode lint
.PHONY: v/format
## auto-fixes the code formatting
v/format/fix:
$(tools-swiftfmt) --in-place
.PHONY: v/format
## runs the tests
v/test:
$(tools-swift) test
.PHONY: v/test