forked from buildout/buildout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (45 loc) · 1.4 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
HERE = $(shell pwd)
PYTHON_VER ?= 2.7
PYTHON_PATH = $(HERE)/pythons/$(PYTHON_VER)
PYTHON_BUILD_DIR = $(HERE)/python_builds
ifeq ($(PYTHON_VER),2.7)
PYTHON_MINOR ?= 2.7.13
endif
ifeq ($(PYTHON_VER),3.4)
PYTHON_MINOR ?= 3.4.6
PYTHON_CONFIGURE_ARGS ?= --without-ensurepip
endif
ifeq ($(PYTHON_VER),3.5)
PYTHON_MINOR ?= 3.5.3
PYTHON_CONFIGURE_ARGS ?= --without-ensurepip
endif
ifeq ($(PYTHON_VER),3.6)
PYTHON_MINOR ?= 3.6.0
PYTHON_CONFIGURE_ARGS ?= --without-ensurepip
endif
ifndef PYTHON_MINOR
$(error Please specify desired PYTHON_MINOR for Python $(PYTHON_VER))
endif
PYTHON_ARCHIVE ?= Python-$(PYTHON_MINOR)
PYTHON_DOWNLOAD = https://www.python.org/ftp/python/$(PYTHON_MINOR)/$(PYTHON_ARCHIVE).tgz
PYTHON_EXE = python$(PYTHON_VER)
.PHONY: all build test
BUILD_DIRS = $(PYTHON_PATH) bin build develop-eggs eggs parts
all: build
$(PYTHON_PATH)/bin/$(PYTHON_EXE):
@echo "Installing Python"
mkdir -p $(PYTHON_PATH)
mkdir -p $(PYTHON_BUILD_DIR)
cd $(PYTHON_BUILD_DIR) && \
curl --progress-bar --location $(PYTHON_DOWNLOAD) | tar -zx
cd $(PYTHON_BUILD_DIR)/$(PYTHON_ARCHIVE) && \
./configure --prefix $(PYTHON_PATH) $(PYTHON_CONFIGURE_ARGS) >/dev/null 2>&1 && \
make >/dev/null 2>&1 && \
make install >/dev/null 2>&1
@echo "Finished installing Python"
build: $(PYTHON_PATH)/bin/$(PYTHON_EXE)
$(PYTHON_PATH)/bin/$(PYTHON_EXE) dev.py
clean:
rm -rf $(BUILD_DIRS) $(PYTHON_BUILD_DIR)
test:
$(HERE)/bin/test -1 -vvv