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