make-rules/setup.py.mk
branchs11-update
changeset 2693 2aa48dc32866
parent 2692 ee922fed53a7
child 2855 576d5a7857b7
equal deleted inserted replaced
2692:ee922fed53a7 2693:2aa48dc32866
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    18 #
    18 #
    19 # CDDL HEADER END
    19 # CDDL HEADER END
    20 #
    20 #
    21 # Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
    21 # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
    22 #
    22 #
    23 
    23 
    24 $(BUILD_DIR)/%-2.6/.built:		PYTHON_VERSION=2.6
    24 $(BUILD_DIR)/%-2.6/.built:		PYTHON_VERSION=2.6
    25 $(BUILD_DIR)/%-2.7/.built:		PYTHON_VERSION=2.7
    25 $(BUILD_DIR)/%-2.7/.built:		PYTHON_VERSION=2.7
    26 $(BUILD_DIR)/$(MACH32)-%/.built:	BITS=32
    26 $(BUILD_DIR)/$(MACH32)-%/.built:	BITS=32
    31 $(BUILD_DIR)/$(MACH32)-%/.installed:	BITS=32
    31 $(BUILD_DIR)/$(MACH32)-%/.installed:	BITS=32
    32 $(BUILD_DIR)/$(MACH64)-%/.installed:	BITS=64
    32 $(BUILD_DIR)/$(MACH64)-%/.installed:	BITS=64
    33 
    33 
    34 BUILD_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.built)
    34 BUILD_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.built)
    35 BUILD_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
    35 BUILD_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.built)
       
    36 BUILD_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.built)
    36 
    37 
    37 INSTALL_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.installed)
    38 INSTALL_32 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH32)-%/.installed)
    38 INSTALL_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
    39 INSTALL_64 = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH64)-%/.installed)
       
    40 INSTALL_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.installed)
       
    41 
       
    42 TEST_NO_ARCH = $(PYTHON_VERSIONS:%=$(BUILD_DIR)/$(MACH)-%/.tested)
    39 
    43 
    40 PYTHON_ENV =	CC="$(CC)"
    44 PYTHON_ENV =	CC="$(CC)"
    41 PYTHON_ENV +=	CFLAGS="$(CFLAGS)"
    45 PYTHON_ENV +=	CFLAGS="$(CFLAGS)"
       
    46 
       
    47 COMPONENT_BUILD_ENV += $(PYTHON_ENV)
       
    48 COMPONENT_INSTALL_ENV += $(PYTHON_ENV)
       
    49 COMPONENT_TEST_ENV += $(PYTHON_ENV)
    42 
    50 
    43 # if we are building python 2.7 support, build it and install it first
    51 # if we are building python 2.7 support, build it and install it first
    44 # so that python 2.6 is installed last and is the canonical version.
    52 # so that python 2.6 is installed last and is the canonical version.
    45 # when we switch to 2.7 as the default, it should go last.
    53 # when we switch to 2.7 as the default, it should go last.
    46 ifneq ($(findstring 2.7,$(PYTHON_VERSIONS)),)
    54 ifneq ($(findstring 2.7,$(PYTHON_VERSIONS)),)
    59 
    67 
    60 # build the configured source
    68 # build the configured source
    61 $(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep $(BUILD_DIR)/config-%/$(CFG)
    69 $(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep $(BUILD_DIR)/config-%/$(CFG)
    62 	$(RM) -r $(@D) ; $(MKDIR) $(@D)
    70 	$(RM) -r $(@D) ; $(MKDIR) $(@D)
    63 	$(COMPONENT_PRE_BUILD_ACTION)
    71 	$(COMPONENT_PRE_BUILD_ACTION)
    64 	(cd $(SOURCE_DIR) ; $(ENV) HOME=$(BUILD_DIR)/config-$* $(PYTHON_ENV) \
    72 	(cd $(SOURCE_DIR) ; $(ENV) HOME=$(BUILD_DIR)/config-$* $(COMPONENT_BUILD_ENV) \
    65 		$(PYTHON.$(BITS)) ./setup.py build)
    73 		$(PYTHON.$(BITS)) ./setup.py build)
    66 	$(COMPONENT_POST_BUILD_ACTION)
    74 	$(COMPONENT_POST_BUILD_ACTION)
    67 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
    75 ifeq   ($(strip $(PARFAIT_BUILD)),yes)
    68 	-$(PARFAIT) $(SOURCE_DIR)/$(@D:$(BUILD_DIR)/%=%)
    76 	-$(PARFAIT) $(SOURCE_DIR)/$(@D:$(BUILD_DIR)/%=%)
    69 endif
    77 endif
   109 	$(MAKE) PARFAIT_BUILD=yes parfait
   117 	$(MAKE) PARFAIT_BUILD=yes parfait
   110 endif
   118 endif
   111 
   119 
   112 clean::
   120 clean::
   113 	$(RM) -r $(SOURCE_DIR) $(BUILD_DIR)
   121 	$(RM) -r $(SOURCE_DIR) $(BUILD_DIR)
       
   122 
       
   123 # Make it easy to construct a URL for a pypi source download.
       
   124 PYPI_BASE = http://pypi.python.org/packages/source
       
   125 pypi_url = $(PYPI_BASE)/$(shell echo $(COMPONENT_NAME) | cut -c1)/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)