forked from videolan/vlc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tools.mak
260 lines (191 loc) · 5.27 KB
/
tools.mak
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# Copyright (C) 2003-2011 the VideoLAN team
#
# This file is under the same license as the vlc package.
include packages.mak
#
# common rules
#
AUTOCONF=$(PREFIX)/bin/autoconf
export AUTOCONF
ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),)
download = curl -f -L -- "$(1)" > "$@"
else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),)
download = rm -f [email protected] && \
wget --passive -c -p -O [email protected] "$(1)" && \
touch [email protected] && \
mv [email protected] $@
else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),)
download = rm -f [email protected] && \
fetch -p -o [email protected] "$(1)" && \
touch [email protected] && \
mv [email protected] $@
else
download = $(error Neither curl nor wget found!)
endif
UNPACK = $(RM) -R $@ \
$(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \
$(foreach f,$(filter %.tar.bz2,$^), && tar xvjf $(f)) \
$(foreach f,$(filter %.tar.xz,$^), && tar xvJf $(f)) \
$(foreach f,$(filter %.zip,$^), && unzip $(f))
UNPACK_DIR = $(basename $(basename $(notdir $<)))
APPLY = (cd $(UNPACK_DIR) && patch -p1) <
MOVE = mv $(UNPACK_DIR) $@ && touch $@
#
# package rules
#
# yasm
yasm-$(YASM_VERSION).tar.gz:
$(call download,$(YASM_URL))
yasm: yasm-$(YASM_VERSION).tar.gz
$(UNPACK)
$(MOVE)
.yasm: yasm
(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
touch $@
CLEAN_FILE += .yasm
CLEAN_PKG += yasm
DISTCLEAN_PKG += yasm-$(YASM_VERSION).tar.gz
# cmake
cmake-$(CMAKE_VERSION).tar.gz:
$(call download,$(CMAKE_URL))
cmake: cmake-$(CMAKE_VERSION).tar.gz
$(UNPACK)
$(MOVE)
.cmake: cmake
(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
touch $@
CLEAN_FILE += .cmake
CLEAN_PKG += cmake
DISTCLEAN_PKG += cmake-$(CMAKE_VERSION).tar.gz
# libtool
libtool-$(LIBTOOL_VERSION).tar.gz:
$(call download,$(LIBTOOL_URL))
libtool: libtool-$(LIBTOOL_VERSION).tar.gz
$(UNPACK)
$(MOVE)
.libtool: libtool
(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
ln -sf libtool $(PREFIX)/bin/glibtool
ln -sf libtoolize $(PREFIX)/bin/glibtoolize
touch $@
CLEAN_PKG += libtool
DISTCLEAN_PKG += libtool-$(LIBTOOL_VERSION).tar.gz
CLEAN_FILE += .libtool
# GNU tar (with xz support)
tar-$(TAR_VERSION).tar.bz2:
$(call download,$(TAR_URL))
tar: tar-$(TAR_VERSION).tar.bz2
$(UNPACK)
$(MOVE)
.tar: tar
(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
touch $@
CLEAN_PKG += tar
DISTCLEAN_PKG += tar-$(TAR_VERSION).tar.bz2
CLEAN_FILE += .tar
# xz
xz-$(XZ_VERSION).tar.bz2:
$(call download,$(XZ_URL))
xz: xz-$(XZ_VERSION).tar.bz2
$(UNPACK)
$(MOVE)
.xz: xz
(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
touch $@
CLEAN_PKG += xz
DISTCLEAN_PKG += xz-$(XZ_VERSION).tar.bz2
CLEAN_FILE += .xz
# autoconf
autoconf-$(AUTOCONF_VERSION).tar.gz:
$(call download,$(AUTOCONF_URL))
autoconf: autoconf-$(AUTOCONF_VERSION).tar.gz
$(UNPACK)
$(MOVE)
.autoconf: autoconf .pkg-config
(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
touch $@
CLEAN_FILE += .autoconf
CLEAN_PKG += autoconf
DISTCLEAN_PKG += autoconf-$(AUTOCONF_VERSION).tar.gz
# automake
automake-$(AUTOMAKE_VERSION).tar.gz:
$(call download,$(AUTOMAKE_URL))
automake: automake-$(AUTOMAKE_VERSION).tar.gz
$(UNPACK)
$(MOVE)
.automake: automake .autoconf
(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
touch $@
CLEAN_FILE += .automake
CLEAN_PKG += automake
DISTCLEAN_PKG += automake-$(AUTOMAKE_VERSION).tar.gz
# m4
m4-$(M4_VERSION).tar.gz:
$(call download,$(M4_URL))
m4: m4-$(M4_VERSION).tar.gz
$(UNPACK)
$(MOVE)
.m4: m4
(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
touch $@
CLEAN_FILE += .m4
CLEAN_PKG += m4
DISTCLEAN_PKG += m4-$(M4_VERSION).tar.gz
# pkg-config
pkg-config-$(PKGCFG_VERSION).tar.gz:
$(call download,$(PKGCFG_URL))
pkgconfig: pkg-config-$(PKGCFG_VERSION).tar.gz
$(UNPACK)
mv pkg-config-lite-$(PKGCFG_VERSION) pkg-config-$(PKGCFG_VERSION)
$(MOVE)
.pkg-config: pkgconfig
(cd pkgconfig; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
touch $@
CLEAN_FILE += .pkg-config
CLEAN_PKG += pkgconfig
DISTCLEAN_PKG += pkg-config-$(PKGCFG_VERSION).tar.gz
# openssl
# we need to use -j1 here, since otherwise compilation fails (at least on Darwin)
openssl-$(OPENSSL_VERSION).tar.gz:
$(call download,$(OPENSSL_URL))
openssl: openssl-$(OPENSSL_VERSION).tar.gz
$(UNPACK)
$(MOVE)
.openssl: openssl
(cd openssl; ./config --prefix=$(PREFIX) no-shared no-zlib && make -j1 && make test && make install)
touch $@
CLEAN_FILE += .openssl
CLEAN_PKG += openssl
DISTCLEAN_PKG += openssl-$(OPENSSL_VERSION).tar.gz
# gas-preprocessor
gas-preprocessor-$(GAS_VERSION).tar.gz:
$(call download,$(GAS_URL))
gas: gas-preprocessor-$(GAS_VERSION).tar.gz
$(UNPACK)
$(MOVE)
.gas: gas
cp gas/gas-preprocessor.pl build/bin/
touch $@
CLEAN_FILE += .gas
CLEAN_PKG += gas
DISTCLEAN_PKG += yuvi-gas-preprocessor-$(GAS_VERSION).tar.gz
# Ragel State Machine Compiler
ragel-$(RAGEL_VERSION).tar.gz:
$(call download,$(RAGEL_URL))
ragel: ragel-$(RAGEL_VERSION).tar.gz
$(UNPACK)
$(MOVE)
.ragel: ragel
(cd ragel; ./configure --prefix=$(PREFIX) --disable-shared --enable-static && make && make install)
touch $@
CLEAN_FILE += .ragel
CLEAN_PKG += ragel
DISTCLEAN_PKG += ragel-$(RAGEL_VERSION).tar.gz
#
#
#
clean:
rm -fr $(CLEAN_FILE) $(CLEAN_PKG) build/
distclean: clean
rm -fr $(DISTCLEAN_PKG)
.PHONY: all clean distclean