setup.py.mk revision 247
4239N/A#
4239N/A# CDDL HEADER START
4239N/A#
4239N/A# The contents of this file are subject to the terms of the
4239N/A# Common Development and Distribution License (the "License").
4239N/A# You may not use this file except in compliance with the License.
4239N/A#
4239N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4239N/A# or http://www.opensolaris.org/os/licensing.
4239N/A# See the License for the specific language governing permissions
4239N/A# and limitations under the License.
4239N/A#
4239N/A# When distributing Covered Code, include this CDDL HEADER in each
4239N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4239N/A# If applicable, add the following below this CDDL HEADER, with the
4239N/A# fields enclosed by brackets "[]" replaced with your own identifying
4239N/A# information: Portions Copyright [yyyy] [name of copyright owner]
4239N/A#
4239N/A# CDDL HEADER END
4239N/A#
4239N/A# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
4239N/A#
4239N/A
4239N/A$(BUILD_DIR)/%-2.6/.built: PYTHON_VERSION=2.6
4239N/A$(BUILD_DIR)/$(MACH32)-%/.built: BITS=32
4239N/A$(BUILD_DIR)/$(MACH64)-%/.built: BITS=64
4239N/A
4239N/A$(BUILD_DIR)/%-2.6/.installed: PYTHON_VERSION=2.6
4239N/A$(BUILD_DIR)/$(MACH32)-%/.installed: BITS=32
4239N/A$(BUILD_DIR)/$(MACH64)-%/.installed: BITS=64
4239N/A
4239N/ABUILD_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.built)
4239N/ABUILD_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
4239N/A
4239N/AINSTALL_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.installed)
4239N/AINSTALL_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
4239N/A
4239N/APYTHON_ENV = CC="$(CC)"
4239N/APYTHON_ENV += CFLAGS="$(CFLAGS)"
4239N/A
4239N/A# build the configured source
4239N/A$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
4239N/A $(RM) -r $(@D) ; $(MKDIR) $(@D)
4239N/A $(COMPONENT_PRE_BUILD_ACTION)
4239N/A (cd $(SOURCE_DIR) ; $(ENV) $(PYTHON_ENV) \
4239N/A $(PYTHON.$(BITS)) ./setup.py build \
4239N/A --build-temp $(@D:$(BUILD_DIR)/%=%))
4239N/A $(COMPONENT_POST_BUILD_ACTION)
4239N/A $(TOUCH) $@
4239N/A
4239N/A
4239N/ACOMPONENT_INSTALL_ARGS += --root $(PROTO_DIR)
4239N/ACOMPONENT_INSTALL_ARGS += --install-lib=$(PYTHON_LIB)
4239N/A
4239N/A# install the built source into a prototype area
4239N/A$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
4239N/A $(COMPONENT_PRE_INSTALL_ACTION)
4239N/A (cd $(SOURCE_DIR) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
4239N/A $(PYTHON.$(BITS)) ./setup.py install $(COMPONENT_INSTALL_ARGS))
4239N/A $(COMPONENT_POST_INSTALL_ACTION)
4239N/A $(TOUCH) $@
4239N/A
4239N/ACOMPONENT_TEST_DEP = $(BUILD_DIR)/%/.installed
4239N/ACOMPONENT_TEST_DIR = $(COMPONENT_SRC)/test
4239N/ACOMPONENT_TEST_ENV_CMD = $(ENV) -
4239N/ACOMPONENT_TEST_ENV += PYTHONPATH=$(PROTO_DIR)$(PYTHON_VENDOR_PACKAGES)
4239N/ACOMPONENT_TEST_CMD = $(PYTHON)
4239N/ACOMPONENT_TEST_ARGS += ./runtests.py
4239N/A
4239N/A# test the built source
4239N/A$(BUILD_DIR)/%/.tested: $(COMPONENT_TEST_DEP)
4239N/A $(COMPONENT_PRE_TEST_ACTION)
4239N/A (cd $(COMPONENT_TEST_DIR); $(COMPONENT_TEST_ENV_CMD) \
4239N/A $(COMPONENT_TEST_ENV) \
4239N/A $(COMPONENT_TEST_CMD) $(COMPONENT_TEST_ARGS) )
4239N/A $(COMPONENT_POST_TEST_ACTION)
4239N/A $(TOUCH) $@
4239N/A
4239N/Aclean::
4239N/A $(RM) -r $(SOURCE_DIR) $(BUILD_DIR)
4239N/A