source: trunk/essentials/dev-lang/perl/Makefile.SH@ 3190

Last change on this file since 3190 was 3189, checked in by bird, 18 years ago

sillybuggers.

File size: 43.5 KB
Line 
1#! /bin/sh
2case $PERL_CONFIG_SH in
3'')
4 if test -f config.sh
5 then TOP=.
6 else
7 echo "Can't find config.sh."; exit 1
8 fi
9 . $TOP/config.sh
10 ;;
11esac
12
13# H.Merijn Brand [17 Feb 2004]
14# This comment is just to ensure that Configure will find variables that
15# are removed/replaced in patches on blead, but are still needed in the
16# 5.8.x, 5.6.x and 5.005.x maintainance tracks.
17# metaconfig -m will scan all .SH files on this level (not deeper), and
18# not in x2p and other subfolders. This file is as good as any .SH
19# patch references
20# #22227 $baserev
21# #22302 $yacc $byacc
22
23# H.Merijn Brand [30 Oct 2004]
24# Mentioned for the same reason for future reference
25# #23434 $d_strlcat $d_strlcpy
26
27: This forces SH files to create target in same directory as SH file.
28: This is so that make depend always knows where to find SH derivatives.
29case "$0" in
30*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
31esac
32
33case "$d_dosuid" in
34*define*) suidperl='suidperl' ;;
35*) suidperl='';;
36esac
37
38linklibperl='$(LIBPERL)'
39shrpldflags='$(LDDLFLAGS)'
40ldlibpth=''
41DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
42case "$useshrplib" in
43true)
44 # Prefix all runs of 'miniperl' and 'perl' with
45 # $ldlibpth so that ./perl finds *this* shared libperl.
46 case "$LD_LIBRARY_PATH" in
47 '')
48 ldlibpth="LD_LIBRARY_PATH=`pwd`";;
49 *)
50 ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";;
51 esac
52
53 pldlflags="$cccdlflags"
54 static_target='static_pic'
55 case "${osname}${osvers}" in
56 next4*)
57 ld=libtool
58 lddlflags="-dynamic -undefined warning -framework System \
59 -compatibility_version 1 -current_version $patchlevel \
60 -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
61 ;;
62 rhapsody*|darwin*)
63 shrpldflags="${ldflags} -dynamiclib \
64 -compatibility_version \
65 ${api_revision}.${api_version}.${api_subversion} \
66 -current_version \
67 ${revision}.${patchlevel}.${subversion} \
68 -install_name \$(shrpdir)/\$@"
69 ;;
70 cygwin*)
71 linklibperl="-lperl"
72 ;;
73 sunos*)
74 linklibperl="-lperl"
75 ;;
76 netbsd*|freebsd[234]*|openbsd*)
77 linklibperl="-L. -lperl"
78 ;;
79 interix*)
80 linklibperl="-L. -lperl"
81 shrpldflags="$shrpldflags -Wl,--image-base,0x57000000"
82 ;;
83 aix*)
84 shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
85 case "$osvers" in
86 3*) shrpldflags="$shrpldflags -e _nostart"
87 ;;
88 *) shrpldflags="$shrpldflags -b noentry"
89 ;;
90 esac
91 shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
92 linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
93 ;;
94 hpux*)
95 linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl"
96 ;;
97 os390*)
98 shrpldflags='-W l,dll'
99 linklibperl='libperl.x'
100 DPERL_EXTERNAL_GLOB=''
101 ;;
102 esac
103 case "$ldlibpthname" in
104 '') ;;
105 *)
106 case "$osname" in
107 os2)
108 ldlibpth=''
109 ;;
110 *)
111 eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
112 ;;
113 esac
114 # Strip off any trailing :'s
115 ldlibpth=`echo $ldlibpth | sed 's/:*$//'`
116 ;;
117 esac
118
119 case "$ldlibpth" in
120 # Protect any spaces
121 *" "*) ldlibpth=`echo $ldlibpth|sed 's/ /\\\\ /g'` ;;
122 esac
123
124 case "$osname" in
125 linux)
126 # If there is a pre-existing $libperl from a previous
127 # installation, Linux needs to use LD_PRELOAD to
128 # override the LD_LIBRARY_PATH setting. See the
129 # INSTALL file, under "Building a shared perl library".
130 # If there is no pre-existing $libperl, we don't need
131 # to do anything further.
132 if test -f $archlib/CORE/$libperl; then
133 rm -f preload
134 cat <<'EOT' > preload
135#! /bin/sh
136lib=$1
137shift
138test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD"
139exec "$@"
140EOT
141 chmod 755 preload
142 ldlibpth="$ldlibpth `pwd`/preload `pwd`/$libperl"
143 fi
144 ;;
145 os390) test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
146 ;;
147 esac
148
149 ;;
150
151*) pldlflags=''
152 static_target='static'
153 ;;
154esac
155
156: Prepare dependency lists for Makefile.
157dynamic_list=' '
158for f in $dynamic_ext; do
159 : the dependency named here will never exist
160 base=`echo "$f" | sed 's/.*\///'`
161 dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext"
162done
163
164static_list=' '
165for f in $static_ext; do
166 base=`echo "$f" | sed 's/.*\///'`
167 static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)"
168done
169
170nonxs_list=' '
171for f in $nonxs_ext; do
172 base=`echo "$f" | sed 's/.*\///'`
173 nonxs_list="$nonxs_list ext/$f/pm_to_blib"
174done
175
176# Handle the usage of different yaccs in posix-bc (During Configure we
177# us yacc for perly.y and byacc for a2p.y. The makefiles must use the
178# same configuration for run_byacc!):
179case "$osname" in
180 posix-bc)
181 byacc=$yacc
182 ;;
183esac
184
185echo "Extracting Makefile (with variable substitutions)"
186$spitshell >Makefile <<!GROK!THIS!
187# Makefile.SH
188# This file is derived from Makefile.SH. Any changes made here will
189# be lost the next time you run Configure.
190# Makefile is used to generate $firstmakefile. The only difference
191# is that $firstmakefile has the dependencies filled in at the end.
192#
193#
194# I now supply perly.c with the kits, so don't remake perly.c without byacc
195BYACC = $byacc
196CC = $cc
197LD = $ld
198
199LDFLAGS = $ldflags
200CLDFLAGS = $ldflags
201
202mallocsrc = $mallocsrc
203mallocobj = $mallocobj
204LNS = $lns
205# NOTE: some systems don't grok "cp -f". XXX Configure test needed?
206CPS = $cp
207RMS = rm -f
208ranlib = $ranlib
209
210# The following are mentioned only to make metaconfig include the
211# appropriate questions in Configure. If you want to change these,
212# edit config.sh instead, or specify --man1dir=/wherever on
213# installman commandline.
214bin = $installbin
215scriptdir = $scriptdir
216shrpdir = $archlibexp/CORE
217privlib = $installprivlib
218man1dir = $man1dir
219man1ext = $man1ext
220man3dir = $man3dir
221man3ext = $man3ext
222
223# The following are used to build and install shared libraries for
224# dynamic loading.
225LDDLFLAGS = $lddlflags
226SHRPLDFLAGS = $shrpldflags
227CCDLFLAGS = $ccdlflags
228DLSUFFIX = .$dlext
229PLDLFLAGS = $pldlflags
230LIBPERL = $libperl
231LLIBPERL= $linklibperl
232SHRPENV = $shrpenv
233
234# Static targets are ordinarily built without CCCDLFLAGS. However,
235# if building a shared libperl.so that might later be linked into
236# another application, then it might be appropriate to also build static
237# extensions (usually just DynaLoader) with relocatable code (e.g. -fPIC
238# for GNU cc). This is handled by ext/util/make_ext.
239STATIC = $static_target
240
241# The following is used to include the current directory in
242# the dynamic loader path you are building a shared libperl.
243LDLIBPTH = $ldlibpth
244
245dynamic_ext = $dynamic_list
246static_ext = $static_list
247nonxs_ext = $nonxs_list
248ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
249DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT)
250
251libs = $perllibs $cryptlib
252
253public = perl\$(EXE_EXT) $suidperl utilities translators
254
255shellflags = $shellflags
256
257# This is set to MAKE=$make if your $make command doesn't
258# do it for you.
259$make_set_make
260
261# Mention $gmake here so it gets probed for by Configure.
262
263# These variables may need to be manually set for non-Unix systems.
264AR = $full_ar
265EXE_EXT = $_exe
266LIB_EXT = $_a
267OBJ_EXT = $_o
268PATH_SEP = $p_
269
270FIRSTMAKEFILE = $firstmakefile
271
272# Any special object files needed by this architecture, e.g. os2/os2.obj
273ARCHOBJS = $archobjs
274
275.SUFFIXES: .c \$(OBJ_EXT) .i .s
276
277# grrr
278SHELL = $sh
279
280# how to tr(anslate) newlines
281TRNL = '$trnl'
282
283OPTIMIZE = $optimize
284
285EXTRAS = $extras
286
287INSTALLPREFIXEXP = $prefix
288
289!GROK!THIS!
290# not used by Makefile but by installperl;
291# mentioned here so that metaconfig picks these up
292# $installusrbinperl
293# $versiononly
294
295case "${osname}:${osvers}" in
296darwin:*)
297$spitshell >>Makefile <<EOF
298
299# Your locales are broken (osname $osname, osvers $osvers)
300# and to avoid the numerous
301# perl: warning: Setting locale failed.
302# warnings during the build process we reset the locale variables.
303
304LC_ALL=C
305LANG=C
306LANGUAGE=C
307EOF
308 ;;
309esac
310
311## In the following dollars and backticks do not need the extra backslash.
312$spitshell >>Makefile <<'!NO!SUBS!'
313
314CCCMD = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $@`
315
316CCCMDSRC = `sh $(shellflags) cflags "optimize='$(OPTIMIZE)'" $<`
317
318CONFIGPM = lib/Config.pm lib/Config_heavy.pl
319private = preplibrary $(CONFIGPM) lib/Config.pod lib/ExtUtils/Miniperl.pm
320
321# Files to be built with variable substitution before miniperl
322# is available.
323sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \
324 makedir.SH myconfig.SH writemain.SH pod/Makefile.SH
325
326shextract = Makefile cflags config.h makeaperl makedepend \
327 makedir myconfig writemain pod/Makefile
328
329# Files to be built with variable substitution after miniperl is
330# available. Dependencies handled manually below (for now).
331
332pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL \
333 pod/pod2usage.PL pod/podchecker.PL pod/podselect.PL
334
335# lib/lib.pm is not listed here because it has a rule of its own.
336plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text \
337 pod/pod2usage pod/podchecker pod/podselect
338
339addedbyconf = UU $(shextract) $(plextract) lib/lib.pm pstruct
340
341# Unicode data files generated by mktables
342unidatafiles = lib/unicore/Canonical.pl lib/unicore/Exact.pl \
343 lib/unicore/Properties lib/unicore/Decomposition.pl \
344 lib/unicore/CombiningClass.pl lib/unicore/Name.pl lib/unicore/PVA.pl
345
346# Directories of Unicode data files generated by mktables
347unidatadirs = lib/unicore/To lib/unicore/lib
348
349h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
350h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h opcode.h
351h3 = pad.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h
352h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h
353h5 = utf8.h warnings.h
354h = $(h1) $(h2) $(h3) $(h4) $(h5)
355
356c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c reentr.c
357c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c
358c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c xsutils.c pad.c
359c4 = globals.c perlio.c perlapi.c numeric.c locale.c pp_pack.c pp_sort.c
360
361c = $(c1) $(c2) $(c3) $(c4) miniperlmain.c perlmain.c opmini.c
362
363obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT)
364obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
365obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) xsutils$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT)
366
367obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
368
369lintflags = \
370 -bhn \
371 -p \
372 -s \
373 -Ncheck=%all \
374 -Nlevel=4 \
375 -errfmt=src \
376 -errtags \
377 -erroff=E_BAD_PTR_CAST \
378 -erroff=E_BLOCK_DECL_UNUSED \
379 -erroff=E_CONSTANT_CONDITION \
380 -erroff=E_BAD_PTR_CAST_ALIGN \
381 -erroff=E_PTRDIFF_OVERFLOW \
382 -erroff=E_EXPR_NULL_EFFECT \
383 -erroff=E_BAD_PTR_INT_COMBINATION \
384 -erroff=E_LOOP_EMPTY \
385 -erroff=E_TRUE_LOGICAL_EXPR \
386 -erroff=E_FALSE_LOGICAL_EXPR \
387 -erroff=E_INDISTING_FROM_TRUNC \
388 -erroff=E_POINTER_TO_OBJECT \
389 -erroff=E_ASSIGN_NARROW_CONV \
390 -erroff=E_BAD_SIGN_EXTEND \
391 -erroff=E_INCL_NUSD \
392 -erroff=E_MAIN_PARAM \
393 -Wfoo.flow
394
395.c$(OBJ_EXT):
396 $(CCCMD) $(PLDLFLAGS) $*.c
397
398.c.i:
399 $(CCCMDSRC) -E $*.c > $*.i
400
401.c.s:
402 $(CCCMDSRC) -S $*.c
403
404all: $(FIRSTMAKEFILE) miniperl$(EXE_EXT) extra.pods $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make
405 @echo " ";
406 @echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
407
408.PHONY: all compile translators utilities
409
410compile: all
411 echo "testing compilation" > testcompile;
412 cd utils; $(MAKE) compile;
413 cd x2p; $(MAKE) compile;
414 cd pod; $(MAKE) compile;
415
416translators: miniperl$(EXE_EXT) $(CONFIGPM) FORCE
417 @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all
418
419utilities: miniperl$(EXE_EXT) $(CONFIGPM) $(plextract) lib/lib.pm FORCE
420 @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all
421
422
423# This is now done by installman only if you actually want the man pages.
424# @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
425
426# Phony target to force checking subdirectories.
427# Apparently some makes require an action for the FORCE target.
428.PHONY: FORCE
429FORCE:
430 @sh -c true
431!NO!SUBS!
432$spitshell >>Makefile <<!GROK!THIS!
433
434# We do a copy of the op.c instead of a symlink because gcc gets huffy
435# if we have a symlink forest to another disk (it complains about too many
436# levels of symbolic links, even if we have only two)
437
438opmini.c: op.c
439 \$(RMS) opmini.c
440 \$(CPS) op.c opmini.c
441
442opmini\$(OBJ_EXT): opmini.c
443 \$(CCCMD) \$(PLDLFLAGS) $DPERL_EXTERNAL_GLOB opmini.c
444
445!GROK!THIS!
446$spitshell >>Makefile <<'!NO!SUBS!'
447miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
448 $(CCCMD) $(PLDLFLAGS) $*.c
449
450perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE)
451 sh writemain $(DYNALOADER) $(static_ext) > perlmain.c
452
453!NO!SUBS!
454case "$osname" in
455cygwin)
456 ;; # Let cygwin/Makefile.SHs do its work.
457*)
458 $spitshell >>Makefile <<'!NO!SUBS!'
459perlmain$(OBJ_EXT): perlmain.c
460 $(CCCMD) $(PLDLFLAGS) $*.c
461
462!NO!SUBS!
463 ;;
464esac
465$spitshell >>Makefile <<'!NO!SUBS!'
466# The file ext.libs is a list of libraries that must be linked in
467# for static extensions, e.g. -lm -lgdbm, etc. The individual
468# static extension Makefile's add to it.
469ext.libs: $(static_ext)
470 -@test -f ext.libs || touch ext.libs
471
472!NO!SUBS!
473
474# How to build libperl. This is still rather convoluted.
475# Load up custom Makefile.SH fragment for shared loading and executables:
476case "$osname" in
477*)
478 Makefile_s="$osname/Makefile.SHs"
479 ;;
480esac
481
482case "$osname" in
483aix)
484 $spitshell >>Makefile <<!GROK!THIS!
485LIBS = $perllibs
486# In AIX we need to change this for building Perl itself from
487# its earlier definition (which is for building external
488# extensions *after* Perl has been built and installed)
489CCDLFLAGS = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'`
490
491!GROK!THIS!
492 case "$useshrplib" in
493 define|true|[yY]*)
494 $spitshell >>Makefile <<'!NO!SUBS!'
495
496LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT)
497MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT)
498
499$(LIBPERL_NONSHR): perl$(OBJ_EXT) $(obj)
500 $(RMS) $(LIBPERL_NONSHR)
501 $(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj)
502
503$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)
504 $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
505 opmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
506
507MINIPERLEXP = $(MINIPERL_NONSHR)
508
509LIBPERLEXPORT = perl.exp
510
511!NO!SUBS!
512
513 ;;
514 *)
515 $spitshell >>Makefile <<'!NO!SUBS!'
516MINIPERLEXP = miniperl$(EXE_EXT)
517
518PERLEXPORT = perl.exp
519
520!NO!SUBS!
521 ;;
522 esac
523 $spitshell >>Makefile <<'!NO!SUBS!'
524perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH)
525 ./$(MINIPERLEXP) makedef.pl PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" | sort -u | sort -f > perl.exp
526
527!NO!SUBS!
528 ;;
529os2)
530 $spitshell >>Makefile <<'!NO!SUBS!'
531MINIPERLEXP = miniperl
532
533perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map
534 ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
535
536!NO!SUBS!
537 ;;
538esac
539
540if test -r $Makefile_s ; then
541 . $Makefile_s
542 $spitshell >>Makefile <<!GROK!THIS!
543
544Makefile: $Makefile_s
545!GROK!THIS!
546else
547 $spitshell >>Makefile <<'!NO!SUBS!'
548$(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT)
549!NO!SUBS!
550 case "$useshrplib" in
551 true)
552 $spitshell >>Makefile <<'!NO!SUBS!'
553 $(LD) -o $@ $(SHRPLDFLAGS) perl$(OBJ_EXT) $(obj) $(libs)
554!NO!SUBS!
555 case "$osname" in
556 aix)
557 $spitshell >>Makefile <<'!NO!SUBS!'
558 rm -f libperl$(OBJ_EXT)
559 mv $@ libperl$(OBJ_EXT)
560 $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
561!NO!SUBS!
562 ;;
563 esac
564 ;;
565 *)
566 $spitshell >>Makefile <<'!NO!SUBS!'
567 rm -f $(LIBPERL)
568 $(AR) rcu $(LIBPERL) perl$(OBJ_EXT) $(obj)
569 @$(ranlib) $(LIBPERL)
570!NO!SUBS!
571 ;;
572 esac
573 $spitshell >>Makefile <<'!NO!SUBS!'
574
575# How to build executables.
576
577# The $& notation tells Sequent machines that it can do a parallel make,
578# and is harmless otherwise.
579# The miniperl -w -MExporter line is a basic cheap test to catch errors
580# before make goes on to run preplibrary and then MakeMaker on extensions.
581# This is very handy because later errors are often caused by miniperl
582# build problems but that's not obvious to the novice.
583# The Module used here must not depend on Config or any extensions.
584
585!NO!SUBS!
586
587 case "${osname}${osvers}" in
588 aix*|beos*)
589 $spitshell >>Makefile <<'!NO!SUBS!'
590miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
591 $(CC) -o miniperl $(CLDFLAGS) \
592 `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
593 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
594 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
595!NO!SUBS!
596 ;;
597 next4*)
598 $spitshell >>Makefile <<'!NO!SUBS!'
599miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
600 $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
601 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
602 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
603!NO!SUBS!
604 ;;
605 darwin*)
606 case "$osvers" in
607 [1-6].*) ;;
608 *) case "$ldflags" in
609 *"-flat_namespace"*) ;;
610 *) # to allow opmini.o to override stuff in libperl.dylib
611 $spitshell >>Makefile <<!NO!SUBS!
612NAMESPACEFLAGS = -force_flat_namespace
613!NO!SUBS!
614 ;;
615 esac
616 ;;
617 esac
618 $spitshell >>Makefile <<'!NO!SUBS!'
619miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
620 -@rm -f miniperl.xok
621 $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o miniperl \
622 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
623 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
624!NO!SUBS!
625 ;;
626 *)
627 $spitshell >>Makefile <<'!NO!SUBS!'
628miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
629 -@rm -f miniperl.xok
630 $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl \
631 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
632 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
633!NO!SUBS!
634 ;;
635 esac
636
637 $spitshell >>Makefile <<'!NO!SUBS!'
638
639perl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
640 -@rm -f miniperl.xok
641 $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
642
643# Purify/Quantify Perls.
644
645pureperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
646 $(SHRPENV) $(LDLIBPTH) purify $(CC) -o pureperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
647
648purecovperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
649 $(SHRPENV) $(LDLIBPTH) purecov $(CC) -o purecovperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
650
651quantperl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
652 $(SHRPENV) $(LDLIBPTH) quantify $(CC) -o quantperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
653
654# Valgrind perl (currently Linux only)
655
656perl.valgrind.config: config.sh
657 @echo "To build perl.valgrind you must Configure -Doptimize=-g -Uusemymalloc, checking..."
658 @$(MAKE) perl.config.dashg
659 @echo "Checking usemymalloc='n' in config.sh..."
660 @grep "^usemymalloc=" config.sh
661 @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
662 @echo "And of course you have to have valgrind..."
663 valgrind ./perl -e 1 2>/dev/null || exit 1
664
665# Third Degree Perl (Tru64 only)
666
667perl.config.dashg:
668 @echo "Checking optimize='-g' in config.sh..."
669 @grep "^optimize=" config.sh
670 @egrep "^optimize='(-g|.*-g[1-3].*)'" config.sh >/dev/null || exit 1
671
672perl.third.config: config.sh
673 @echo "To build perl.third you must Configure -Doptimize=-g -Uusemymalloc, checking..."
674 @$(MAKE) perl.config.dashg
675 @echo "Checking usemymalloc='n' in config.sh..."
676 @grep "^usemymalloc=" config.sh
677 @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
678
679perl.third: /usr/bin/atom perl.third.config perl
680 atom -tool third -L. -all -gp -toolargs="-invalid -uninit heap+stack+copy -min 0" perl
681 @echo "Now you may run perl.third and then study perl.3log."
682
683# Pixie Perls (Tru64 and IRIX only)
684
685perl.pixie.config: config.sh
686 @echo "To build perl.pixie you must Configure -Doptimize=-g, checking..."
687 @$(MAKE) perl.config.dashg
688
689perl.pixie.atom: /usr/bin/atom perl
690 atom -tool pixie -L. -all -toolargs="-quiet" perl
691
692perl.pixie.irix: perl
693 pixie perl
694
695perl.pixie: /usr/bin/pixie perl.pixie.config perl
696 if test -x /usr/bin/atom; then \
697 $(MAKE) perl.pixie.atom; \
698 else \
699 $(MAKE) perl.pixie.irix; \
700 fi
701 @echo "Now you may run perl.pixie and then run pixie."
702
703# Gprof Perl
704
705perl.config.dashpg:
706 @echo "Checking optimize='-pg' in config.sh..."
707 @grep "^optimize=" config.sh
708 @grep "^optimize='.*-pg.*'" config.sh >/dev/null || exit 1
709
710perl.gprof.config: config.sh
711 @echo "To build perl.gprof you must Configure -Doptimize=-pg, checking..."
712 @$(MAKE) perl.config.dashpg
713
714perl.gprof: /usr/bin/gprof perl.gprof.config
715 @-rm -f perl
716 $(MAKE) PERL_SUFFIX=.gprof PERL_PROFILE_LDFLAGS=-pg perl
717 @echo "Now you may run perl.gprof and then run gprof perl.gprof."
718
719# Gcov Perl
720
721perl.config.gcov:
722 @echo "To build perl.gcov you must use gcc 3.0 or newer, checking..."
723 @echo "Checking gccversion in config.sh..."
724 @grep "^gccversion=" config.sh
725 @grep "^gccversion='[3-9]\." config.sh >/dev/null || exit 1
726 @echo "To build perl.gcov you must Configure -Dccflags=-fprofile-arcs -ftest-coverage, checking..."
727 @echo "Checking ccflags='-fprofile-arcs -ftest-coverage' in config.sh..."
728 @grep "^ccflags=" config.sh
729 @grep "^ccflags='.*-fprofile-arcs -ftest-coverage.*'" config.sh >/dev/null || exit 1
730
731perl.gcov: perl.config.gcov
732 @-rm -f perl
733 $(MAKE) PERL_SUFFIX=.gcov PERL_PROFILE_LDFLAGS='' perl
734 @echo "Now you may run perl.gcov and then run gcov some.c."
735
736# Microperl. This is just a convenience thing if one happens to
737# build also the full Perl and therefore the real big Makefile:
738# usually one should manually explicitly issue the below command.
739
740.PHONY: microperl
741microperl:
742 $(MAKE) -f Makefile.micro
743
744# This version, if specified in Configure, does ONLY those scripts which need
745# set-id emulation. Suidperl must be setuid root. It contains the "taint"
746# checks as well as the special code to validate that the script in question
747# has been invoked correctly.
748
749suidperl$(EXE_EXT): $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
750 $(SHRPENV) $(LDLIBPTH) $(CC) -o suidperl $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
751
752!NO!SUBS!
753
754fi
755
756$spitshell >>Makefile <<'!NO!SUBS!'
757
758sperl$(OBJ_EXT): perl.c $(h)
759 $(RMS) sperl.c
760 $(LNS) perl.c sperl.c
761 $(CCCMD) -DIAMSUID sperl.c
762 $(RMS) sperl.c
763
764# We have to call our ./makedir because Ultrix 4.3 make can't handle the line
765# test -d lib/auto || mkdir lib/auto
766# We need to autosplit in two steps because VOS can't handle so many args
767#
768.PHONY: preplibrary
769preplibrary: miniperl$(EXE_EXT) $(CONFIGPM) lib/lib.pm $(PREPLIBRARY_LIBPERL)
770 @sh ./makedir lib/auto
771 @echo " AutoSplitting perl library"
772 $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \
773 autosplit_lib_modules(@ARGV)' lib/*.pm
774 $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \
775 autosplit_lib_modules(@ARGV)' lib/*/*.pm
776 $(MAKE) lib/re.pm
777
778lib/Config.pod: config.sh miniperl$(EXE_EXT) configpm Porting/Glossary
779 $(LDLIBPTH) ./miniperl -Ilib configpm --heavy=lib/Config_heavy.pl lib/Config.pm
780
781$(CONFIGPM): lib/Config.pod
782
783lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl$(EXE_EXT) minimod.pl $(CONFIGPM)
784 $(LDLIBPTH) ./miniperl minimod.pl > lib/ExtUtils/Miniperl.pm
785
786lib/re.pm: ext/re/re.pm
787 cp ext/re/re.pm lib/re.pm
788
789$(plextract): miniperl$(EXE_EXT) $(CONFIGPM) x2p/s2p
790 @-rm -f $@
791 $(LDLIBPTH) ./miniperl -I`pwd`/lib $@.PL
792
793x2p/s2p: miniperl$(EXE_EXT) $(CONFIGPM) x2p/s2p.PL
794 cd x2p; $(LDLIBPTH) $(MAKE) s2p
795
796lib/lib.pm: miniperl$(EXE_EXT) $(CONFIGPM)
797 @-rm -f $@
798 $(LDLIBPTH) ./miniperl -Ilib lib/lib_pm.PL
799
800unidatafiles $(unidatafiles): uni.data
801
802uni.data: miniperl$(EXE_EXT) $(CONFIGPM) lib/unicore/mktables
803 cd lib/unicore && $(LDLIBPTH) ../../miniperl -I../../lib mktables -w
804 touch uni.data
805
806extra.pods: miniperl$(EXE_EXT)
807 -@test -f extra.pods && rm -f `cat extra.pods`
808 -@rm -f extra.pods
809 -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
810 nx=`echo $$x | sed -e "s/README\.//"`; \
811 cd pod ; $(LNS) ../$$x "perl"$$nx".pod" ; cd .. ; \
812 echo "pod/perl"$$nx".pod" >> extra.pods ; \
813 done
814 -@rm -f pod/perlvms.pod
815 -@test -f vms/perlvms.pod && cd pod && $(LNS) ../vms/perlvms.pod perlvms.pod && cd .. && echo "pod/perlvms.pod" >> extra.pods
816 -@rm -f pod/perldelta.pod
817 -@test -f pod/perl588delta.pod && cd pod && $(LNS) perl588delta.pod perldelta.pod && cd .. && echo "pod/perldelta.pod" >> extra.pods # See buildtoc
818
819extras.make: perl$(EXE_EXT)
820 -@test -s extras.lst && PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`
821
822extras.test: perl$(EXE_EXT)
823 -@test -s extras.lst && PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst`
824
825extras.install: perl$(EXE_EXT)
826 -@test -s extras.lst && PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
827
828.PHONY: install install-strip install-all install-verbose install-silent \
829 no-install install.perl install.man install.html
830
831META.yml: Porting/makemeta Porting/Maintainers.pl Porting/Maintainers.pm
832 $(LDLIBPTH) ./miniperl -Ilib Porting/makemeta
833
834install-strip:
835 $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)"
836
837install install-all:
838 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) DESTDIR="$(DESTDIR)"
839
840install-verbose:
841 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V DESTDIR="$(DESTDIR)"
842
843install-silent:
844 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S DESTDIR="$(DESTDIR)"
845
846no-install:
847 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n DESTDIR="$(DESTDIR)"
848
849# Set this to an empty string to avoid an attempt of rebuild before install
850INSTALL_DEPENDENCE = all
851
852install.perl: $(INSTALL_DEPENDENCE) installperl
853 if [ -n "$(COMPILE)" ]; \
854 then \
855 cd utils; $(MAKE) compile; \
856 cd ../x2p; $(MAKE) compile; \
857 cd ../pod; $(MAKE) compile; \
858 else :; \
859 fi
860 $(LDLIBPTH) ./perl installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
861 $(MAKE) extras.install
862
863install.man: all installman
864 $(LDLIBPTH) ./perl installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
865
866# XXX Experimental. Hardwired values, but useful for testing.
867# Eventually Configure could ask for some of these values.
868install.html: all installhtml
869 -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd ..
870 $(LDLIBPTH) ./perl installhtml \
871 --podroot=. --podpath=. --recurse \
872 --htmldir=$(privlib)/html \
873 --htmlroot=$(privlib)/html \
874 --splithead=pod/perlipc \
875 --splititem=pod/perlfunc \
876 --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \
877 --ignore=Porting/Maintainers.pm,Porting/patching.pod,Porting/pumpkin.pod,Porting/repository.pod \
878 --verbose
879
880
881# I now supply perly.c with the kits, so the following section is
882# used only if you force byacc to run by saying
883# make run_byacc
884# Since we patch up the byacc output, the perly.fixer script needs
885# to run with precisely the same version of byacc as I use. You
886# normally shouldn't remake perly.[ch].
887
888.PHONY: check_byacc run_byacc
889
890check_byacc:
891 @$(BYACC) -V 2>&1 | grep 'version 1\.8\.2'
892
893run_byacc: FORCE check_byacc
894 $(BYACC) -d perly.y
895 -chmod 664 perly.c perly.h
896 sh $(shellflags) ./perly.fixer y.tab.c perly.c
897 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
898 -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
899 sed -e '/^extern YYSTYPE yy/D' y.tab.h >yh.tmp && mv yh.tmp y.tab.h
900 cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h
901 perl -i.old perlyline.pl perly.c
902 chmod 664 vms/perly_c.vms vms/perly_h.vms
903 perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
904
905# We don't want to regenerate perly.c and perly.h, but they might
906# appear out-of-date after a patch is applied or a new distribution is
907# made.
908perly.c: perly.y
909 -@sh -c true
910
911perly.h: perly.y
912 -@sh -c true
913
914PERLYVMS = vms/perly_c.vms vms/perly_h.vms
915
916$(PERLYVMS): perly.c perly.h vms/vms_yfix.pl
917 perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
918
919# No compat3.sym here since and including the 5.004_50.
920# No interp.sym since 5.005_03.
921SYM = global.sym globvar.sym perlio.sym pp.sym
922
923SYMH = perlvars.h intrpvar.h thrdvar.h
924
925CHMOD_W = chmod +w
926
927# The following files are generated automatically
928# autodoc.pl: pod/perlapi.pod pod/perlintern.pod
929# bytecode.pl: ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c
930# ext/B/B/Asmdata.pm
931# embed.pl: proto.h embed.h embedvar.h global.sym
932# perlapi.h perlapi.c
933# [* embed.pl needs pp.sym generated by opcode.pl! *]
934# keywords.pl: keywords.h
935# opcode.pl: opcode.h opnames.h pp_proto.h pp.sym
936# regcomp.pl: regnodes.h
937# warnings.pl: warnings.h lib/warnings.pm
938# The correct versions should be already supplied with the perl kit,
939# in case you don't have perl available.
940# To force them to be regenerated, run
941# perl regen.pl
942# with your existing copy of perl
943# (make regen_headers is kept for backwards compatibility)
944
945AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \
946 embed.h embedvar.h global.sym \
947 pod/perlintern.pod pod/perlapi.pod \
948 perlapi.h perlapi.c ext/ByteLoader/byterun.h \
949 ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm regnodes.h \
950 warnings.h lib/warnings.pm
951
952.PHONY: regen_headers regen_pods regen_all
953
954regen regen_headers: FORCE
955 -perl regen.pl
956
957regen_pods: FORCE
958 -cd pod; $(LDLIBPTH) $(MAKE) regen_pods
959
960regen_all: $(PERLYVMS) regen regen_pods
961
962.PHONY: manisort manicheck
963
964manisort: FORCE
965 LC_ALL=C sort -fdc MANIFEST || (echo "WARNING: re-sorting MANIFEST"; \
966 LC_ALL=C sort -fdo MANIFEST MANIFEST)
967
968manicheck: FORCE
969 perl Porting/manicheck
970
971# Extensions:
972# Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will
973# automatically get built. There should ordinarily be no need to change
974# any of this part of makefile.
975#
976# The dummy dependency is a place holder in case $(dynamic_ext) or
977# $(static_ext) is empty.
978#
979# DynaLoader may be needed for extensions that use Makefile.PL.
980
981$(DYNALOADER): miniperl$(EXE_EXT) preplibrary FORCE
982 @$(LDLIBPTH) sh ext/util/make_ext $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
983
984d_dummy $(dynamic_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
985 @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
986
987s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
988 @$(LDLIBPTH) sh ext/util/make_ext $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
989
990n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
991 @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
992
993.PHONY: clean _tidy _mopup _cleaner1 _cleaner2 \
994 realclean _realcleaner clobber _clobber \
995 distclean veryclean _verycleaner
996
997clean: _tidy _mopup
998
999realclean: _realcleaner _mopup
1000 @echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh"
1001
1002_clobber:
1003 -@rm -f Cross/run-* Cross/to-* Cross/from-*
1004 rm -f config.sh cppstdin Policy.sh extras.lst
1005
1006clobber: _realcleaner _mopup _clobber
1007
1008distclean: clobber
1009
1010# Like distclean but also removes emacs backups and *.orig.
1011veryclean: _verycleaner _mopup _clobber
1012 -@rm -f Obsolete Wanted
1013
1014# Do not 'make _mopup' directly.
1015_mopup:
1016 rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c
1017 -rmdir .depending
1018 -@test -f extra.pods && rm -f `cat extra.pods`
1019 -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
1020 -rm -f perl.exp ext.libs extra.pods uni.data opmini.o
1021 -rm -f perl.export perl.dll perl.libexp perl.map perl.def
1022 -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap
1023 -rm -f perl.third lib*.so.perl.third perl.3log t/perl.third t/perl.3log
1024 -rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs
1025 -rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok
1026 -rm -f perlld cygwin.c ld2 libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
1027 -rm -f perl$(EXE_EXT) suidperl$(EXE_EXT) miniperl$(EXE_EXT) $(LIBPERL) libperl.* microperl
1028 -rm -f opcode.h-old opnames.h-old pp.sym-old pp_proto.h-old
1029
1030# Do not 'make _tidy' directly.
1031_tidy:
1032 -cd pod; $(LDLIBPTH) $(MAKE) clean
1033 -cd utils; $(LDLIBPTH) $(MAKE) clean
1034 -cd x2p; $(LDLIBPTH) $(MAKE) clean
1035 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
1036 $(LDLIBPTH) sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \
1037 done
1038 rm -f testcompile compilelog
1039
1040_cleaner1:
1041 -cd os2; rm -f Makefile
1042 -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
1043 -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
1044 -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN)
1045 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
1046 $(LDLIBPTH) sh ext/util/make_ext $(CLEAN) $$x MAKE=$(MAKE) ; \
1047 done
1048
1049# Some systems do not support "?", so keep these files separate.
1050_cleaner2:
1051 -rm -f core.*perl.*.? t/core.perl.*.? .?*.c
1052 rm -f core *perl.core t/core t/*perl.core core.* t/core.*
1053 rm -f t/misctmp* t/forktmp* t/tmp* t/c t/perl$(EXE_EXT) t/rantests
1054 rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
1055 rm -rf $(addedbyconf)
1056 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old
1057 rm -f $(private)
1058 rm -rf $(unidatafiles) $(unidatadirs)
1059 rm -rf lib/auto
1060 rm -f lib/.exists lib/*/.exists lib/*/*/.exists
1061 rm -f h2ph.man pstruct
1062 rm -rf .config
1063 rm -f preload
1064 rm -f testcompile compilelog
1065 rm -rf lib/Encode
1066 -rmdir lib/B lib/Data
1067 -rmdir lib/Filter/Util lib/IO/Socket lib/IO
1068 -rmdir lib/List lib/MIME lib/Scalar lib/Sys
1069 -rmdir lib/threads lib/XS
1070
1071_realcleaner:
1072 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean
1073 @$(LDLIBPTH) $(MAKE) _cleaner2
1074
1075_verycleaner:
1076 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
1077 @$(LDLIBPTH) $(MAKE) _cleaner2
1078 -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
1079
1080.PHONY: lint
1081lint: $(c)
1082 rm -f *.ln
1083 lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c)
1084
1085# Need to unset during recursion to go out of loop.
1086# The README below ensures that the dependency list is never empty and
1087# that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding.
1088
1089MAKEDEPEND = Makefile makedepend
1090
1091$(FIRSTMAKEFILE): README $(MAKEDEPEND)
1092 $(MAKE) depend MAKEDEPEND=
1093
1094config.h: config_h.SH config.sh
1095 $(SHELL) config_h.SH
1096
1097# When done, touch perlmain.c so that it doesn't get remade each time.
1098.PHONY: depend
1099depend: makedepend
1100 sh ./makedepend MAKE=$(MAKE)
1101 - test -s perlmain.c && touch perlmain.c
1102 cd x2p; $(MAKE) depend
1103
1104# Cannot postpone this until $firstmakefile is ready ;-)
1105makedepend: makedepend.SH config.sh
1106 sh ./makedepend.SH
1107
1108.PHONY: test check test_prep test_prep_nodll test_prep_pre _test_prep \
1109 test_tty test-tty _test_tty test_notty test-notty _test_notty \
1110 utest ucheck test.utf8 check.utf8 test.torture torturetest \
1111 test.utf16 check.utf16 utest.utf16 ucheck.utf16 \
1112 test.third check.third utest.third ucheck.third test_notty.third \
1113 test.deparse test_notty.deparse test_harness test_harness_notty \
1114 test.bytecompile minitest coretest test.taintwarn
1115
1116# Cannot delegate rebuilding of t/perl to make
1117# to allow interlaced test and minitest
1118
1119TESTFILE=TEST
1120
1121_test_prep:
1122 cd t && (rm -f $(PERL)$(EXE_EXT); $(LNS) ../$(PERL)$(EXE_EXT) $(PERL)$(EXE_EXT))
1123
1124# Architecture-neutral stuff:
1125
1126test_prep_pre: preplibrary utilities $(nonxs_ext)
1127
1128test_prep: test_prep_pre miniperl$(EXE_EXT) $(unidatafiles) perl$(EXE_EXT) $(dynamic_ext) $(TEST_PERL_DLL)
1129 PERL=./perl $(MAKE) _test_prep
1130
1131_test_tty:
1132 cd t && $(PERL_DEBUG) $(LDLIBPTH) $(PERL) $(TESTFILE) $(TEST_ARGS) </dev/tty
1133
1134_test_notty:
1135 cd t && $(PERL_DEBUG) PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) $(PERL) $(TESTFILE) $(TEST_ARGS)
1136
1137# The second branch is for testing without a tty or controlling terminal,
1138# see t/op/stat.t
1139_test:
1140 if (true </dev/tty) >/dev/null 2>&1; then \
1141 $(MAKE) TEST_ARGS=$(TEST_ARGS) TESTFILE=$(TESTFILE) _test_tty ; \
1142 else \
1143 $(MAKE) TEST_ARGS=$(TEST_ARGS) TESTFILE=$(TESTFILE) _test_notty ; \
1144 fi
1145 @echo "Ran tests" > t/rantests
1146
1147test check: test_prep
1148 PERL=./perl $(MAKE) _test
1149
1150test_tty: test_prep
1151 PERL=./perl $(MAKE) _test_tty
1152
1153test_notty: test_prep
1154 PERL=./perl $(MAKE) _test_notty
1155
1156utest ucheck test.utf8 check.utf8: test_prep
1157 PERL=./perl TEST_ARGS=-utf8 $(MAKE) _test
1158
1159coretest: test_prep
1160 PERL=./perl TEST_ARGS=-core $(MAKE) _test
1161
1162test-prep: test_prep
1163
1164test-tty: test_tty
1165
1166test-notty: test_notty
1167
1168# Torture testing
1169
1170test.torture torturetest: test_prep
1171 PERL=./perl TEST_ARGS=-torture $(MAKE) _test
1172
1173# Targets for UTF16 testing:
1174
1175minitest.utf16: minitest.prep
1176 - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \
1177 && $(LDLIBPTH) ./perl TEST -minitest -utf16 base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty
1178
1179test.utf16 check.utf16: test_prep
1180 PERL=./perl $(MAKE) TEST_ARGS=-utf16 _test
1181
1182utest.utf16 ucheck.utf16: test_prep
1183 PERL=./perl $(MAKE) TEST_ARGS="-utf8 -utf16" _test
1184
1185# Targets for valgrind testing:
1186
1187test_prep.valgrind: test_prep perl.valgrind
1188 PERL=./perl $(MAKE) _test_prep
1189
1190test.valgrind check.valgrind: test_prep perl.valgrind.config
1191 PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 $(MAKE) _test
1192
1193utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind
1194 PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 TEST_ARGS=-utf8 $(MAKE) _test
1195
1196test_notty.valgrind: test_prep.valgrind perl.valgrind
1197 PERL=./perl $(MAKE) PERL_DEBUG=PERL_VALGRIND=1 _test_notty
1198
1199# Targets for Third Degree testing.
1200
1201test_prep.third: test_prep perl.third
1202 PERL=./perl.third $(MAKE) _test_prep
1203
1204test.third check.third: test_prep.third perl.third
1205 PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 $(MAKE) _test
1206
1207utest.third ucheck.third: test_prep.third perl.third
1208 PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 TEST_ARGS=-utf8 $(MAKE) _test
1209
1210test_notty.third: test_prep.third perl.third
1211 PERL=./perl.third $(MAKE) PERL_DEBUG=PERL_3LOG=1 _test_notty
1212
1213# Targets for Bytecode/ByteLoader testing.
1214
1215test.bytecompile: test_prep
1216 PERL=./perl TEST_ARGS=-bytecompile $(MAKE) _test
1217
1218# Targets for Deparse testing.
1219
1220test.deparse: test_prep
1221 PERL=./perl TEST_ARGS=-deparse $(MAKE) _test
1222
1223test_notty.deparse: test_prep
1224 PERL=./perl TEST_ARGS=-deparse $(MAKE) _test_notty
1225
1226# Targets to run the test suite with -t
1227
1228test.taintwarn: test_prep
1229 PERL=./perl TEST_ARGS=-taintwarn $(MAKE) _test
1230
1231minitest.prep:
1232 -@test -f lib/lib.pm && test -f lib/Config.pm || \
1233 $(MAKE) lib/Config.pm lib/lib.pm $(unidatafiles)
1234 @echo " "
1235 @echo "You may see some irrelevant test failures if you have been unable"
1236 @echo "to build lib/Config.pm, lib/lib.pm or the Unicode data files."
1237 @echo " "
1238
1239# Can't depend on lib/Config.pm because that might be where miniperl
1240# is crashing.
1241minitest: miniperl$(EXE_EXT) lib/re.pm minitest.prep
1242 - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \
1243 && $(LDLIBPTH) ./perl TEST -minitest base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty
1244
1245# Test via harness
1246
1247test_harness: test_prep
1248 PERL=./perl $(MAKE) TESTFILE=harness _test
1249
1250test_harness_notty: test_prep
1251 PERL=./perl HARNESS_NOTTY=1 $(MAKE) TESTFILE=harness _test
1252
1253# Handy way to run perlbug -ok without having to install and run the
1254# installed perlbug. We don't re-run the tests here - we trust the user.
1255# Please *don't* use this unless all tests pass.
1256# If you want to report test failures, use "make nok" instead.
1257
1258.PHONY: ok okfile oknack okfilenack nok nokfile noknack nokfilenack
1259
1260ok: utilities
1261 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)'
1262
1263okfile: utilities
1264 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok
1265
1266oknack: utilities
1267 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -A
1268
1269okfilenack: utilities
1270 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok -A
1271
1272nok: utilities
1273 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)'
1274
1275nokfile: utilities
1276 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok
1277
1278noknack: utilities
1279 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -A
1280
1281nokfilenack: utilities
1282 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok -A
1283
1284.PHONY: clist hlist shlist pllist
1285
1286clist: $(c)
1287 echo $(c) | tr ' ' $(TRNL) >.clist
1288
1289hlist: $(h)
1290 echo $(h) | tr ' ' $(TRNL) >.hlist
1291
1292shlist: $(sh)
1293 echo $(sh) | tr ' ' $(TRNL) >.shlist
1294
1295pllist: $(pl)
1296 echo $(pl) | tr ' ' $(TRNL) >.pllist
1297
1298Makefile: Makefile.SH ./config.sh
1299 $(SHELL) Makefile.SH
1300
1301.PHONY: distcheck
1302distcheck: FORCE
1303 perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
1304
1305.PHONY: elc
1306elc: emacs/cperl-mode.elc
1307
1308emacs/cperl-mode.elc: emacs/cperl-mode.el
1309 -cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el
1310
1311.PHONY: etags ctags tags
1312
1313etags: TAGS
1314
1315TAGS: emacs/cperl-mode.elc
1316 sh emacs/ptags
1317
1318# Let's hope make will not go into an infinite loop on case-unsensitive systems
1319# This may also fail if . is in the head of the path, since perl will
1320# require -Ilib
1321tags: TAGS
1322 perl emacs/e2ctags.pl TAGS > tags
1323
1324ctags:
1325 ctags -f Tags -N --totals --languages=c --langmap=c:+.h *.c *.h
1326
1327# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
1328# If this runs make out of memory, delete /usr/include lines.
1329!NO!SUBS!
1330
1331$eunicefix Makefile
1332case `pwd` in
1333*SH)
1334 $rm -f ../Makefile
1335 $ln Makefile ../Makefile
1336 ;;
1337esac
1338$rm -f $firstmakefile
1339
1340# Now do any special processing required before building.
1341
1342case "$ebcdic" in
1343define)
1344 xxx=''
1345 echo "This is an EBCDIC system, checking if any parser files need regenerating." >&2
1346case "$osname" in
1347os390|posix-bc)
1348 rm -f y.tab.c y.tab.h
1349 # yacc must be a reentrant ("pure") Bison in BS2000 Posix!
1350 yacc -d perly.y >/dev/null 2>&1
1351 if cmp -s y.tab.c perly.c; then
1352 rm -f y.tab.c
1353 else
1354 echo "perly.y -> perly.c" >&2
1355 mv -f y.tab.c perly.c
1356 chmod u+w perly.c
1357 sed -e '/^#include "perl\.h"/a\
1358\
1359#define yydebug PL_yydebug\
1360#define yynerrs PL_yynerrs\
1361#define yyerrflag PL_yyerrflag\
1362#define yychar PL_yychar\
1363#define yyval PL_yyval\
1364#define yylval PL_yylval' \
1365 -e '/YYSTYPE *yyval;/D' \
1366 -e '/YYSTYPE *yylval;/D' \
1367 -e '/int yychar,/,/yynerrs;/D' \
1368 -e 's/int yydebug = 0;/yydebug = 0;/' \
1369 -e 's/[^_]realloc(/PerlMem_realloc(/g' \
1370 -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
1371 -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
1372 xxx="$xxx perly.c"
1373 fi
1374 case "$osname:$usethreads" in
1375 os390:define)
1376 sed -e 's@^extern int yychar, yyerrflag;@/* extern int yychar, yyerrflag; */@' perly.c > perly.tmp && mv perly.tmp perly.c
1377 ;;
1378 esac
1379 if cmp -s y.tab.h perly.h; then
1380 rm -f y.tab.h
1381 else
1382 echo "perly.y -> perly.h" >&2
1383 mv -f y.tab.h perly.h
1384 xxx="$xxx perly.h"
1385 fi
1386 if cd x2p
1387 then
1388 rm -f y.tab.c y.tab.h
1389 case "$osname" in
1390 posix-bc)
1391 # we are using two different yaccs in BS2000 Posix!
1392 byacc a2p.y >/dev/null 2>&1
1393 ;;
1394 *) # e.g. os390
1395 yacc a2p.y >/dev/null 2>&1
1396 ;;
1397 esac
1398 if cmp -s y.tab.c a2p.c
1399 then
1400 rm -f y.tab.c
1401 else
1402 echo "a2p.y -> a2p.c" >&2
1403 mv -f y.tab.c a2p.c
1404 chmod u+w a2p.c
1405 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
1406 -e 's|^static void __YY_YACC_MAIN.*BS2000.*|/*static main deleted*/|' \
1407 -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
1408 xxx="$xxx a2p.c"
1409 fi
1410 # In case somebody yacc -d:ed the a2p.y.
1411 if test -f y.tab.h
1412 then
1413 if cmp -s y.tab.h a2p.h
1414 then
1415 rm -f y.tab.h
1416 else
1417 echo "a2p.h -> a2p.h" >&2
1418 mv -f y.tab.h a2p.h
1419 xxx="$xxx a2p.h"
1420 fi
1421 fi
1422 cd ..
1423 fi
1424 ;;
1425vmesa)
1426 # Do nothing in VM/ESA.
1427 ;;
1428*)
1429 echo "'$osname' is an EBCDIC system I don't know that well." >&4
1430 ;;
1431esac
1432 case "$xxx" in
1433 '') echo "No parser files were regenerated. That's okay." >&2 ;;
1434 esac
1435 ;;
1436esac
1437
1438# ex: set ts=8 sts=4 sw=4 noet:
Note: See TracBrowser for help on using the repository browser.