Cross Reference: /illumos-gate/usr/src/cmd/perl/5.8.4/distrib/Makefile
Makefile revision 24fe0b3bf671e123467ce1df0b67cadd3614c8e4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# The perl5 installation for Solaris differs from that generated by the
# Perl Configure procedure. The configuration appropriate for the current
# build is automatically generated from pre-existing configuration files
# for the build platform.
#
PROG = perl
#
# Some of the Makefile.master and Makefile.cmd flags are overridden by
# ../Makefile.perlcfg which is in turn generated from config.sh by
# ../extract_config.sh - check there first before overriding anything in this
# Makefile.
#
include ../../../Makefile.cmd
include ../Makefile.perlcfg
# DynaLoader is a special extension as it has to be built statically.
DYNALOADER=lib/auto/DynaLoader/DynaLoader.a
# Uuencoded files that need to have SCCS keyword expansion prevented, see below.
UUENCODED_FILES = \
ext/Storable/t/downgrade.t \
lib/CGI/eg/dna_small_gif.uu \
lib/CGI/eg/wilogo_gif.uu
# Because autosplit generates a lot of files, we create a dummy timestamp file
# so that dependency checking can be performed.
AUTOSPLIT = lib/auto/.tstamp
CLEANFILES = miniperlmain.o perlmain.o opmini.o perlmain.c writemain cflags \
ext.libs
CLOBBERFILES = $(MINIPERL) $(PROG) $(PERL_CONFIGDEP) libperl.so lib/re.pm \
lib/lib.pm lib/ExtUtils/Miniperl.pm t/perl
clobber := CLOBBERFILES += CLEANFILES
# Add in the perl-specific flags (including largefile flags).
CPPFLAGS += $(PERL_COREFLAGS) $(PERL_LFFLAGS)
# Add in the libraries perl needs to be linked against.
LDLIBS += $(PERL_LDLIBS)
# Compiler replacement rules
SED_UN_CC = -e "s!'$(CC) -_gcc=-w!'cc!"
SED_UN_CC_E = -e "s!'$(REAL_CC)!'cc!"
all := TARGET = all
install := TARGET = install
clobber := TARGET = clobber
clean := TARGET = clean
test := TARGET = test
all: get_no_keywords perl extensions utilities
#
# Some of the files in the perl distribution are uuencoded, or contain uuencoded
# data. Some of the sequences of uuencoded data look like SCCS keywords, i.e.
# "%<letter>%", so it is necessary to prevent the keywords from being expanded.
# The SCCS 'y' flag can be added to the SCCS files to prevent keyword expansion
# when the file is retrieved. However due to bugs in SCCS and wx we can't
# always be sure that these flags are propagated correctly.
#
get_no_keywords: FRC
@ ../get_no_keywords $(UUENCODED_FILES)
#
# Expand template files that depend on config.sh.
#
$(PERL_CONFIG_H): config_h.SH config.sh
$(CHMOD) 0555 config_h.SH
./config_h.SH
perlmain.c: writemain $(PERL_CONFIG_H)
./writemain $(DYNALOADER) > perlmain.c
writemain: writemain.SH $(PERL_CONFIG_H)
$(CHMOD) 0555 writemain.SH
./writemain.SH
#
# Build the libperl.so and libperl.so.1 shared objects using Makefile.lib,
# which uses the correct library build environment.
#
libperl.so: $(PERL_CONFIG_H) FRC
@ $(ECHO) "Building libperl.so"; $(MAKE) -f Makefile.lib $(TARGET)
#
# Build miniperl, the bootstrap perl executable, and check it executes OK.
#
$(MINIPERL): miniperlmain.o opmini.o libperl.so
$(LINK.c) -o $@ miniperlmain.o opmini.o \
-R \$$ORIGIN -L. -lperl $(LDLIBS)
@ $(RUN_MINIPERL) -w -Ilib -MExporter -e 'exit(0);' || \
{ $(ECHO) "error building miniperl"; $(RM) $(MINIPERL); exit 2; }
miniperlmain.o: miniperlmain.c $(PERL_CONFIG_H)
#
# opmini.o is a version of op.o compiled with -DPERL_EXTERNAL_GLOB. Perl has
# an internal implementation of glob, but it isn't available at this point.
#
opmini.o: op.c $(PERL_CONFIG_H)
$(COMPILE.c) -o $@ op.c -DPERL_EXTERNAL_GLOB
$(POST_PROCESS_O)
.PARALLEL: miniperlmain.o opmini.o libperl.so
#
# Prepare for building perl modules by:
# * Building miniperl.
# * Copying re.pm from ext/re into lib.
# * Creating lib.pm from lib_pm.PL.
# * Creating Config.pm from config.sh.
# * Autosplitting any ./lib modules that require it.
# * Creating a fake cflags file. ExtUtils::MM_Unix (used to build extensions)
# checks to see if there is a non-zero sized file called 'cflags' in this
# directory, so we fool it by creating one.
#
preplibrary: $(MINIPERL) $(PERL_CONFIG_PM) lib/lib.pm \
lib/ExtUtils/Miniperl.pm cflags $(AUTOSPLIT)
$(PERL_CONFIG_PM): configpm $(PERL_CONFIG_H) myconfig.SH $(MINIPERL) lib/re.pm
$(RUN_MINIPERL) configpm $@
lib/re.pm : ext/re/re.pm
$(CP) -f ext/re/re.pm $@
lib/lib.pm: lib/lib_pm.PL $(PERL_CONFIGDEP) $(MINIPERL)
$(RUN_MINIPERL) lib/lib_pm.PL
lib/ExtUtils/Miniperl.pm: $(PERL_CONFIGDEP) $(MINIPERL) \
miniperlmain.c minimod.pl
$(RUN_MINIPERL) minimod.pl > minimod.tmp
$(MV) minimod.tmp $@
# Note: cflags needs to be non-zero sized, so $(TOUCH) won't do.
cflags:
$(ECHO) > cflags
.PARALLEL: $(PERL_CONFIGDEP) lib/re.pm lib/lib.pm lib/ExtUtils/Miniperl.pm \
cflags $(AUTOSPLIT)
# Because autosplit generates a lot of files, we create a dummy timestamp file
$(AUTOSPLIT): $(PERL_CONFIGDEP)
@ $(MKDIR) -p lib/auto
$(RUN_MINIPERL) -Ilib -MAutoSplit -e 'autosplit_lib_modules(@ARGV)' \
`find lib -name SCCS -prune -o -name '*.pm' -print`
@ $(TOUCH) $(AUTOSPLIT)
#
# Make DynaLoader. DynaLoader is statically linked into the perl executable
# because it is used to load in all the other dynamically loaded modules.
# Note: VERSION is used by ON as a environment variable and by perl module
# makefiles as a make macro, so we need to unset it before building any modules.
#
ext/DynaLoader/Makefile: ext/DynaLoader/Makefile.PL $(PERL_CONFIGDEP) cflags
@ cd ext/DynaLoader; pwd; $(PERL_MM_ENV); \
$(RUN_MINIPERL) Makefile.PL INSTALLDIRS=perl \
LIBPERL_A=libperl.so $(PERL_MM_ARGS)
$(DYNALOADER): ext/DynaLoader/Makefile $(PERL_CONFIGDEP) cflags FRC
@ cd ext/DynaLoader; pwd; $(PERL_MM_ENV); \
$(MAKE) LINKTYPE=static CCCDLFLAGS=
#
# Create the perl executable.
#
perl: libperl.so $(DYNALOADER) $(PERL_STATIC_TGT) perlmain.o
$(LINK.c) $(ZIGNORE) -R$(PERL_REAL_CORE_DIR) \
-o $@ perlmain.o $(DYNALOADER) -L. -lperl $(LDLIBS)
$(POST_PROCESS)
perlmain.o: perlmain.c $(PERL_CONFIG_H)
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
.PARALLEL: perlmain.o
#
# Build all the extensions. The rules for this are in the generated
# ext/Makefile file.
#
extensions: preplibrary FRC
@ cd ext; pwd; $(MAKE) $(TARGET)
#
# Build utilities and pod pages.
#
utilities: perl FRC
@ cd x2p; pwd; $(MAKE) $(TARGET)
@ cd pod; pwd; $(MAKE) $(TARGET)
@ cd utils; pwd; $(MAKE) $(TARGET)
#
# Install targets. The bin, lib and pod symlinks are created here. The man
# link is created by the SUNWpl5m package. In order to prevent a symlink cycle
# we need to remove libperl.so before we start, so it will always be reinstalled
# on each 'make install'. We also overwrite the Config.pm we used to build our
# modules with one sanitized of the /ws/on*-tools dependency. As a result,
# Config.pm will also be overwritten on each 'make install'. Note also that
# perl, pstruct and psed are all hard links, so they too are reinstalled on each
# 'make install'.
#
install_files:
$(RM) $(PERL_CORE_DIR)/libperl.so
@ $(PERL_LD_ENV); $(PERL_LIB_ENV); \
$(PERL_DISTRIB)/perl ./installperl -destdir=$(ROOT)
@ $(MAKE) -f Makefile.lib install_lib
umask 022; $(MKDIR) -p $(PERL_VENDOR_DIR)
$(RM) $(PERL_ROOT_STEM)/bin
$(LN) -s ./$(PERL_VERSION)/bin $(PERL_ROOT_STEM)/bin
$(RM) $(PERL_ROOT_STEM)/pod
$(LN) -s ./$(PERL_VERSION)/lib/pod $(PERL_ROOT_STEM)/pod
$(RM) $(ROOTPROG)
$(LN) -s ../perl5/$(PERL_VERSION)/bin/perl $(ROOTPROG)
$(RM) $(PERL_ARCHLIB_DIR)/Config.pm
$(SED) $(SED_UN_CC) $(SED_UN_CC_E) $(PERL_CONFIG_PM) \
> $(PERL_ARCHLIB_DIR)/Config.pm
$(CHMOD) 444 $(PERL_ARCHLIB_DIR)/Config.pm
install: all .WAIT install_files
#
# Perl test suite target.
# Note: the perl test suite breaks under parallel make. Bah.
#
# @ (PERL_MM_ENV); $(PERL_LD_ENV);
test: all
$(PERL_LD_ENV); \
PATH=/usr/ccs/bin:$$PATH; export PATH; \
MAKE=/usr/ccs/bin/make; export MAKE; \
PERL_CORE=1; export PERL_CORE; \
cd t; pwd; \
$(CP) ../perl .; \
$(CHMOD) 755 TEST; \
if tty -s; then \
./TEST < /dev/tty; \
else \
./TEST < /dev/null; \
fi
#
# Cleaning targets.
#
clean_pod:
@ cd pod; pwd; $(MAKE) clean
clean_utilities:
@ cd utils; pwd; $(MAKE) clean
clean_x2p:
@ cd x2p; pwd; $(MAKE) clean
clean_extensions:
-@ unset VERSION; \
cd ext; pwd; \
( \
cd DynaLoader; \
[ -f Makefile.old ] && mf=Makefile.old; \
[ -f Makefile ] && mf=Makefile; \
[ ! -z "$$mf" ] && $(MAKE) -f $$mf clean; \
); \
$(MAKE) clean
clean_lib:
$(MAKE) -f Makefile.lib clean
clean: clean_pod clean_utilities clean_x2p clean_extensions clean_lib
$(RM) $(CLEANFILES)
#
# Clobber targets
#
clobber_extensions:
-@ unset VERSION; \
cd ext; pwd; \
$(RM) -r Sys/Syslog/lib; \
( \
cd DynaLoader; \
[ -f Makefile.old ] && mf=Makefile.old; \
[ -f Makefile ] && mf=Makefile; \
[ ! -z "$$mf" ] && $(MAKE) -f $$mf realclean; \
); \
$(MAKE) clobber
clobber_lib:
$(MAKE) -f Makefile.lib $(TARGET)
$(RM) -r lib/auto lib/Config.pod
$(RM) `find ./lib -name .exists`
clobber_pod:
@ cd pod; pwd; $(MAKE) $(TARGET)
clobber_utilities:
@ cd utils; pwd; $(MAKE) $(TARGET)
clobber_x2p:
@ cd x2p; pwd; $(MAKE) $(TARGET)
clobber_contrib_bin:
@ $(RM) -r contrib_bin
clobber: clobber_extensions clobber_lib clobber_pod clobber_utilities \
clobber_x2p clobber_contrib_bin
include ../../../Makefile.targ
FRC: