commit | author | age
|
9c75c0
|
1 |
# |
NJ |
2 |
# CDDL HEADER START |
|
3 |
# |
|
4 |
# The contents of this file are subject to the terms of the |
|
5 |
# Common Development and Distribution License (the "License"). |
|
6 |
# You may not use this file except in compliance with the License. |
|
7 |
# |
|
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
# or http://www.opensolaris.org/os/licensing. |
|
10 |
# See the License for the specific language governing permissions |
|
11 |
# and limitations under the License. |
|
12 |
# |
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
# If applicable, add the following below this CDDL HEADER, with the |
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
# |
|
19 |
# CDDL HEADER END |
|
20 |
# |
8d70f8
|
21 |
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. |
9c75c0
|
22 |
# |
NJ |
23 |
|
74300c
|
24 |
$(BUILD_DIR)/%-2.6/.built: PYTHON_VERSION=2.6 |
fa74c0
|
25 |
$(BUILD_DIR)/%-2.7/.built: PYTHON_VERSION=2.7 |
8d70f8
|
26 |
$(BUILD_DIR)/%-3.4/.built: PYTHON_VERSION=3.4 |
74300c
|
27 |
$(BUILD_DIR)/$(MACH32)-%/.built: BITS=32 |
NJ |
28 |
$(BUILD_DIR)/$(MACH64)-%/.built: BITS=64 |
9c75c0
|
29 |
|
4158c0
|
30 |
$(BUILD_DIR)/%-2.6/.installed: PYTHON_VERSION=2.6 |
fa74c0
|
31 |
$(BUILD_DIR)/%-2.7/.installed: PYTHON_VERSION=2.7 |
8d70f8
|
32 |
$(BUILD_DIR)/%-3.4/.installed: PYTHON_VERSION=3.4 |
74300c
|
33 |
$(BUILD_DIR)/$(MACH32)-%/.installed: BITS=32 |
NJ |
34 |
$(BUILD_DIR)/$(MACH64)-%/.installed: BITS=64 |
8d70f8
|
35 |
|
RB |
36 |
$(BUILD_DIR)/%-2.6/.tested: PYTHON_VERSION=2.6 |
|
37 |
$(BUILD_DIR)/%-2.7/.tested: PYTHON_VERSION=2.7 |
|
38 |
$(BUILD_DIR)/%-3.4/.tested: PYTHON_VERSION=3.4 |
|
39 |
$(BUILD_DIR)/$(MACH32)-%/.tested: BITS=32 |
|
40 |
$(BUILD_DIR)/$(MACH64)-%/.tested: BITS=64 |
|
41 |
|
|
42 |
$(BUILD_DIR)/%-2.6/.tested-and-compared: PYTHON_VERSION=2.6 |
|
43 |
$(BUILD_DIR)/%-2.7/.tested-and-compared: PYTHON_VERSION=2.7 |
|
44 |
$(BUILD_DIR)/%-3.4/.tested-and-compared: PYTHON_VERSION=3.4 |
|
45 |
$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared: BITS=32 |
|
46 |
$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared: BITS=64 |
224ba0
|
47 |
|
74300c
|
48 |
BUILD_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.built) |
NJ |
49 |
BUILD_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.built) |
ad2fa3
|
50 |
BUILD_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.built) |
224ba0
|
51 |
|
74300c
|
52 |
INSTALL_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.installed) |
NJ |
53 |
INSTALL_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.installed) |
ad2fa3
|
54 |
INSTALL_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.installed) |
9c75c0
|
55 |
|
35a012
|
56 |
PYTHON_ENV = CC="$(CC)" |
NJ |
57 |
PYTHON_ENV += CFLAGS="$(CFLAGS)" |
ad2fa3
|
58 |
|
NJ |
59 |
COMPONENT_BUILD_ENV += $(PYTHON_ENV) |
|
60 |
COMPONENT_INSTALL_ENV += $(PYTHON_ENV) |
|
61 |
COMPONENT_TEST_ENV += $(PYTHON_ENV) |
fa74c0
|
62 |
|
253d56
|
63 |
# Reset arguments specified as environmnent variables |
AS |
64 |
COMPONENT_BUILD_ARGS = |
|
65 |
|
8d70f8
|
66 |
# If we are building Python 2.7 or 3.4 support, build them and install them |
RB |
67 |
# before Python 2.6, so 2.6 is installed last and is the canonical version. |
|
68 |
# When we change the default, the new default should go last. |
fa74c0
|
69 |
ifneq ($(findstring 2.7,$(PYTHON_VERSIONS)),) |
8d70f8
|
70 |
$(BUILD_DIR)/%-2.6/.built: $(BUILD_DIR)/%-2.7/.built |
RB |
71 |
$(BUILD_DIR)/%-2.6/.installed: $(BUILD_DIR)/%-2.7/.installed |
|
72 |
endif |
|
73 |
ifneq ($(findstring 3.4,$(PYTHON_VERSIONS)),) |
|
74 |
$(BUILD_DIR)/%-2.6/.built: $(BUILD_DIR)/%-3.4/.built |
|
75 |
$(BUILD_DIR)/%-2.6/.installed: $(BUILD_DIR)/%-3.4/.installed |
fa74c0
|
76 |
endif |
35a012
|
77 |
|
a7216a
|
78 |
# Create a distutils config file specific to the combination of build |
DD |
79 |
# characteristics (bittedness x Python version), and put it in its own |
|
80 |
# directory. We can set $HOME to point distutils at it later, allowing |
|
81 |
# the install phase to find the temporary build directories. |
|
82 |
CFG=.pydistutils.cfg |
|
83 |
$(BUILD_DIR)/config-%/$(CFG): |
|
84 |
$(MKDIR) $(@D) |
|
85 |
echo "[build]\nbuild_base = $(BUILD_DIR)/$*" > $@ |
|
86 |
|
9c75c0
|
87 |
# build the configured source |
a7216a
|
88 |
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep $(BUILD_DIR)/config-%/$(CFG) |
9c75c0
|
89 |
$(RM) -r $(@D) ; $(MKDIR) $(@D) |
NJ |
90 |
$(COMPONENT_PRE_BUILD_ACTION) |
ad2fa3
|
91 |
(cd $(SOURCE_DIR) ; $(ENV) HOME=$(BUILD_DIR)/config-$* $(COMPONENT_BUILD_ENV) \ |
9b6294
|
92 |
$(PYTHON.$(BITS)) ./setup.py build $(COMPONENT_BUILD_ARGS)) |
9c75c0
|
93 |
$(COMPONENT_POST_BUILD_ACTION) |
7999b2
|
94 |
ifeq ($(strip $(PARFAIT_BUILD)),yes) |
MS |
95 |
-$(PARFAIT) $(SOURCE_DIR)/$(@D:$(BUILD_DIR)/%=%) |
|
96 |
endif |
9c75c0
|
97 |
$(TOUCH) $@ |
NJ |
98 |
|
ff17eb
|
99 |
|
e83e52
|
100 |
COMPONENT_INSTALL_ARGS += --root $(PROTO_DIR) |
NJ |
101 |
COMPONENT_INSTALL_ARGS += --install-lib=$(PYTHON_LIB) |
fa74c0
|
102 |
COMPONENT_INSTALL_ARGS += --install-purelib=$(PYTHON_LIB) |
NJ |
103 |
COMPONENT_INSTALL_ARGS += --install-platlib=$(PYTHON_LIB) |
|
104 |
COMPONENT_INSTALL_ARGS += --install-data=$(PYTHON_DATA) |
|
105 |
COMPONENT_INSTALL_ARGS += --force |
e83e52
|
106 |
|
9c75c0
|
107 |
# install the built source into a prototype area |
a7216a
|
108 |
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built $(BUILD_DIR)/config-%/$(CFG) |
9c75c0
|
109 |
$(COMPONENT_PRE_INSTALL_ACTION) |
a7216a
|
110 |
(cd $(SOURCE_DIR) ; $(ENV) HOME=$(BUILD_DIR)/config-$* $(COMPONENT_INSTALL_ENV) \ |
e83e52
|
111 |
$(PYTHON.$(BITS)) ./setup.py install $(COMPONENT_INSTALL_ARGS)) |
9c75c0
|
112 |
$(COMPONENT_POST_INSTALL_ACTION) |
NJ |
113 |
$(TOUCH) $@ |
e83e52
|
114 |
|
8d70f8
|
115 |
# Define bit specific and Python version specific filenames. |
RB |
116 |
COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-$(PYTHON_VERSION)-$(BITS).master |
|
117 |
COMPONENT_TEST_OUTPUT = $(COMPONENT_TEST_RESULTS_DIR)/test-$(PYTHON_VERSION)-$(BITS)-results |
|
118 |
COMPONENT_TEST_DIFFS = $(COMPONENT_TEST_RESULTS_DIR)/test-$(PYTHON_VERSION)-$(BITS)-diffs |
|
119 |
COMPONENT_TEST_SNAPSHOT = $(COMPONENT_TEST_RESULTS_DIR)/results-$(PYTHON_VERSION)-$(BITS).snapshot |
|
120 |
COMPONENT_TEST_TRANSFORM_CMD = $(COMPONENT_TEST_RESULTS_DIR)/transform-$(PYTHON_VERSION)-$(BITS)-results |
|
121 |
|
59c102
|
122 |
COMPONENT_TEST_DEP = $(BUILD_DIR)/%/.installed |
AC |
123 |
COMPONENT_TEST_DIR = $(COMPONENT_SRC)/test |
8d70f8
|
124 |
COMPONENT_TEST_ENV_CMD = $(ENV) |
59c102
|
125 |
COMPONENT_TEST_ENV += PYTHONPATH=$(PROTO_DIR)$(PYTHON_VENDOR_PACKAGES) |
AC |
126 |
COMPONENT_TEST_CMD = $(PYTHON) |
|
127 |
COMPONENT_TEST_ARGS += ./runtests.py |
|
128 |
|
8d70f8
|
129 |
# determine the type of tests we want to run. |
RB |
130 |
ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR)/results-*.master)),) |
|
131 |
TEST_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested) |
|
132 |
TEST_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested) |
|
133 |
TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested) |
|
134 |
else |
|
135 |
TEST_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.tested-and-compared) |
|
136 |
TEST_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.tested-and-compared) |
|
137 |
TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested-and-compared) |
|
138 |
endif |
|
139 |
|
59c102
|
140 |
# test the built source |
8d70f8
|
141 |
$(BUILD_DIR)/%/.tested-and-compared: $(COMPONENT_TEST_DEP) |
59c102
|
142 |
$(COMPONENT_PRE_TEST_ACTION) |
8d70f8
|
143 |
-(cd $(COMPONENT_TEST_DIR) ; \ |
RB |
144 |
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \ |
|
145 |
$(COMPONENT_TEST_CMD) $(COMPONENT_TEST_ARGS)) \ |
|
146 |
&> $(COMPONENT_TEST_OUTPUT) |
59c102
|
147 |
$(COMPONENT_POST_TEST_ACTION) |
8d70f8
|
148 |
$(COMPONENT_TEST_CREATE_TRANSFORMS) |
RB |
149 |
$(COMPONENT_TEST_PERFORM_TRANSFORM) |
|
150 |
$(COMPONENT_TEST_COMPARE) |
|
151 |
$(COMPONENT_TEST_CLEANUP) |
|
152 |
$(TOUCH) $@ |
|
153 |
|
|
154 |
$(BUILD_DIR)/%/.tested: $(COMPONENT_TEST_DEP) |
|
155 |
$(COMPONENT_PRE_TEST_ACTION) |
|
156 |
(cd $(COMPONENT_TEST_DIR) ; \ |
|
157 |
$(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \ |
|
158 |
$(COMPONENT_TEST_CMD) $(COMPONENT_TEST_ARGS)) |
|
159 |
$(COMPONENT_POST_TEST_ACTION) |
|
160 |
$(COMPONENT_TEST_CLEANUP) |
59c102
|
161 |
$(TOUCH) $@ |
AC |
162 |
|
7999b2
|
163 |
ifeq ($(strip $(PARFAIT_BUILD)),yes) |
MS |
164 |
parfait: install |
|
165 |
-$(PARFAIT) build |
|
166 |
else |
|
167 |
parfait: |
|
168 |
$(MAKE) PARFAIT_BUILD=yes parfait |
|
169 |
endif |
|
170 |
|
35a012
|
171 |
clean:: |
NJ |
172 |
$(RM) -r $(SOURCE_DIR) $(BUILD_DIR) |
6005c4
|
173 |
|
JB |
174 |
# Make it easy to construct a URL for a pypi source download. |
|
175 |
PYPI_BASE = http://pypi.python.org/packages/source |
|
176 |
pypi_url = $(PYPI_BASE)/$(shell echo $(COMPONENT_NAME) | cut -c1)/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE) |