Andreas Wacknitz
2024-03-31 783118944874d559e30eea1600352e3feb5263a7
commit | author | age
ad3635 1 #
KC 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) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
ad3635 22 #
KC 23
24 ANT=/usr/bin/ant
25
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)
c529ec 30     $(ENV) $(CLONEY_ARGS) $(CLONEY) $(SOURCE_DIR) $(@D)
ad3635 31     $(COMPONENT_PRE_BUILD_ACTION)
KC 32     (cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
33         $(ANT) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
34     $(COMPONENT_POST_BUILD_ACTION)
35     $(TOUCH) $@
36
37 COMPONENT_INSTALL_ENV += JAVA_HOME="$(JAVA_HOME)"
38 # install the built source into a prototype area
39 $(BUILD_DIR)/%/.installed:    $(BUILD_DIR)/%/.built
40     $(COMPONENT_PRE_INSTALL_ACTION)
41     (cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
42         $(ANT) $(COMPONENT_INSTALL_ARGS) $(COMPONENT_INSTALL_TARGETS))
43     $(COMPONENT_POST_INSTALL_ACTION)
44     $(TOUCH) $@
45
8d70f8 46 COMPONENT_TEST_ENV_CMD = $(ENV)
RB 47 COMPONENT_TEST_ENV += JAVA_HOME="$(JAVA_HOME)"
48 COMPONENT_TEST_CMD = $(ANT)
49
50 # test the built source
b6799e 51 $(BUILD_DIR)/%/.tested-and-compared:    $(COMPONENT_TEST_DEP)
237543 52     $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
AP 53     $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
8d70f8 54     $(COMPONENT_PRE_TEST_ACTION)
RB 55     -(cd $(COMPONENT_TEST_DIR) ; \
56         $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
57         $(COMPONENT_TEST_CMD) \
58         $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
59         &> $(COMPONENT_TEST_OUTPUT)
60     $(COMPONENT_POST_TEST_ACTION)
61     $(COMPONENT_TEST_CREATE_TRANSFORMS)
62     $(COMPONENT_TEST_PERFORM_TRANSFORM)
63     $(COMPONENT_TEST_COMPARE)
64     $(COMPONENT_TEST_CLEANUP)
65     $(TOUCH) $@
66
89aae0 67 $(BUILD_DIR)/%/.tested:    SHELLOPTS=pipefail
b6799e 68 $(BUILD_DIR)/%/.tested:    $(COMPONENT_TEST_DEP)
89aae0 69     $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
MT 70     $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
8d70f8 71     $(COMPONENT_PRE_TEST_ACTION)
RB 72     (cd $(COMPONENT_TEST_DIR) ; \
73         $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
74         $(COMPONENT_TEST_CMD) \
89aae0 75         $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
MT 76         |& $(TEE) $(COMPONENT_TEST_OUTPUT)
8d70f8 77     $(COMPONENT_POST_TEST_ACTION)
89aae0 78     $(COMPONENT_TEST_CREATE_TRANSFORMS)
MT 79     $(COMPONENT_TEST_PERFORM_TRANSFORM)
8d70f8 80     $(COMPONENT_TEST_CLEANUP)
RB 81     $(TOUCH) $@
82
ad3635 83 clean::
KC 84     $(RM) -r $(SOURCE_DIR) $(BUILD_DIR)