forked from mas-cli/mas
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
158 lines (122 loc) · 2.64 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#
# Makefile
# mas
#
################################################################################
#
# Variables
#
CMD_NAME = mas
SHELL = /bin/sh
# trunk
# SWIFT_VERSION = swift-DEVELOPMENT-SNAPSHOT-2020-04-23-a
# Swift 5.3
# SWIFT_VERSION = swift-5.3-DEVELOPMENT-SNAPSHOT-2020-04-21-a
SWIFT_VERSION = 5.2.4
# 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}
ifeq ($(UNAME), Darwin)
SWIFTC_FLAGS =
LINKER_FLAGS = -Xlinker -L/usr/local/lib
PLATFORM = x86_64-apple-macosx
EXECUTABLE_DIRECTORY = ./.build/${PLATFORM}/debug
TEST_BUNDLE = ${CMD_NAME}PackageTests.xctest
TEST_RESOURCES_DIRECTORY = ./.build/${PLATFORM}/debug/${TEST_BUNDLE}/Contents/Resources
endif
RUN_RESOURCES_DIRECTORY = ${EXECUTABLE_DIRECTORY}
################################################################################
#
# Targets
#
.PHONY: version
version:
xcodebuild -version
swift --version
# swift package tools-version
.PHONY: init
init:
- swiftenv install $(SWIFT_VERSION)
swiftenv local $(SWIFT_VERSION)
.PHONY: bootstrap
bootstrap:
script/bootstrap
.PHONY: clean
clean:
script/clean
xcodebuild clean
# swift package clean
# swift package reset
.PHONY: distclean
distclean:
rm -rf Packages
# swift package clean
.PHONY: updateHeaders
updateHeaders:
script/update_headers
.PHONY: build
build: #copyRunResources
script/build
# swift build $(SWIFTC_FLAGS) $(LINKER_FLAGS)
.PHONY: test
test: build #copyTestResources
script/test
# swift test --enable-test-discovery
.PHONY: copyRunResources
copyRunResources:
mkdir -p ${RUN_RESOURCES_DIRECTORY}
cp -r Resources/* ${RUN_RESOURCES_DIRECTORY}
.PHONY: copyTestResources
copyTestResources:
mkdir -p ${TEST_RESOURCES_DIRECTORY}
cp -r Resources/* ${TEST_RESOURCES_DIRECTORY}
# make run ARGS="asdf"
.PHONY: run
run: build
${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS)
.PHONY: install
install:
script/install
.PHONY: uninstall
uninstall:
script/uninstall
.PHONY: sort
sort:
script/sort
.PHONY: lint
lint:
script/lint
.PHONY: danger
danger:
script/danger
.PHONY: archive
archive:
script/archive
.PHONY: bottle
bottle:
script/bottle
.PHONY: package
package:
script/package
.PHONY: packageInstall
packageInstall:
script/package_install
.PHONY: release
release:
script/release
# .PHONY: describe
# describe:
# swift package describe
# .PHONY: resolve
# resolve:
# swift package resolve
# .PHONY: dependencies
# dependencies: resolve
# swift package show-dependencies
# .PHONY: update
# update: resolve
# swift package update
# .PHONY: xcproj
# xcproj:
# swift package generate-xcodeproj