-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
66 lines (53 loc) · 1.6 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
BINDIR_PREFIX?=/usr/local
SIMCTLCLI_NAME = SimctlCLI
.PHONY: lint-fix
lint-fix:
swiftlint --fix --format
swiftlint lint --quiet
.PHONY: buildRelease
buildRelease:
swift build -c release
.PHONY: buildSimctlCLI
buildSimctlCLI:
@printf "Building SimctlCLI..."
@swift build -Xswiftc -Osize -Xswiftc -whole-module-optimization -c release --product $(SIMCTLCLI_NAME)
@cp "`swift build -c release --product $(SIMCTLCLI_NAME) --show-bin-path`/$(SIMCTLCLI_NAME)" ./bin
@echo "Done"
.PHONY: cleanBuildSimctlCLI
cleanBuildSimctlCLI: cleanArtifacts buildSimctlCLI
.PHONY: installSimctlCLI
installSimctlCLI: buildSimctlCLI
@mkdir -p $(BINDIR_PREFIX)/bin
@install `swift build -c release --product $(SIMCTLCLI_NAME) --show-bin-path`/$(SIMCTLCLI_NAME) $(BINDIR_PREFIX)/bin
@echo "Installed $(SIMCTLCLI_NAME) to $(BINDIR_PREFIX)/bin/$(SIMCTLCLI_NAME)"
.PHONY: uninstallSimctlCLI
uninstallSimctlCLI:
@rm -f $(BINDIR_PREFIX)/bin/$(SIMCTLCLI_NAME)
@echo "Removed $(BINDIR_PREFIX)/bin/$(SIMCTLCLI_NAME)"
.PHONY: precommit
precommit: lint-fix
.PHONY: genLinuxTests
genLinuxTests:
swift test --generate-linuxmain
swiftlint --fix --format --path Tests/
.PHONY: test
test: genLinuxTests
swift test
.PHONY: genXcode
genXcode:
swift package generate-xcodeproj --enable-code-coverage --skip-extra-files
.PHONY: clean
clean:
swift package reset
rm -rdf .swiftpm/xcode
rm -rdf .build/
rm Package.resolved
rm .DS_Store
.PHONY: cleanArtifacts
cleanArtifacts:
swift package clean
# Test links in README
# requires <https://github.com/tcort/markdown-link-check>
.PHONY: testReadme
testReadme:
markdown-link-check -p -v ./README.md