-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
46 lines (37 loc) · 995 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
38
39
40
41
42
43
44
45
46
SHELL = /bin/bash
prefix ?= /usr/local
bindir = $(prefix)/bin
libdir = $(prefix)/lib
srcdir = Sources
REPODIR = $(shell pwd)
BUILDDIR = $(REPODIR)/.build
RELEASEDIR = $(BUILDDIR)/release
SOURCES = $(wildcard $(srcdir)/**/*.swift)
.DEFAULT_GOAL = all
.PHONY: all
all: xmljson install
xmljson: $(SOURCES)
@swift build \
-c release \
--disable-sandbox \
--build-path "$(BUILDDIR)"
.PHONY: install
install: xmljson
@install -d "$(bindir)" "$(libdir)"
@install "$(RELEASEDIR)/xmljson" "$(bindir)"
@install "$(RELEASEDIR)/libSwiftToolsSupport.dylib" "$(libdir)"
@install_name_tool -change \
".build/x86_64-apple-macosx10.10/release/libSwiftToolsSupport.dylib" \
"$(libdir)/libSwiftToolsSupport.dylib" \
"$(bindir)/xmljson"
echo "xmljson has been sucessfully installed."
.PHONY: uninstall
uninstall:
@rm -rf "$(bindir)/xmljson"
@rm -rf "$(libdir)/libSwiftToolsSupport.dylib"
.PHONY: clean
distclean:
@rm -f $(RELEASEDIR)
.PHONY: clean
clean: distclean
@rm -rf $(BUILDDIR)