-
Notifications
You must be signed in to change notification settings - Fork 275
/
Makefile
137 lines (106 loc) · 2.65 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#
# Makefile
# mas
#
################################################################################
#
# Variables
#
CMD_NAME = mas
SHELL = /bin/sh
PREFIX ?= /usr/local
SWIFT_VERSION = 5.7.1
# set EXECUTABLE_DIRECTORY according to your specific environment
# run swift build and see where the output executable is created
# OS specific differences
UNAME = ${shell uname}
ARCH = ${shell uname -m}
ifeq ($(UNAME), Darwin)
PLATFORM = $(ARCH)-apple-macosx
EXECUTABLE_DIRECTORY = ./.build/${PLATFORM}/debug
endif
################################################################################
#
# Help
#
.DEFAULT_GOAL := help
.PHONY: help
help: MAKEFILE_FMT = " \033[36m%-25s\033[0m%s\n"
help: ## (default) Displays this message
@echo "mas Makefile"
@echo ""
@echo "Targets:"
@grep -E '^[a-zA-Z0-9_-]*:.*?##' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?##"}; {printf $(MAKEFILE_FMT), $$1, $$2}'
: # Hacky way to display a newline ##
################################################################################
#
# Targets
#
.PHONY: version
version: ## Prints versions of tools used by this Makefile.
xcodebuild -version
swiftenv version
swift --version
swift package tools-version
.PHONY: init
init: ## Installs tools.
- swiftenv install $(SWIFT_VERSION)
swiftenv local $(SWIFT_VERSION)
.PHONY: bootstrap
bootstrap: ## Installs tools.
script/bootstrap
.PHONY: clean
clean: ## Cleans built products.
script/clean
.PHONY: updateHeaders
updateHeaders: ## Updates private headers.
script/update_headers
.PHONY: build
build: ## Builds the project.
script/build
.PHONY: test
test: build ## Runs tests.
script/test
# make run ARGS="asdf"
.PHONY: run
run: build
${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS)
.PHONY: install
install: ## Installs the project.
script/install $(PREFIX)
.PHONY: uninstall
uninstall: ## Uninstalls the project.
script/uninstall
.PHONY: format
format: ## Formats source code.
script/format
.PHONY: lint
lint: ## Lints source code.
script/lint
.PHONY: danger
danger: ## Runs danger.
script/danger
# Builds bottles
.PHONY: bottles
bottles: ## Builds bottles.
script/bottle
.PHONY: bottle
bottle: bottles ## Alias for bottles
.PHONY: package
package: build ## Packages the project.
script/package
.PHONY: packageInstall
packageInstall: package ## Installs the package.
script/package_install
.PHONY: describe
describe: ## Describes the Swift package.
swift package describe
.PHONY: resolve
resolve: ## Resolves SwiftPM dependencies.
swift package resolve
.PHONY: dependencies
dependencies: resolve ## Lists SwiftPM dependencies.
swift package show-dependencies
.PHONY: update
update: resolve ## Updates SwiftPM dependencies.
swift package update