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