-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathMakefile
37 lines (31 loc) · 828 Bytes
/
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
EXECUTABLE = set-simulator-location
ARCHIVE = $(EXECUTABLE).tar.gz
PREFIX ?= /usr/local/bin
SRCS = $(wildcard sources/*.swift)
$(EXECUTABLE): $(SRCS)
swiftc \
-warnings-as-errors \
-O -whole-module-optimization \
-o $(EXECUTABLE) \
-sdk $(shell xcrun --sdk macosx --show-sdk-path) \
-target x86_64-macosx10.10 \
$(SRCS)
.PHONY: install
install: $(EXECUTABLE)
install $(EXECUTABLE) "$(PREFIX)"
.PHONY: archive
archive: $(EXECUTABLE)
tar --create --preserve-permissions --gzip --file $(ARCHIVE) $(EXECUTABLE)
@shasum -a 256 $(EXECUTABLE)
@shasum -a 256 $(ARCHIVE)
.PHONY: xcode
xcode:
swift package generate-xcodeproj \
--xcconfig-overrides xcodeproj.xcconfig \
--output Project.xcodeproj
.PHONY: clean
clean:
rm -rf $(EXECUTABLE) $(ARCHIVE)
.PHONY: uninstall
uninstall:
rm "$(PREFIX)/$(EXECUTABLE)"