-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
55 lines (45 loc) · 1.19 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
SHELL = /bin/bash
prefix ?= /usr/local
bindir ?= $(prefix)/bin
libdir ?= $(prefix)/lib
srcdir = Sources
REPODIR = $(shell pwd)
BUILDDIR = $(REPODIR)/.build
SOURCES = $(wildcard $(srcdir)/**/*.swift)
.DEFAULT_GOAL = all
.PHONY: all
all: build
.PHONY: build
build: $(SOURCES)
swift build \
--configuration debug \
--disable-sandbox \
--build-path "$(BUILDDIR)"
.PHONY: build-release
build-release: $(SOURCES)
swift build \
--configuration release \
--disable-sandbox \
--build-path "$(BUILDDIR)" \
--verbose \
-Xswiftc "-enforce-exclusivity=unchecked"
.PHONY: xcode
xcode:
swift package generate-xcodeproj
.PHONY: install
install: build
@install -d "$(bindir)" "$(libdir)"
@install "$(BUILDDIR)/release/swift-rewriter" "$(bindir)"
@install "$(BUILDDIR)/release/libSwiftSyntax.dylib" "$(libdir)"
@install_name_tool -change \
"$(BUILDDIR)/x86_64-apple-macosx10.10/release/libSwiftSyntax.dylib" \
"$(libdir)/libSwiftSyntax.dylib" \
"$(bindir)/swift-rewriter"
.PHONY: uninstall
uninstall:
@rm -rf "$(bindir)/swift-rewriter"
@rm -rf "$(libdir)/libSwiftSyntax.dylib"
.PHONY: bottle
bottle:
brew install inamiy/formulae/swift-rewriter --verbose --build-bottle
brew bottle swift-rewriter