-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
55 lines (44 loc) · 1.31 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
templatesdir = Templates
REPODIR = $(shell pwd)
BUILDDIR = $(REPODIR)/.build
GITHUBCIBUILDDIR = $(REPODIR)/.githubci-build
SOURCES = $(wildcard $(srcdir)/**/*.swift)
TEMPLATES = $(wildcard $(templatesdir)/*)
.DEFAULT_GOAL = all
.PHONY: all
all: coherent-swift
coherent-swift: $(SOURCES)
@swift build \
-c release \
--disable-sandbox \
--build-path "$(BUILDDIR)"
.PHONY: install
install: coherent-swift
@install -d "$(bindir)" "$(libdir)"
@install "$(BUILDDIR)/release/coherent-swift" "$(bindir)"
@mkdir -p "$(libdir)/coherent-swift/templates/"
@cp "$(TEMPLATES)" "$(libdir)/coherent-swift/templates/"
.PHONY: githubci-install
githubci-install:
@install -d "$(bindir)" "$(libdir)"
@install "$(GITHUBCIBUILDDIR)/release/coherent-swift" "$(bindir)"
@mkdir -p "$(libdir)/coherent-swift/templates/"
@cp "$(TEMPLATES)" "$(libdir)/coherent-swift/templates/"
.PHONY: prepare-githubci-build
prepare-githubci-build: coherent-swift
@cp "$(BUILDDIR)/release/coherent-swift" "$(GITHUBCIBUILDDIR)/release/coherent-swift"
.PHONY: uninstall
uninstall:
@rm -rf "$(bindir)/coherent-swift"
@rm -rf "$(libdir)/coherent-swift"
.PHONY: clean
distclean:
@rm -f $(BUILDDIR)/release
.PHONY: clean
clean: distclean
@rm -rf $(BUILDDIR)