python27: update to 2.7.15
[unleashed-userland.git] / make-rules / ant.mk
blob4d45e5fa7684e22f0863bf855841b93e0ebd43cc
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
21 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
24 ANT=/usr/bin/ant
26 COMPONENT_BUILD_ENV += JAVA_HOME="$(JAVA_HOME)"
27 # build the configured source
28 $(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep
29 $(RM) -r $(@D) ; $(MKDIR) $(@D)
30 $(CLONEY) $(SOURCE_DIR) $(@D)
31 $(COMPONENT_PRE_BUILD_ACTION)
32 (cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
33 $(ANT) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
34 $(COMPONENT_POST_BUILD_ACTION)
35 ifeq ($(strip $(PARFAIT_BUILD)),yes)
36 -$(PARFAIT) $(@D)
37 endif
38 $(TOUCH) $@
40 COMPONENT_INSTALL_ENV += JAVA_HOME="$(JAVA_HOME)"
41 # install the built source into a prototype area
42 $(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built
43 $(COMPONENT_PRE_INSTALL_ACTION)
44 (cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
45 $(ANT) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
46 $(COMPONENT_POST_INSTALL_ACTION)
47 $(TOUCH) $@
49 COMPONENT_TEST_ENV_CMD = $(ENV)
50 COMPONENT_TEST_ENV += JAVA_HOME="$(JAVA_HOME)"
51 COMPONENT_TEST_CMD = $(ANT)
53 # test the built source
54 $(BUILD_DIR)/%/.tested-and-compared: $(BUILD_DIR)/%/.built
55 $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
56 $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
57 $(COMPONENT_PRE_TEST_ACTION)
58 -(cd $(COMPONENT_TEST_DIR) ; \
59 $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
60 $(COMPONENT_TEST_CMD) \
61 $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
62 &> $(COMPONENT_TEST_OUTPUT)
63 $(COMPONENT_POST_TEST_ACTION)
64 $(COMPONENT_TEST_CREATE_TRANSFORMS)
65 $(COMPONENT_TEST_PERFORM_TRANSFORM)
66 $(COMPONENT_TEST_COMPARE)
67 $(COMPONENT_TEST_CLEANUP)
68 $(TOUCH) $@
70 $(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
71 $(COMPONENT_PRE_TEST_ACTION)
72 (cd $(COMPONENT_TEST_DIR) ; \
73 $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
74 $(COMPONENT_TEST_CMD) \
75 $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS))
76 $(COMPONENT_POST_TEST_ACTION)
77 $(COMPONENT_TEST_CLEANUP)
78 $(TOUCH) $@
80 ifeq ($(strip $(PARFAIT_BUILD)),yes)
81 parfait: build
82 else
83 parfait:
84 $(MAKE) PARFAIT_BUILD=yes parfait
85 endif
87 clean::
88 $(RM) -r $(SOURCE_DIR) $(BUILD_DIR)