Marcel Telka
2024-04-09 fd9f501749e1762d87c06022a02c338ad364a357
commit | author | age
879c85 1 #
NP 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 #
21
22 #
23 # Copyright 2022 Niklas Poslovski
24 #
25
26 include $(WS_MAKE_RULES)/makemaker.mk
27
28 COMPONENT_CONFIGURE_ARGS =    --installdirs=vendor
29 $(BUILD_DIR)/%/.configured:     $(SOURCE_DIR)/.prep
30     ($(RM) -r $(@D) ; $(MKDIR) $(@D))
c529ec 31     $(ENV) $(CLONEY_ARGS) $(CLONEY) $(SOURCE_DIR) $(@D)
879c85 32     $(COMPONENT_PRE_CONFIGURE_ACTION)
NP 33     (cd $(@D) ; $(COMPONENT_CONFIGURE_ENV) $(PERL) $(PERL_FLAGS) \
0f8a2f 34                 Build.PL $(COMPONENT_CONFIGURE_ARGS) $(CONFIGURE_OPTIONS))
879c85 35         $(COMPONENT_POST_CONFIGURE_ACTION)
NP 36         $(TOUCH) $@
37
38 $(BUILD_DIR)/%/.built:  $(BUILD_DIR)/%/.configured
39         $(COMPONENT_PRE_BUILD_ACTION)
40         (cd $(@D) ; $(ENV) $(COMPONENT_BUILD_ENV) \
41                 ./Build \
42                 $(COMPONENT_BUILD_TARGETS))
43         $(COMPONENT_POST_BUILD_ACTION)
44         $(TOUCH) $@
45
46 COMPONENT_INSTALL_ARGS =       --destdir="$(PROTO_DIR)"
47 COMPONENT_INSTALL_TARGETS =     install
48 $(BUILD_DIR)/%/.installed:      $(BUILD_DIR)/%/.built
49         $(COMPONENT_PRE_INSTALL_ACTION)
50         (cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) ./Build \
51                         $(COMPONENT_INSTALL_TARGETS) $(COMPONENT_INSTALL_ARGS))
52         $(COMPONENT_POST_INSTALL_ACTION)
53         $(TOUCH) $@
54
55 # test the built source
b6799e 56 $(BUILD_DIR)/%/.tested-and-compared:    $(COMPONENT_TEST_DEP)
879c85 57         $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
NP 58         $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
59         $(COMPONENT_PRE_TEST_ACTION)
60         -(cd $(COMPONENT_TEST_DIR) ; \
61                 $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
62                 ./Build \
63                 $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
64                 &> $(COMPONENT_TEST_OUTPUT)
65         $(COMPONENT_POST_TEST_ACTION)
66         $(COMPONENT_TEST_CREATE_TRANSFORMS)
67         $(COMPONENT_TEST_PERFORM_TRANSFORM)
68         $(COMPONENT_TEST_COMPARE)
69         $(COMPONENT_TEST_CLEANUP)
70         $(TOUCH) $@
71
89aae0 72 $(BUILD_DIR)/%/.tested:    SHELLOPTS=pipefail
b6799e 73 $(BUILD_DIR)/%/.tested:    $(COMPONENT_TEST_DEP)
89aae0 74         $(RM) -rf $(COMPONENT_TEST_BUILD_DIR)
MT 75         $(MKDIR) $(COMPONENT_TEST_BUILD_DIR)
879c85 76         $(COMPONENT_PRE_TEST_ACTION)
NP 77         (cd $(COMPONENT_TEST_DIR) ; \
78                 $(COMPONENT_TEST_ENV_CMD) $(COMPONENT_TEST_ENV) \
79                 ./Build \
89aae0 80                 $(COMPONENT_TEST_ARGS) $(COMPONENT_TEST_TARGETS)) \
MT 81                 |& $(TEE) $(COMPONENT_TEST_OUTPUT)
879c85 82         $(COMPONENT_POST_TEST_ACTION)
89aae0 83         $(COMPONENT_TEST_CREATE_TRANSFORMS)
MT 84         $(COMPONENT_TEST_PERFORM_TRANSFORM)
879c85 85         $(COMPONENT_TEST_CLEANUP)
NP 86         $(TOUCH) $@
811e64 87
6bf272 88 # Workaround for https://github.com/Perl-Toolchain-Gang/Module-Build/issues/91.
MT 89 # Without the workaround we would need to add library/perl-5/module-build as a
90 # required package manually to all Perl components with the modulebuild build
91 # style.  We do not need the library/perl-5/module-build package to bootstrap
92 # the Module::Build module itself.
93 ifneq ($(strip $(COMPONENT_PERL_MODULE)),Module::Build)
811e64 94 USERLAND_REQUIRED_PACKAGES.perl += library/perl-5/module-build
6bf272 95 endif