source: trunk/third/perl/Makefile.SH @ 17039

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