Perl 5.6.0, 5.7.0 ... vms/test.com to eliminate spurious NL's in test output
[p5sagit/p5-mst-13.2.git] / Makefile.SH
CommitLineData
599a829f 1#! /bin/sh
2000072c 2case $CONFIGDOTSH in
2304df62 3'')
4 if test -f config.sh; then TOP=.;
5 elif test -f ../config.sh; then TOP=..;
6 elif test -f ../../config.sh; then TOP=../..;
7 elif test -f ../../../config.sh; then TOP=../../..;
8 elif test -f ../../../../config.sh; then TOP=../../../..;
9 else
10 echo "Can't find config.sh."; exit 1
11 fi
12 . $TOP/config.sh
13 ;;
14esac
15: This forces SH files to create target in same directory as SH file.
16: This is so that make depend always knows where to find SH derivatives.
17case "$0" in
18*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
19esac
20
2304df62 21case "$d_dosuid" in
22*define*) suidperl='suidperl' ;;
23*) suidperl='';;
24esac
25
d5d19f97 26linklibperl='$(LIBPERL)'
3c321fdc 27shrpldflags='$(LDDLFLAGS)'
6ee623d5 28ldlibpth=''
d96ebe2e 29case "$useshrplib" in
30true)
6ee623d5 31 # Prefix all runs of 'miniperl' and 'perl' with
5cf1d1f1 32 # $ldlibpth so that ./perl finds *this* shared libperl.
c1b49bc0 33 case "$LD_LIBRARY_PATH" in
34 '')
35 ldlibpth="LD_LIBRARY_PATH=`pwd`";;
36 *)
37 ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";;
38 esac
6ee623d5 39
d5d19f97 40 pldlflags="$cccdlflags"
d96ebe2e 41 case "${osname}${osvers}" in
42 next4*)
3c321fdc 43 ld=libtool
44 lddlflags="-dynamic -undefined warning -framework System \
45 -compatibility_version 1 -current_version $patchlevel \
46 -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
6ee623d5 47 ;;
f556e5b9 48 rhapsody*|darwin*)
49 shrpldflags="${ldflags} -dynamiclib \
50 -compatibility_version 1 \
51 -current_version \
52 ${api_version}.${api_subversion} \
53 -image_base 0x4be00000 \
54 -install_name \$(shrpdir)/\$@"
55 ;;
5cf1d1f1 56 cygwin*)
8736538c 57 linklibperl="-lperl"
58 ;;
73d40b3e 59 sunos*)
d5d19f97 60 linklibperl="-lperl"
61 ;;
43039de7 62 netbsd*|freebsd[234]*|openbsd*)
099685bc 63 linklibperl="-L. -lperl"
64 ;;
3c321fdc 65 aix*)
66 shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
1553ab04 67 case "$osvers" in
549a6b10 68 3*) shrpldflags="$shrpldflags -e _nostart"
1553ab04 69 ;;
549a6b10 70 *) shrpldflags="$shrpldflags -b noentry"
1553ab04 71 ;;
72 esac
549a6b10 73 shrpldflags="$shrpldflags $ldflags $libs $cryptlib"
74 linklibperl="-L $archlibexp/CORE -L `pwd | sed 's/\/UU$//'` -lperl"
3c321fdc 75 ;;
1c7d1a19 76 hpux*)
77 linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+s -Wl,+b$archlibexp/CORE -lperl"
46193409 78 ;;
655635e8 79 esac
5cf1d1f1 80 case "$ldlibpthname" in
81 '') ;;
82 *)
83 case "$osname" in
84 os2)
85 ldlibpth=''
86 ;;
5cf1d1f1 87 *)
88 eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
89 ;;
90 esac
c1b49bc0 91 # Strip off any trailing :'s
92 ldlibpth=`echo $ldlibpth | sed 's/:*$//'`
5cf1d1f1 93 ;;
94 esac
d5d19f97 95 ;;
f0efd8cf 96*) pldlflags=''
d96ebe2e 97 ;;
ecfc5424 98esac
99
a0d0e21e 100: Prepare dependency lists for Makefile.
101dynamic_list=' '
102for f in $dynamic_ext; do
103 : the dependency named here will never exist
ecfc5424 104 base=`echo "$f" | sed 's/.*\///'`
75f92628 105 dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext"
a0d0e21e 106done
107
108static_list=' '
a0d0e21e 109for f in $static_ext; do
110 base=`echo "$f" | sed 's/.*\///'`
cd4d8a96 111 static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)"
a0d0e21e 112done
113
4318d5a0 114nonxs_list=' '
115for f in $nonxs_ext; do
116 base=`echo "$f" | sed 's/.*\///'`
117 nonxs_list="$nonxs_list ext/$f/pm_to_blib"
118done
119
2304df62 120echo "Extracting Makefile (with variable substitutions)"
655635e8 121$spitshell >Makefile <<!GROK!THIS!
a0d0e21e 122# Makefile.SH
85e6fe83 123# This file is derived from Makefile.SH. Any changes made here will
124# be lost the next time you run Configure.
655635e8 125# Makefile is used to generate $firstmakefile. The only difference
126# is that $firstmakefile has the dependencies filled in at the end.
2304df62 127#
fed7345c 128#
2304df62 129# I now supply perly.c with the kits, so don't remake perly.c without byacc
130BYACC = $byacc
131CC = $cc
232e078e 132LD = $ld
16d20bd9 133
2304df62 134LDFLAGS = $ldflags
135CLDFLAGS = $ldflags
85e6fe83 136
2304df62 137mallocsrc = $mallocsrc
138mallocobj = $mallocobj
85e6fe83 139LNS = $lns
2304df62 140RMS = rm -f
85e6fe83 141ranlib = $ranlib
142
16d20bd9 143# The following are mentioned only to make metaconfig include the
144# appropriate questions in Configure. If you want to change these,
8e07c86e 145# edit config.sh instead, or specify --man1dir=/wherever on
16d20bd9 146# installman commandline.
147bin = $installbin
148scriptdir = $scriptdir
d96ebe2e 149shrpdir = $archlibexp/CORE
16d20bd9 150privlib = $installprivlib
151man1dir = $man1dir
152man1ext = $man1ext
153man3dir = $man3dir
154man3ext = $man3ext
155
85e6fe83 156# The following are used to build and install shared libraries for
157# dynamic loading.
158LDDLFLAGS = $lddlflags
3c321fdc 159SHRPLDFLAGS = $shrpldflags
85e6fe83 160CCDLFLAGS = $ccdlflags
a0d0e21e 161DLSUFFIX = .$dlext
ecfc5424 162PLDLFLAGS = $pldlflags
d96ebe2e 163LIBPERL = $libperl
d5d19f97 164LLIBPERL= $linklibperl
ecfc5424 165SHRPENV = $shrpenv
a0d0e21e 166
6ee623d5 167# The following is used to include the current directory in
5cf1d1f1 168# the dynamic loader path you are building a shared libperl.
6ee623d5 169LDLIBPTH = $ldlibpth
170
a0d0e21e 171dynamic_ext = $dynamic_list
172static_ext = $static_list
4318d5a0 173nonxs_ext = $nonxs_list
174ext = \$(dynamic_ext) \$(static_ext) \$(nonxs_ext)
cd4d8a96 175DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT)
2304df62 176
177libs = $libs $cryptlib
178
909b3858 179public = perl $suidperl utilities translators
2304df62 180
181shellflags = $shellflags
182
d96ebe2e 183# This is set to MAKE=$make if your $make command doesn't
184# do it for you.
185$make_set_make
4633a7c4 186
dfe9444c 187# These variables may need to be manually set for non-Unix systems.
ccc7f9b3 188AR = $full_ar
dfe9444c 189EXE_EXT = $_exe
190LIB_EXT = $_a
191OBJ_EXT = $_o
192PATH_SEP = $p_
4633a7c4 193
194FIRSTMAKEFILE = $firstmakefile
195
196# Any special object files needed by this architecture, e.g. os2/os2.obj
197ARCHOBJS = $archobjs
198
cd4d8a96 199.SUFFIXES: .c \$(OBJ_EXT)
200
d96ebe2e 201# grrr
202SHELL = $sh
655635e8 203
28e8609d 204# how to tr(anslate) newlines
205TRNL = '$trnl'
206
b7b35fc2 207# not used by Makefile but by installperl;
208# mentioned here so that metaconfig picks it up
209INSTALL_USR_BIN_PERL = $installusrbinperl
210
2304df62 211!GROK!THIS!
212
85e6fe83 213## In the following dollars and backticks do not need the extra backslash.
2304df62 214$spitshell >>Makefile <<'!NO!SUBS!'
215
d96ebe2e 216CCCMD = `sh $(shellflags) cflags $(LIBPERL) $@`
2304df62 217
fed7345c 218private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
2304df62 219
4633a7c4 220# Files to be built with variable substitution before miniperl
221# is available.
222sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \
4755096e 223 makedir.SH myconfig.SH writemain.SH pod/Makefile.SH
4633a7c4 224
3ebb1980 225shextract = Makefile cflags config.h makeaperl makedepend \
4755096e 226 makedir myconfig writemain pod/Makefile
4633a7c4 227
228# Files to be built with variable substitution after miniperl is
229# available. Dependencies handled manually below (for now).
2304df62 230
efb12ca0 231pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL \
4755096e 232 pod/pod2usage.PL pod/podchecker.PL pod/podselect.PL \
233 pod/buildtoc.PL
4633a7c4 234
4755096e 235# lib/lib.pm is not listed here because it has a rule of its own.
efb12ca0 236plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text \
4755096e 237 pod/pod2usage pod/podchecker pod/podselect \
238 pod/buildtoc
4633a7c4 239
4755096e 240addedbyconf = UU $(shextract) $(plextract) lib/lib.pm pstruct
2304df62 241
fed7345c 242h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
a0d0e21e 243h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h
6f4183fe 244h3 = opcode.h patchlevel.h perl.h perlapi.h perly.h pp.h proto.h regcomp.h
219f41b1 245h4 = regexp.h scope.h sv.h unixish.h util.h iperlsys.h thread.h
4438c4b7 246h5 = utf8.h warnings.h
33b839e2 247h = $(h1) $(h2) $(h3) $(h4) $(h5)
2304df62 248
e8edd1e6 249c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c
a0ed51b3 250c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c
09bef843 251c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c xsutils.c
6f4183fe 252c4 = globals.c perlio.c perlapi.c
2304df62 253
09bef843 254c = $(c1) $(c2) $(c3) $(c4) miniperlmain.c perlmain.c
2304df62 255
e8edd1e6 256obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT)
cd4d8a96 257obj2 = 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)
6f4183fe 258obj3 = 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)
655635e8 259
4633a7c4 260obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
2304df62 261
a0d0e21e 262# Once perl has been Configure'd and built ok you build different
263# perl variants (Debugging, Embedded, Multiplicity etc) by saying:
d96ebe2e 264# make clean; make LIBPERL=libperl<type>.a
a0d0e21e 265# where <type> is some combination of 'd' and(or) 'e' or 'm'.
266# See cflags to understand how this works.
267#
d96ebe2e 268# This mechanism is getting clunky and might not even work any more.
269# EMBEDDING is on by default, and MULTIPLICITY doesn't work.
270#
a0d0e21e 271
2304df62 272lintflags = -hbvxac
273
cd4d8a96 274.c$(OBJ_EXT):
d96ebe2e 275 $(CCCMD) $(PLDLFLAGS) $*.c
2304df62 276
b1a1e9f1 277all: $(FIRSTMAKEFILE) miniperl extra.pods $(private) $(public) $(dynamic_ext) $(nonxs_ext)
248e23d9 278 @echo " ";
279 @echo " Everything is up to date. 'make test' to run test suite."
909b3858 280
6ee623d5 281compile: all
282 echo "testing compilation" > testcompile;
283 cd utils; $(MAKE) compile;
284 cd x2p; $(MAKE) compile;
285 cd pod; $(MAKE) compile;
286
909b3858 287translators: miniperl lib/Config.pm FORCE
6ee623d5 288 @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all
8e07c86e 289
4755096e 290utilities: miniperl lib/Config.pm $(plextract) lib/lib.pm FORCE
6ee623d5 291 @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all
909b3858 292
293
16d20bd9 294# This is now done by installman only if you actually want the man pages.
295# @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
85e6fe83 296
297# Phony target to force checking subdirectories.
e50aee73 298# Apparently some makes require an action for the FORCE target.
85e6fe83 299FORCE:
4633a7c4 300 @sh -c true
85e6fe83 301
bd0dd1d8 302opmini$(OBJ_EXT): op.c
0548b47c 303 $(RMS) opmini.c
304 $(LNS) op.c opmini.c
305 $(CCCMD) $(PLDLFLAGS) -DPERL_EXTERNAL_GLOB opmini.c
306 $(RMS) opmini.c
bd0dd1d8 307
517e7c64 308miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
92c28edd 309 $(CCCMD) $(PLDLFLAGS) $*.c
ecfc5424 310
92c28edd 311perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE)
e8827f64 312 sh writemain $(DYNALOADER) $(static_ext) > writemain.tmp
92c28edd 313 sh mv-if-diff writemain.tmp perlmain.c
85e6fe83 314
cd4d8a96 315perlmain$(OBJ_EXT): perlmain.c
92c28edd 316 $(CCCMD) $(PLDLFLAGS) $*.c
85e6fe83 317
a0d0e21e 318# The file ext.libs is a list of libraries that must be linked in
319# for static extensions, e.g. -lm -lgdbm, etc. The individual
320# static extension Makefile's add to it.
fed7345c 321ext.libs: $(static_ext)
a0d0e21e 322 -@test -f ext.libs || touch ext.libs
85e6fe83 323
ecfc5424 324!NO!SUBS!
599a829f 325
f561ce17 326# if test -f .patch ; then $spitshell >>Makefile <<'!NO!SUBS!'
327# patchlevel.h: .patch
328# perl fix_pl || (make -f Makefile.micro && ./microperl fix_pl)
329# $(SHELL) Makefile.SH
52ff2102 330# fi
331#
332# !NO!SUBS!
517e7c64 333
d96ebe2e 334# How to build libperl. This is still rather convoluted.
599a829f 335# Load up custom Makefile.SH fragment for shared loading and executables:
8736538c 336case "$osname" in
8736538c 337*)
338 Makefile_s="$osname/Makefile.SHs"
339 ;;
340esac
341
549a6b10 342case "$osname" in
343aix)
344 $spitshell >>Makefile <<!GROK!THIS!
345LIBS = $libs
5f9d9a17 346# In AIX we need to change this for building Perl itself from
347# its earlier definition (which is for building external
348# extensions *after* Perl has been built and installed)
349CCDLFLAGS = `echo $ccdlflags|sed -e 's@-bE:.*/perl\.exp@-bE:perl.exp@'`
549a6b10 350
351!GROK!THIS!
352 case "$useshrplib" in
353 define|true|[yY]*)
354 $spitshell >>Makefile <<'!NO!SUBS!'
355
356LIBPERL_NONSHR = libperl_nonshr$(LIB_EXT)
357MINIPERL_NONSHR = miniperl_nonshr$(EXE_EXT)
358
359$(LIBPERL_NONSHR): perl$(OBJ_EXT) $(obj)
360 $(RMS) $(LIBPERL_NONSHR)
361 $(AR) rcu $(LIBPERL_NONSHR) perl$(OBJ_EXT) $(obj)
362
bd0dd1d8 363$(MINIPERL_NONSHR): $(LIBPERL_NONSHR) miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT)
a7089531 364 $(CC) $(LDFLAGS) -o $(MINIPERL_NONSHR) miniperlmain$(OBJ_EXT) \
365 opmini$(OBJ_EXT) $(LIBPERL_NONSHR) $(LIBS)
549a6b10 366
367MINIPERLEXP = $(MINIPERL_NONSHR)
368
369LIBPERLEXPORT = perl.exp
370
371!NO!SUBS!
372
373 ;;
374 *)
375 $spitshell >>Makefile <<'!NO!SUBS!'
376MINIPERLEXP = miniperl$(EXE_EXT)
377
378PERLEXPORT = perl.exp
379
380!NO!SUBS!
381 ;;
382 esac
383 $spitshell >>Makefile <<'!NO!SUBS!'
384perl.exp: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH)
385 ./$(MINIPERLEXP) makedef.pl PLATFORM=aix | sort -u | sort -f > perl.exp.tmp
386 sh mv-if-diff perl.exp.tmp perl.exp
387
388!NO!SUBS!
389 ;;
2c2d71f5 390os2)
391 $spitshell >>Makefile <<'!NO!SUBS!'
392MINIPERLEXP = miniperl
393
394perl5.def: $(MINIPERLEXP) makedef.pl config.sh $(SYM) $(SYMH) miniperl.map
395 ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) > perl.exp.tmp
396 sh mv-if-diff perl.exp.tmp perl5.def
397
398!NO!SUBS!
399 ;;
549a6b10 400esac
401
8736538c 402if test -r $Makefile_s ; then
403 . $Makefile_s
d96ebe2e 404 $spitshell >>Makefile <<!GROK!THIS!
cd4d8a96 405
8736538c 406Makefile: $Makefile_s
cd4d8a96 407!GROK!THIS!
408else
f0efd8cf 409 $spitshell >>Makefile <<'!NO!SUBS!'
549a6b10 410$(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT)
9c9e9f08 411!NO!SUBS!
d96ebe2e 412 case "$useshrplib" in
413 true)
414 $spitshell >>Makefile <<'!NO!SUBS!'
3c321fdc 415 $(LD) $(SHRPLDFLAGS) -o $@ perl$(OBJ_EXT) $(obj)
416!NO!SUBS!
417 case "$osname" in
418 aix)
419 $spitshell >>Makefile <<'!NO!SUBS!'
28e8609d 420 rm -f libperl$(OBJ_EXT)
3c321fdc 421 mv $@ libperl$(OBJ_EXT)
422 $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
ecfc5424 423!NO!SUBS!
3c321fdc 424 ;;
425 esac
d96ebe2e 426 ;;
427 *)
428 $spitshell >>Makefile <<'!NO!SUBS!'
429 rm -f $(LIBPERL)
430 $(AR) rcu $(LIBPERL) perl$(OBJ_EXT) $(obj)
431 @$(ranlib) $(LIBPERL)
655635e8 432!NO!SUBS!
d96ebe2e 433 ;;
434 esac
599a829f 435 $spitshell >>Makefile <<'!NO!SUBS!'
436
437# How to build executables.
438
439# The $& notation tells Sequent machines that it can do a parallel make,
440# and is harmless otherwise.
441# The miniperl -w -MExporter line is a basic cheap test to catch errors
442# before make goes on to run preplibrary and then MakeMaker on extensions.
443# This is very handy because later errors are often caused by miniperl
444# build problems but that's not obvious to the novice.
445# The Module used here must not depend on Config or any extensions.
446
ecfb2188 447!NO!SUBS!
448
449 case "${osname}${osvers}" in
535d2540 450 next4*)
ecfb2188 451 $spitshell >>Makefile <<'!NO!SUBS!'
bd0dd1d8 452miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
ecfb2188 453 $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
454 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
bd0dd1d8 455 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
ecfb2188 456!NO!SUBS!
457 ;;
535d2540 458 aix*)
459 $spitshell >>Makefile <<'!NO!SUBS!'
460miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
461 $(CC) -o miniperl $(CLDFLAGS) \
462 `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \
463 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) perl$(OBJ_EXT) $(libs)
464 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
465!NO!SUBS!
466 ;;
ecfb2188 467 *)
468 $spitshell >>Makefile <<'!NO!SUBS!'
bd0dd1d8 469miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL) opmini$(OBJ_EXT)
5869b1f1 470 $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl \
a7089531 471 miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
bd0dd1d8 472 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
ecfb2188 473!NO!SUBS!
474 ;;
475 esac
476
477 $spitshell >>Makefile <<'!NO!SUBS!'
599a829f 478
549a6b10 479perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
5869b1f1 480 $(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
599a829f 481
549a6b10 482pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
5869b1f1 483 $(SHRPENV) $(LDLIBPTH) purify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
599a829f 484
549a6b10 485purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
5869b1f1 486 $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
dbadb36a 487
549a6b10 488quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
5869b1f1 489 $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
2304df62 490
491# This version, if specified in Configure, does ONLY those scripts which need
492# set-id emulation. Suidperl must be setuid root. It contains the "taint"
493# checks as well as the special code to validate that the script in question
494# has been invoked correctly.
495
549a6b10 496suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs $(PERLEXPORT)
5869b1f1 497 $(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
2304df62 498
599a829f 499!NO!SUBS!
500
501fi
502
503$spitshell >>Makefile <<'!NO!SUBS!'
504
cd4d8a96 505sperl$(OBJ_EXT): perl.c perly.h patchlevel.h $(h)
2304df62 506 $(RMS) sperl.c
85e6fe83 507 $(LNS) perl.c sperl.c
d96ebe2e 508 $(CCCMD) -DIAMSUID sperl.c
2304df62 509 $(RMS) sperl.c
510
fec02dd3 511# We have to call our ./makedir because Ultrix 4.3 make can't handle the line
512# test -d lib/auto || mkdir lib/auto
513#
8374d37a 514preplibrary: miniperl lib/Config.pm
cd4d8a96 515 @sh ./makedir lib/auto
a0d0e21e 516 @echo " AutoSplitting perl library"
92c28edd 517 $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \
518 autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
2304df62 519
75f92628 520# Take care to avoid modifying lib/Config.pm without reason
fb73857a 521# (If trying to create a new port and having problems with the configpm script,
522# try 'make minitest' and/or commenting out the tests at the end of configpm.)
06605284 523lib/Config.pm: config.sh miniperl configpm lib/re.pm
e8827f64 524 $(LDLIBPTH) ./miniperl configpm configpm.tmp
92c28edd 525 sh mv-if-diff configpm.tmp $@
2304df62 526
92c28edd 527lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm
e8827f64 528 $(LDLIBPTH) ./miniperl minimod.pl > minimod.tmp
92c28edd 529 sh mv-if-diff minimod.tmp $@
fed7345c 530
92c28edd 531lib/re.pm: ext/re/re.pm
ceb0239c 532 rm -f $@
92c28edd 533 cat ext/re/re.pm > $@
7cfc0d09 534
06605284 535$(plextract): miniperl lib/Config.pm
92c28edd 536 $(LDLIBPTH) ./miniperl -Ilib $@.PL
72b3d9b4 537
4755096e 538lib/lib.pm: miniperl lib/Config.pm
539 $(LDLIBPTH) ./miniperl -Ilib lib/lib_pm.PL
540
b1a1e9f1 541extra.pods: miniperl
fec93702 542 -@test -f extra.pods && rm -f `cat extra.pods`
72b3d9b4 543 -@rm -f extra.pods
b4bc034f 544 -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
72b3d9b4 545 nx=`echo $$x | sed -e "s/README\.//"`; \
40096396 546 cd pod ; $(LNS) ../$$x "perl"$$nx".pod" ; cd .. ; \
72b3d9b4 547 echo "pod/perl"$$nx".pod" >> extra.pods ; \
548 done
40096396 549 -@test -f vms/perlvms.pod && cd pod && $(LNS) ../vms/perlvms.pod perlvms.pod && cd .. && echo "pod/perlvms.pod" >> extra.pods
72b3d9b4 550
f556e5b9 551install-strip:
552 $(MAKE) STRIPFLAGS=-s install
553
4ad019ef 554install:
c458b76c 555 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS)
c77385cf 556
4ad019ef 557install-verbose:
558 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-V
c458b76c 559
4ad019ef 560install-silent:
8d0b2130 561 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-S
4ad019ef 562
563no-install:
564 $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=-n
16d20bd9 565
b1a1e9f1 566install.perl: all installperl
6ee623d5 567 if [ -n "$(COMPILE)" ]; \
568 then \
569 cd utils; $(MAKE) compile; \
570 cd ../x2p; $(MAKE) compile; \
571 cd ../pod; $(MAKE) compile; \
83673e1f 572 else :; \
6ee623d5 573 fi
c77385cf 574 $(LDLIBPTH) ./perl installperl $(INSTALLFLAGS) $(STRIPFLAGS)
a0d0e21e 575
b1a1e9f1 576install.man: all installman
c77385cf 577 $(LDLIBPTH) ./perl installman $(INSTALLFLAGS)
16d20bd9 578
84902520 579# XXX Experimental. Hardwired values, but useful for testing.
580# Eventually Configure could ask for some of these values.
581install.html: all installhtml
40096396 582 -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd ..
6ee623d5 583 $(LDLIBPTH) ./perl installhtml \
84902520 584 --podroot=. --podpath=. --recurse \
585 --htmldir=$(privlib)/html \
586 --htmlroot=$(privlib)/html \
587 --splithead=pod/perlipc \
588 --splititem=pod/perlfunc \
589 --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \
590 --verbose
591
16d20bd9 592
a0d0e21e 593# I now supply perly.c with the kits, so the following section is
56febc5e 594# used only if you force byacc to run by saying
595# make run_byacc
596# Since we patch up the byacc output, the perly.fixer script needs
597# to run with precisely the same version of byacc as I use. You
598# normally shouldn't remake perly.[ch].
599
232e078e 600run_byacc: FORCE
56febc5e 601 $(BYACC) -d perly.y
28f14321 602 -chmod 664 perly.c
56febc5e 603 sh $(shellflags) ./perly.fixer y.tab.c perly.c
55497cff 604 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
605 -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
ebb99254 606 sed -e '/^extern YYSTYPE yy/D' y.tab.h >yh.tmp && mv yh.tmp y.tab.h
55497cff 607 cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h
fb73857a 608 chmod 664 vms/perly_c.vms vms/perly_h.vms
609 perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
56febc5e 610
611# We don't want to regenerate perly.c and perly.h, but they might
612# appear out-of-date after a patch is applied or a new distribution is
613# made.
92c28edd 614perly.c: perly.y
b233458b 615 -@sh -c true
616
92c28edd 617perly.h: perly.y
b233458b 618 -@sh -c true
619
bd656b61 620# No compat3.sym here since and including the 5.004_50.
e4d5a464 621# No interp.sym since 5.005_03.
22c35a8c 622SYM = global.sym globvar.sym perlio.sym pp.sym
419eaf7b 623
22c35a8c 624SYMH = perlvars.h intrpvar.h thrdvar.h
419eaf7b 625
dae78bb1 626CHMOD_W = chmod +w
627
a8581515 628# The following files are generated automatically
c83f8f39 629# keywords.pl: keywords.h
630# opcode.pl: opcode.h opnames.h pp_proto.h pp.sym
631# [* embed.pl needs pp.sym generated by opcode.pl! *]
632# embed.pl: proto.h embed.h embedvar.h global.sym objXSUB.h
633# perlapi.h perlapi.c pod/perlintern.pod
634# pod/perlapi.pod
635# bytecode.pl: ext/ByteLoader/byterun.h ext/ByteLoader/byterun.c
636# ext/B/B/Asmdata.pm
637# regcomp.pl: regnodes.h
638# warnings.pl: warnings.h lib/warnings.pm
e50aee73 639# The correct versions should be already supplied with the perl kit,
640# in case you don't have perl available.
e1354ed6 641# To force them to be regenerated, type
e50aee73 642# make regen_headers
e1354ed6 643
b4d4469a 644AUTOGEN_FILES = keywords.h opcode.h opnames.h pp_proto.h pp.sym proto.h \
645 embed.h embedvar.h global.sym \
646 pod/perlintern.pod pod/perlapi.pod \
c83f8f39 647 objXSUB.h perlapi.h perlapi.c ext/ByteLoader/byterun.h \
648 ext/ByteLoader/byterun.c ext/B/B/Asmdata.pm regnodes.h \
649 warnings.h lib/warnings.pm
e1354ed6 650
e50aee73 651regen_headers: FORCE
b4d4469a 652 -$(CHMOD_W) $(AUTOGEN_FILES)
653 -perl keywords.pl
654 -perl opcode.pl
655 -perl embed.pl
656 -perl bytecode.pl
657 -perl regcomp.pl
658 -perl warnings.pl
8e07c86e 659
4755096e 660regen_pods: FORCE
661 -cd pod; $(LDLIBPTH) make regen_pods
662
a0d0e21e 663# Extensions:
4318d5a0 664# Names added to $(dynamic_ext) or $(static_ext) or $(nonxs_ext) will
665# automatically get built. There should ordinarily be no need to change
666# any of this part of makefile.
a0d0e21e 667#
668# The dummy dependency is a place holder in case $(dynamic_ext) or
669# $(static_ext) is empty.
670#
671# DynaLoader may be needed for extensions that use Makefile.PL.
672
673$(DYNALOADER): miniperl preplibrary FORCE
92c28edd 674 @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
a0d0e21e 675
676d_dummy $(dynamic_ext): miniperl preplibrary $(DYNALOADER) FORCE
92c28edd 677 @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
a0d0e21e 678
679s_dummy $(static_ext): miniperl preplibrary $(DYNALOADER) FORCE
92c28edd 680 @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
2304df62 681
4318d5a0 682n_dummy $(nonxs_ext): miniperl preplibrary $(DYNALOADER) FORCE
92c28edd 683 @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
4318d5a0 684
17b893d8 685clean: _tidy _mopup
70af249b 686
2edbd6da 687realclean: _realcleaner _mopup
4e2a5f63 688 @echo "Note that make realclean does not delete config.sh or Policy.sh"
70af249b 689
b37ebb13 690_clobber:
4e2a5f63 691 rm -f config.sh cppstdin Policy.sh
b37ebb13 692
693clobber: _realcleaner _mopup _clobber
70af249b 694
695distclean: clobber
696
2edbd6da 697# Like distclean but also removes emacs backups and *.orig.
b37ebb13 698veryclean: _verycleaner _mopup _clobber
699 -@rm -f Obsolete Wanted
2edbd6da 700
70af249b 701# Do not 'make _mopup' directly.
702_mopup:
cd4d8a96 703 rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c
72b3d9b4 704 -@test -f extra.pods && rm -f `cat extra.pods`
b4bc034f 705 -@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
ac83e8b0 706 -rm -f perl.exp ext.libs extra.pods opmini.o
d96ebe2e 707 -rm -f perl.export perl.dll perl.libexp perl.map perl.def
1cfa4ec7 708 -rm -f perl.loadmap miniperl.loadmap perl.prelmap miniperl.prelmap
e708dd94 709 rm -f perl suidperl miniperl $(LIBPERL) libperl.* microperl
70af249b 710
711# Do not 'make _tidy' directly.
712_tidy:
e3f83878 713 -cd pod; $(LDLIBPTH) $(MAKE) clean
714 -cd utils; $(LDLIBPTH) $(MAKE) clean
715 -cd x2p; $(LDLIBPTH) $(MAKE) clean
4318d5a0 716 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
e3f83878 717 $(LDLIBPTH) sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \
a0d0e21e 718 done
6ee623d5 719 rm -f testcompile compilelog
ff68c719 720
2edbd6da 721_cleaner1:
4633a7c4 722 -cd os2; rm -f Makefile
2edbd6da 723 -cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
724 -cd utils; $(LDLIBPTH) $(MAKE) $(CLEAN)
725 -cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN)
4318d5a0 726 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
2edbd6da 727 $(LDLIBPTH) sh ext/util/make_ext $(CLEAN) $$x MAKE=$(MAKE) ; \
a0d0e21e 728 done
2edbd6da 729
730_cleaner2:
9fba8746 731 rm -f core core.*perl.*.? *perl.core t/core t/core.perl.*.? t/*perl.core t/misctmp* t/forktmp* t/tmp* t/c t/perl t/rantests .?*.c so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
a0d0e21e 732 rm -rf $(addedbyconf)
cd4d8a96 733 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
fed7345c 734 rm -f $(private)
a0d0e21e 735 rm -rf lib/auto
181ea953 736 rm -f lib/.exists lib/*/.exists
16d20bd9 737 rm -f h2ph.man pstruct
a0d0e21e 738 rm -rf .config
6ee623d5 739 rm -f testcompile compilelog
dbc74947 740 -rmdir lib/B lib/Data lib/IO/Socket lib/IO lib/Sys lib/Thread
ecfc5424 741
2edbd6da 742_realcleaner:
743 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=realclean
744 @$(LDLIBPTH) $(MAKE) _cleaner2
745
746_verycleaner:
747 @$(LDLIBPTH) $(MAKE) _cleaner1 CLEAN=veryclean
748 @$(LDLIBPTH) $(MAKE) _cleaner2
c94787a5 749 -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig
2edbd6da 750
2304df62 751# The following lint has practically everything turned on. Unfortunately,
752# you have to wade through a lot of mumbo jumbo that can't be suppressed.
753# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
754# for that spot.
755
756lint: perly.c $(c)
757 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
758
fb73857a 759# Need to unset during recursion to go out of loop.
760# The README below ensures that the dependency list is never empty and
761# that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding.
cd4d8a96 762
84902520 763MAKEDEPEND = Makefile makedepend
cd4d8a96 764
fb73857a 765$(FIRSTMAKEFILE): README $(MAKEDEPEND)
cd4d8a96 766 $(MAKE) depend MAKEDEPEND=
a0d0e21e 767
599a829f 768config.h: config_h.SH config.sh
655635e8 769 $(SHELL) config_h.SH
770
a0d0e21e 771# When done, touch perlmain.c so that it doesn't get remade each time.
2304df62 772depend: makedepend
fb73857a 773 sh ./makedepend MAKE=$(MAKE)
a0d0e21e 774 - test -s perlmain.c && touch perlmain.c
2304df62 775 cd x2p; $(MAKE) depend
776
cd4d8a96 777# Cannot postpone this until $firstmakefile is ready ;-)
92c28edd 778makedepend: makedepend.SH config.sh
779 sh ./makedepend.SH
cd4d8a96 780
d6a255e6 781# Cannot delegate rebuilding of t/perl to make to allow interlaced
782# test and minitest
783test-prep: miniperl perl preplibrary utilities $(dynamic_ext) $(nonxs_ext) $(TEST_PERL_DLL)
3e3baf6d 784 cd t && (rm -f perl$(EXE_EXT); $(LNS) ../perl$(EXE_EXT) perl$(EXE_EXT))
785
994e9bc0 786# Second branch is for testing without a tty or controling terminal.
787# See t/op/stat.t
3e3baf6d 788test check: test-prep
994e9bc0 789 if (true </dev/tty) >/dev/null 2>&1; then \
790 cd t && $(LDLIBPTH) ./perl TEST </dev/tty; \
791 else \
792 cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl TEST; \
793 fi
9fba8746 794 @echo "Ran tests" > t/rantests
3e3baf6d 795
a0ed51b3 796utest ucheck: test-prep
994e9bc0 797 if (true </dev/tty) >/dev/null 2>&1; then \
798 cd t && $(LDLIBPTH) ./perl UTEST </dev/tty; \
799 else \
800 cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl UTEST; \
801 fi
a0ed51b3 802
3e3baf6d 803# For testing without a tty or controling terminal. See t/op/stat.t
804test-notty: test-prep
6ee623d5 805 cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl TEST
2304df62 806
d96ebe2e 807# Can't depend on lib/Config.pm because that might be where miniperl
808# is crashing.
a35c6d74 809minitest: miniperl lib/re.pm
d96ebe2e 810 @echo "You may see some irrelevant test failures if you have been unable"
811 @echo "to build lib/Config.pm."
cd4d8a96 812 - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \
6ee623d5 813 && $(LDLIBPTH) ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t </dev/tty
16d20bd9 814
fb73857a 815# Handy way to run perlbug -ok without having to install and run the
84902520 816# installed perlbug. We don't re-run the tests here - we trust the user.
fb73857a 817# Please *don't* use this unless all tests pass.
1d2dff63 818# If you want to report test failures, use "make nok" instead.
188cd53f 819ok: utilities
92c28edd 820 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)'
84902520 821
105f9295 822okfile: utilities
92c28edd 823 $(LDLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)' -F perl.ok
105f9295 824
1d2dff63 825nok: utilities
92c28edd 826 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)'
1d2dff63 827
b4e8cfaf 828nokfile: utilities
829 $(LDLIBPTH) ./perl -Ilib utils/perlbug -nok -s '(UNINSTALLED)' -F perl.nok
830
85e6fe83 831clist: $(c)
92c28edd 832 echo $(c) | tr ' ' $(TRNL) >.clist
2304df62 833
85e6fe83 834hlist: $(h)
92c28edd 835 echo $(h) | tr ' ' $(TRNL) >.hlist
2304df62 836
85e6fe83 837shlist: $(sh)
92c28edd 838 echo $(sh) | tr ' ' $(TRNL) >.shlist
2304df62 839
4633a7c4 840pllist: $(pl)
92c28edd 841 echo $(pl) | tr ' ' $(TRNL) >.pllist
4633a7c4 842
92c28edd 843Makefile: Makefile.SH ./config.sh
844 $(SHELL) Makefile.SH
760ac839 845
599a829f 846distcheck: FORCE
760ac839 847 perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
848
771c4874 849elc: emacs/cperl-mode.elc
850
851emacs/cperl-mode.elc: emacs/cperl-mode.el
852 -cd emacs; emacs -batch -q -no-site-file -f batch-byte-compile cperl-mode.el
853
d6a255e6 854etags: TAGS
855
856TAGS: emacs/cperl-mode.elc
3ee700d1 857 sh emacs/ptags
01e22528 858
d6a255e6 859ctags: tags
860
861# Let's hope make will not go into an infinite loop on case-unsensitive systems
862# This may also fail if . is in the head of the path, since perl will
863# require -Ilib
864tags: TAGS
865 perl emacs/e2ctags.pl TAGS > tags
3ee700d1 866
2304df62 867# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
868# If this runs make out of memory, delete /usr/include lines.
869!NO!SUBS!
870
85e6fe83 871$eunicefix Makefile
2304df62 872case `pwd` in
873*SH)
85e6fe83 874 $rm -f ../Makefile
cd4d8a96 875 $ln Makefile ../Makefile
2304df62 876 ;;
877esac
cd4d8a96 878$rm -f $firstmakefile
5ff3f7a4 879
880# Now do any special processing required before building.
881
882case "$ebcdic" in
883$define)
884 xxx=''
885 echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4
7a66b286 886case "$osname" in
25e9a2e3 887os390|posix-bc)
5ff3f7a4 888 rm -f y.tab.c y.tab.h
e9d08790 889 # yacc must be a reentrant ("pure") Bison in BS2000 Posix!
5ff3f7a4 890 yacc -d perly.y >/dev/null 2>&1
891 if cmp -s y.tab.c perly.c; then
892 rm -f y.tab.c
893 else
894 echo "perly.y -> perly.c" >&2
895 mv -f y.tab.c perly.c
896 chmod u+w perly.c
c8dba6f3 897 sed -e '/^#include "perl\.h"/a\
898\
899#define yydebug PL_yydebug\
900#define yynerrs PL_yynerrs\
901#define yyerrflag PL_yyerrflag\
902#define yychar PL_yychar\
c8dba6f3 903#define yyval PL_yyval\
904#define yylval PL_yylval' \
905 -e '/YYSTYPE *yyval;/D' \
906 -e '/YYSTYPE *yylval;/D' \
907 -e '/int yychar,/,/yynerrs;/D' \
908 -e 's/int yydebug = 0;/yydebug = 0;/' \
909 -e 's/[^_]realloc(/PerlMem_realloc(/g' \
910 -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
5ff3f7a4 911 -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
912 xxx="$xxx perly.c"
913 fi
914 if cmp -s y.tab.h perly.h; then
915 rm -f y.tab.h
916 else
917 echo "perly.y -> perly.h" >&2
918 mv -f y.tab.h perly.h
919 xxx="$xxx perly.h"
920 fi
e9d08790 921 if cd x2p
5ff3f7a4 922 then
e9d08790 923 rm -f y.tab.c y.tab.h
5928ee40 924 case "$osname" in
925 posix-bc)
926 # we are using two different yaccs in BS2000 Posix!
927 byacc a2p.y >/dev/null 2>&1
928 ;;
929 *) # e.g. os390
930 yacc a2p.y >/dev/null 2>&1
931 ;;
932 esac
e9d08790 933 if cmp -s y.tab.c a2p.c
934 then
935 rm -f y.tab.c
936 else
937 echo "a2p.y -> a2p.c" >&2
938 mv -f y.tab.c a2p.c
939 chmod u+w a2p.c
940 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
941 -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
942 xxx="$xxx a2p.c"
943 fi
944 # In case somebody yacc -d:ed the a2p.y.
945 if test -f y.tab.h
946 then
947 if cmp -s y.tab.h a2p.h
948 then
949 rm -f y.tab.h
950 else
951 echo "a2p.h -> a2p.h" >&2
952 mv -f y.tab.h a2p.h
953 xxx="$xxx a2p.h"
954 fi
955 fi
956 cd ..
5ff3f7a4 957 fi
7a66b286 958 ;;
959vmesa)
960 # Do nothing in VM/ESA.
961 ;;
aa34f189 962*)
e9d08790 963 echo "'$osname' is an EBCDIC system I don't know that well." >&4
aa34f189 964 ;;
fe572743 965esac
5ff3f7a4 966 case "$xxx" in
967 '') echo "No parser files were regenerated. That's okay." >&2 ;;
968 esac
969 ;;
970esac
971