-
Notifications
You must be signed in to change notification settings - Fork 68
/
Makefile
96 lines (69 loc) · 2 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
## Setup.
all: build
# Get configuration.
mk/env.mk: env
@bash --noprofile --norc -c 'source ./env; set -o posix; set' | egrep '^(ANDROID|SDK|NDK|BUILD|TEST|PYTHON)_' > $@
-include mk/env.mk
# A formula.
define formula
$1: $1-$2
$1-$2: ndk $3
$$(info Checking $1 $2 sources...)
@wget -N -P "src/" -i "mk/$1/$2/sources.txt"
ifeq ("$$(wildcard build/.built-$(BUILD_IDENTIFIER)/$1-$2)","")
$$(info Building $1 $2...)
@bash --noprofile --norc mk/build_single.sh $1 $2
@touch build/.built-$(BUILD_IDENTIFIER)/$1-$2
endif
endef
## Building.
build: python_modules python
# Main Python.
$(eval $(call formula,python,3.4.3))
# Optional Python modules.
python_modules: $(foreach mod,$(subst ',,$(PYTHON_OPTIONAL_MODULES)),python_$(mod))
# Python lzma support.
$(eval $(call formula,xz,5.2.1))
python_lzma: xz
# Python bzip2 support.
$(eval $(call formula,bzip2,1.0.6))
python_bz2: bzip2
# Python readline support.
$(eval $(call formula,readline,6.3))
python_readline: readline
# Python SSL support.
$(eval $(call formula,openssl,1.0.2d))
python_ssl: openssl
# Python curses support.
$(eval $(call formula,ncurses,5.9))
python_curses: ncurses
# Python SQLite support.
$(eval $(call formula,sqlite,3.8.10.2))
python_sqlite3: sqlite
# Python (g)dbm support.
$(eval $(call formula,gdbm,1.11))
python_gdbm: gdbm
# Android NDK.
ndk:
$(info Checking NDK sources...)
@wget -N -P "sdk/" $(shell bash mk/ndk_source.sh)
ifeq ("$(wildcard build/.built-ndk-$(BUILD_IDENTIFIER))","")
$(info Preparing NDK toolchain...)
@bash --noprofile --norc mk/build_ndk.sh
@touch build/.built-ndk-$(BUILD_IDENTIFIER)
endif
## Cleaning.
clean: clean_generated clean_builds
@rm -rf "$(ANDROID_TEST_PREFIX)"
@rm -rf "$(ANDROID_TOOL_PREFIX)"
clean_generated:
@find ./src -mindepth 1 -maxdepth 1 -type d -exec rm -rf "{}" \;
clean_builds:
@rm -rf "$(ANDROID_PREFIX)"
## Testing.
test: test_setup
@bash --noprofile --norc mk/test.sh
test_setup:
ifeq ("$(wildcard build-vm/$(TEST_IDENTIFIER))","")
@bash --noprofile --norc mk/test_setup.sh
endif