-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
223 lines (197 loc) · 5.28 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
NAME=swift
VERSION=3.1
BUILD=RELEASE
ITERATION=1.lru
PREFIX=/usr/local
LICENSE=Apache-2.0
VENDOR="Swift Core Team"
MAINTAINER="Ryan Parman"
DESCRIPTION="Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns."
URL=https://swift.org
RHEL=$(shell rpm -q --queryformat '%{VERSION}' centos-release)
# https://swift.org/source-code/
# http://www.swiftprogrammer.info/swift_centos_1.html
# https://github.com/FedoraSwift/fedora-swift
# https://lists.swift.org/pipermail/swift-users/Week-of-Mon-20161205/004155.html
#-------------------------------------------------------------------------------
all: info clean install-deps compile
# all: info clean install-deps compile install-tmp package move
#-------------------------------------------------------------------------------
.PHONY: info
info:
@ echo "NAME: $(NAME)"
@ echo "VERSION: $(VERSION)"
@ echo "BUILD: $(BUILD)"
@ echo "ITERATION: $(ITERATION)"
@ echo "PREFIX: $(PREFIX)"
@ echo "LICENSE: $(LICENSE)"
@ echo "VENDOR: $(VENDOR)"
@ echo "MAINTAINER: $(MAINTAINER)"
@ echo "DESCRIPTION: $(DESCRIPTION)"
@ echo "URL: $(URL)"
@ echo "RHEL: $(RHEL)"
@ echo " "
#-------------------------------------------------------------------------------
.PHONY: clean
clean:
rm -Rf /tmp/installdir* swift*/ blocksruntime/ build/ clang/ cmark/ compiler-rt/ llbuild/ lldb/ llvm/ ninja/
#-------------------------------------------------------------------------------
.PHONY: install-deps
install-deps:
yum -y remove cmake;
yum -y install \
cmake \
gcc-c++ \
git \
icu \
libbsd-devel \
libcurl-devel \
libedit-devel \
libicu-devel \
libuuid-devel \
libxml2-devel \
llvm \
llvm-ocaml-devel \
ninja-build \
ncurses-devel \
ncurses-libs \
ocaml \
openssl-devel \
pkgconfig \
python-devel \
python27-devel \
python3-devel \
sqlite-devel \
swig \
uuid-devel \
;
pip install --upgrade pip sphinx;
# Addresses the libblocksruntime-dev dependency for Ubuntu
git clone -q https://github.com/mackyle/blocksruntime.git --recursive;
cd blocksruntime && \
git checkout b5c5274daf1e0e46ecc9ad8f6f69889bce0a0a5d && \
./buildlib && \
env prefix=$(PREFIX) ./installlib \
;
# Addresses the ninja-build dependency for Ubuntu
git clone -q -b release https://github.com/ninja-build/ninja.git;
#-------------------------------------------------------------------------------
.PHONY: compile
compile:
git clone -q -b swift-$(VERSION)-$(BUILD) https://github.com/apple/swift.git;
cd swift && \
./utils/update-checkout --clone --reset-to-remote --clean && \
./utils/build-script -r -t \
;
#-------------------------------------------------------------------------------
.PHONY: install-tmp
install-tmp:
mkdir -p /tmp/installdir-$(NAME)-$(VERSION);
cd ruby && \
make install DESTDIR=/tmp/installdir-$(NAME)-$(VERSION);
#-------------------------------------------------------------------------------
.PHONY: package
package:
# Libs package
fpm \
-f \
-s dir \
-t rpm \
-n $(NAME)-libs \
-v $(VERSION) \
-C /tmp/installdir-$(NAME)-$(VERSION) \
-m $(MAINTAINER) \
--iteration $(ITERATION) \
--license $(LICENSE) \
--vendor $(VENDOR) \
--prefix / \
--url $(URL) \
--description $(DESCRIPTION) \
--rpm-defattrdir 0755 \
--rpm-digest md5 \
--rpm-compression gzip \
--rpm-os linux \
--rpm-changelog CHANGELOG.txt \
--rpm-dist el$(RHEL) \
--rpm-auto-add-directories \
usr/local/lib \
;
# Main package
fpm \
-f \
-d "$(NAME)-libs = $(EPOCH):$(VERSION)-$(ITERATION).el$(RHEL)" \
-s dir \
-t rpm \
-n $(NAME) \
-v $(VERSION) \
-C /tmp/installdir-$(NAME)-$(VERSION) \
-m $(MAINTAINER) \
--iteration $(ITERATION) \
--license $(LICENSE) \
--vendor $(VENDOR) \
--prefix / \
--url $(URL) \
--description $(DESCRIPTION) \
--rpm-defattrdir 0755 \
--rpm-digest md5 \
--rpm-compression gzip \
--rpm-os linux \
--rpm-changelog CHANGELOG.txt \
--rpm-dist el$(RHEL) \
--rpm-auto-add-directories \
usr/local/bin \
;
# Development package
fpm \
-f \
-d "$(NAME) = $(EPOCH):$(VERSION)-$(ITERATION).el$(RHEL)" \
-s dir \
-t rpm \
-n $(NAME)-devel \
-v $(VERSION) \
-C /tmp/installdir-$(NAME)-$(VERSION) \
-m $(MAINTAINER) \
--iteration $(ITERATION) \
--license $(LICENSE) \
--vendor $(VENDOR) \
--prefix / \
--url $(URL) \
--description $(DESCRIPTION) \
--rpm-defattrdir 0755 \
--rpm-digest md5 \
--rpm-compression gzip \
--rpm-os linux \
--rpm-changelog CHANGELOG.txt \
--rpm-dist el$(RHEL) \
--rpm-auto-add-directories \
usr/local/include \
;
# Documentation package
fpm \
-f \
-d "$(NAME) = $(EPOCH):$(VERSION)-$(ITERATION).el$(RHEL)" \
-s dir \
-t rpm \
-n $(NAME)-doc \
-v $(VERSION) \
-C /tmp/installdir-$(NAME)-$(VERSION) \
-m $(MAINTAINER) \
--iteration $(ITERATION) \
--license $(LICENSE) \
--vendor $(VENDOR) \
--prefix / \
--url $(URL) \
--description $(DESCRIPTION) \
--rpm-defattrdir 0755 \
--rpm-digest md5 \
--rpm-compression gzip \
--rpm-os linux \
--rpm-changelog CHANGELOG.txt \
--rpm-dist el$(RHEL) \
--rpm-auto-add-directories \
usr/local/share \
;
#-------------------------------------------------------------------------------
.PHONY: move
move:
mv *.rpm /vagrant/repo/