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]
21 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
24 # All Perl versions are 32-bit only.
26 COMMON_PERL_ENV
+= MAKE
=$(GMAKE
)
27 COMMON_PERL_ENV
+= PATH
=$(GCC_ROOT
)/bin
:$(PATH
)
28 COMMON_PERL_ENV
+= LANG
=""
29 COMMON_PERL_ENV
+= CC
="$(CC)"
30 COMMON_PERL_ENV
+= CFLAGS
="$(PERL_OPTIMIZE)"
32 # Yes. Perl is just scripts, for now, but we need architecture
33 # directories so that it populates all architecture prototype
36 $(BUILD_DIR
)/$(MACH32
)-5.22/.configured
: PERL_VERSION
=5.22
37 $(BUILD_DIR
)/$(MACH32
)-5.22/.configured
: BITS
=32
38 $(BUILD_DIR
)/$(MACH64
)-5.24/.configured
: PERL_VERSION
=5.24
39 $(BUILD_DIR
)/$(MACH64
)-5.24/.configured
: BITS
=64
41 $(BUILD_DIR
)/$(MACH32
)-5.22/.tested
: PERL_VERSION
=5.22
42 $(BUILD_DIR
)/$(MACH32
)-5.22/.tested
: BITS
=32
43 $(BUILD_DIR
)/$(MACH64
)-5.24/.tested
: PERL_VERSION
=5.24
44 $(BUILD_DIR
)/$(MACH64
)-5.24/.tested
: BITS
=64
46 $(BUILD_DIR
)/$(MACH32
)-5.22/.tested-and-compared
: BITS
=32
47 $(BUILD_DIR
)/$(MACH32
)-5.22/.tested-and-compared
: PERL_VERSION
=5.22
48 $(BUILD_DIR
)/$(MACH64
)-5.24/.tested-and-compared
: PERL_VERSION
=5.24
49 $(BUILD_DIR
)/$(MACH64
)-5.24/.tested-and-compared
: BITS
=64
51 PERL_32_TEST_FILES
:=$(foreach ver
, $(PERL_VERSIONS
), $(BUILD_DIR
)/$(MACH32
)-$(ver
)/.tested
)
52 PERL_32_TEST_AND_COMPARE_FILES
:=$(foreach ver
, $(PERL_VERSIONS
), $(BUILD_DIR
)/$(MACH32
)-$(ver
)/.tested-and-compared
)
54 BUILD_32
= $(BUILD_DIR
)/$(MACH32
)-5.22/.built
55 BUILD_64
= $(BUILD_DIR
)/$(MACH64
)-5.24/.built
57 INSTALL_32
= $(BUILD_DIR
)/$(MACH32
)-5.22/.installed
58 INSTALL_64
= $(BUILD_DIR
)/$(MACH64
)-5.24/.installed
60 COMPONENT_CONFIGURE_ENV
+= $(COMMON_PERL_ENV
)
61 COMPONENT_CONFIGURE_ENV
+= PERL
="$(PERL)"
62 $(BUILD_DIR
)/%/.configured
: $(SOURCE_DIR
)/.prep
63 ($(RM
) -r
$(@D
) ; $(MKDIR
) $(@D
))
64 $(CLONEY
) $(SOURCE_DIR
) $(@D
)
65 $(COMPONENT_PRE_CONFIGURE_ACTION
)
66 (cd
$(@D
) ; $(COMPONENT_CONFIGURE_ENV
) $(PERL
) $(PERL_FLAGS
) \
67 Makefile.PL
$(PERL_STUDIO_OVERWRITE
) $(CONFIGURE_OPTIONS
))
68 $(COMPONENT_POST_CONFIGURE_ACTION
)
72 COMPONENT_BUILD_ENV
+= $(COMMON_PERL_ENV
)
73 $(BUILD_DIR
)/%/.built
: $(BUILD_DIR
)/%/.configured
74 $(COMPONENT_PRE_BUILD_ACTION
)
75 (cd
$(@D
) ; $(ENV
) $(COMPONENT_BUILD_ENV
) \
76 $(MAKE
) $(COMPONENT_BUILD_GMAKE_ARGS
) $(COMPONENT_BUILD_ARGS
) \
77 $(COMPONENT_BUILD_TARGETS
))
78 $(COMPONENT_POST_BUILD_ACTION
)
82 COMPONENT_INSTALL_ARGS
+= DESTDIR
="$(PROTO_DIR)"
83 COMPONENT_INSTALL_TARGETS
= install_vendor
84 COMPONENT_INSTALL_ENV
+= $(COMMON_PERL_ENV
)
85 $(BUILD_DIR
)/%/.installed
: $(BUILD_DIR
)/%/.built
86 $(COMPONENT_PRE_INSTALL_ACTION
)
87 (cd
$(@D
) ; $(ENV
) $(COMPONENT_INSTALL_ENV
) $(MAKE
) \
88 $(COMPONENT_INSTALL_ARGS
) $(COMPONENT_INSTALL_TARGETS
))
89 $(COMPONENT_POST_INSTALL_ACTION
)
92 # Define bit specific and Perl version specific filenames.
93 COMPONENT_TEST_MASTER
= $(COMPONENT_TEST_RESULTS_DIR
)/results-
$(PERL_VERSION
)-$(BITS
).master
94 COMPONENT_TEST_OUTPUT
= $(COMPONENT_TEST_BUILD_DIR
)/test-
$(PERL_VERSION
)-$(BITS
)-results
95 COMPONENT_TEST_DIFFS
= $(COMPONENT_TEST_BUILD_DIR
)/test-
$(PERL_VERSION
)-$(BITS
)-diffs
96 COMPONENT_TEST_SNAPSHOT
= $(COMPONENT_TEST_BUILD_DIR
)/results-
$(PERL_VERSION
)-$(BITS
).snapshot
97 COMPONENT_TEST_TRANSFORM_CMD
= $(COMPONENT_TEST_BUILD_DIR
)/transform-
$(PERL_VERSION
)-$(BITS
)-results
99 COMPONENT_TEST_TARGETS
= check
100 COMPONENT_TEST_ENV
+= $(COMMON_PERL_ENV
)
102 # determine the type of tests we want to run.
103 ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR
)/results-
*.master
)),)
104 TEST_32
= $(BUILD_DIR
)/$(MACH32
)-5.22/.tested
105 TEST_64
= $(BUILD_DIR
)/$(MACH64
)-5.24/.tested
107 TEST_32
= $(BUILD_DIR
)/$(MACH32
)-5.22/.tested-and-compared
108 TEST_64
= $(BUILD_DIR
)/$(MACH32
)-5.24/.tested-and-compared
111 # test the built source
112 $(BUILD_DIR
)/%/.tested-and-compared
: $(BUILD_DIR
)/%/.built
113 $(RM
) -rf
$(COMPONENT_TEST_BUILD_DIR
)
114 $(MKDIR
) $(COMPONENT_TEST_BUILD_DIR
)
115 $(COMPONENT_PRE_TEST_ACTION
)
116 -(cd
$(COMPONENT_TEST_DIR
) ; \
117 $(COMPONENT_TEST_ENV_CMD
) $(COMPONENT_TEST_ENV
) \
118 $(COMPONENT_TEST_CMD
) \
119 $(COMPONENT_TEST_ARGS
) $(COMPONENT_TEST_TARGETS
)) \
120 &> $(COMPONENT_TEST_OUTPUT
)
121 $(COMPONENT_POST_TEST_ACTION
)
122 $(COMPONENT_TEST_CREATE_TRANSFORMS
)
123 $(COMPONENT_TEST_PERFORM_TRANSFORM
)
124 $(COMPONENT_TEST_COMPARE
)
125 $(COMPONENT_TEST_CLEANUP
)
128 $(BUILD_DIR
)/%/.tested
: $(BUILD_DIR
)/%/.built
129 $(COMPONENT_PRE_TEST_ACTION
)
130 (cd
$(COMPONENT_TEST_DIR
) ; \
131 $(COMPONENT_TEST_ENV_CMD
) $(COMPONENT_TEST_ENV
) \
132 $(COMPONENT_TEST_CMD
) \
133 $(COMPONENT_TEST_ARGS
) $(COMPONENT_TEST_TARGETS
))
134 $(COMPONENT_POST_TEST_ACTION
)
135 $(COMPONENT_TEST_CLEANUP
)
138 ifeq ($(strip $(PARFAIT_BUILD
)),yes
)
142 $(MAKE
) PARFAIT_BUILD
=yes parfait
146 $(RM
) -r
$(BUILD_DIR
) $(PROTO_DIR
)