[PATCH for 5.004_64] Configure patch Config_64-01
[p5sagit/p5-mst-13.2.git] / Makefile.SH
CommitLineData
599a829f 1#! /bin/sh
2304df62 2case $CONFIG 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
2304df62 21case "$d_dosuid" in
22*define*) suidperl='suidperl' ;;
23*) suidperl='';;
24esac
25
d5d19f97 26linklibperl='$(LIBPERL)'
3c321fdc 27shrpldflags='$(LDDLFLAGS)'
c4f23d77 28ldlibpth=''
d96ebe2e 29case "$useshrplib" in
30true)
c4f23d77 31 # Prefix all runs of 'miniperl' and 'perl' with
32 # $ldlibpth so that ./perl finds *this* libperl.so.
33 ldlibpth="LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH"
34
d5d19f97 35 pldlflags="$cccdlflags"
f0efd8cf 36 # NeXT-4 specific stuff. Can't we do this in the hint file?
d96ebe2e 37 case "${osname}${osvers}" in
38 next4*)
3c321fdc 39 ld=libtool
40 lddlflags="-dynamic -undefined warning -framework System \
41 -compatibility_version 1 -current_version $patchlevel \
42 -prebind -seg1addr 0x27000000 -install_name \$(shrpdir)/\$@"
c4f23d77 43 # NeXT uses a different name.
44 ldlibpth="DYLD_LIBRARY_PATH=`pwd`:$DYLD_LIBRARY_PATH"
45 ;;
46 os2*) # OS/2 doesn't need anything special for LD_LIBRARY_PATH.
47 ldlibpth=''
d96ebe2e 48 ;;
dec5cd44 49 sunos*|freebsd[23]*|netbsd*)
d5d19f97 50 linklibperl="-lperl"
51 ;;
3c321fdc 52 aix*)
53 shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
1553ab04 54 case "$osvers" in
55 3*)
56 shrpldflags="$shrpldflags -e _nostart $ldflags $libs $cryptlib"
57 ;;
58 *)
59 shrpldflags="$shrpldflags -b noentry $ldflags $libs $cryptlib"
60 ;;
61 esac
3c321fdc 62 aixinstdir=`pwd | sed 's/\/UU$//'`
63 linklibperl="-L $archlibexp/CORE -L $aixinstdir -lperl"
64 ;;
fb73857a 65 hpux10*)
66 linklibperl="-L `pwd | sed 's/\/UU$//'` -Wl,+b$archlibexp/CORE -lperl"
67 ;;
655635e8 68 esac
d5d19f97 69 ;;
f0efd8cf 70*) pldlflags=''
d96ebe2e 71 ;;
ecfc5424 72esac
73
a0d0e21e 74: Prepare dependency lists for Makefile.
75dynamic_list=' '
76for f in $dynamic_ext; do
77 : the dependency named here will never exist
ecfc5424 78 base=`echo "$f" | sed 's/.*\///'`
75f92628 79 dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext"
a0d0e21e 80done
81
82static_list=' '
a0d0e21e 83for f in $static_ext; do
84 base=`echo "$f" | sed 's/.*\///'`
cd4d8a96 85 static_list="$static_list lib/auto/$f/$base\$(LIB_EXT)"
a0d0e21e 86done
87
2304df62 88echo "Extracting Makefile (with variable substitutions)"
655635e8 89$spitshell >Makefile <<!GROK!THIS!
a0d0e21e 90# Makefile.SH
85e6fe83 91# This file is derived from Makefile.SH. Any changes made here will
92# be lost the next time you run Configure.
655635e8 93# Makefile is used to generate $firstmakefile. The only difference
94# is that $firstmakefile has the dependencies filled in at the end.
2304df62 95#
fed7345c 96#
2304df62 97# I now supply perly.c with the kits, so don't remake perly.c without byacc
98BYACC = $byacc
99CC = $cc
232e078e 100LD = $ld
16d20bd9 101
2304df62 102LDFLAGS = $ldflags
103CLDFLAGS = $ldflags
85e6fe83 104
2304df62 105SMALL = $small
106LARGE = $large $split
107mallocsrc = $mallocsrc
108mallocobj = $mallocobj
85e6fe83 109LNS = $lns
2304df62 110RMS = rm -f
85e6fe83 111ranlib = $ranlib
112
16d20bd9 113# The following are mentioned only to make metaconfig include the
114# appropriate questions in Configure. If you want to change these,
8e07c86e 115# edit config.sh instead, or specify --man1dir=/wherever on
16d20bd9 116# installman commandline.
117bin = $installbin
118scriptdir = $scriptdir
d96ebe2e 119shrpdir = $archlibexp/CORE
16d20bd9 120privlib = $installprivlib
121man1dir = $man1dir
122man1ext = $man1ext
123man3dir = $man3dir
124man3ext = $man3ext
125
85e6fe83 126# The following are used to build and install shared libraries for
127# dynamic loading.
128LDDLFLAGS = $lddlflags
3c321fdc 129SHRPLDFLAGS = $shrpldflags
85e6fe83 130CCDLFLAGS = $ccdlflags
a0d0e21e 131DLSUFFIX = .$dlext
ecfc5424 132PLDLFLAGS = $pldlflags
d96ebe2e 133LIBPERL = $libperl
d5d19f97 134LLIBPERL= $linklibperl
ecfc5424 135SHRPENV = $shrpenv
a0d0e21e 136
c4f23d77 137# The following is used to include the current directory in
138# LD_LIBRARY_PATH if you are building a shared libperl.so.
139LDLIBPTH = $ldlibpth
140
a0d0e21e 141dynamic_ext = $dynamic_list
142static_ext = $static_list
143ext = \$(dynamic_ext) \$(static_ext)
cd4d8a96 144DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT)
2304df62 145
146libs = $libs $cryptlib
147
909b3858 148public = perl $suidperl utilities translators
2304df62 149
150shellflags = $shellflags
151
d96ebe2e 152# This is set to MAKE=$make if your $make command doesn't
153# do it for you.
154$make_set_make
4633a7c4 155
dfe9444c 156# These variables may need to be manually set for non-Unix systems.
4633a7c4 157AR = $ar
dfe9444c 158EXE_EXT = $_exe
159LIB_EXT = $_a
160OBJ_EXT = $_o
161PATH_SEP = $p_
4633a7c4 162
163FIRSTMAKEFILE = $firstmakefile
164
165# Any special object files needed by this architecture, e.g. os2/os2.obj
166ARCHOBJS = $archobjs
167
cd4d8a96 168.SUFFIXES: .c \$(OBJ_EXT)
169
d96ebe2e 170# grrr
171SHELL = $sh
655635e8 172
2304df62 173!GROK!THIS!
174
85e6fe83 175## In the following dollars and backticks do not need the extra backslash.
2304df62 176$spitshell >>Makefile <<'!NO!SUBS!'
177
d96ebe2e 178CCCMD = `sh $(shellflags) cflags $(LIBPERL) $@`
2304df62 179
fed7345c 180private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
2304df62 181
4633a7c4 182# Files to be built with variable substitution before miniperl
183# is available.
184sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \
185 makedir.SH perl_exp.SH writemain.SH
186
187shextract = Makefile cflags config.h makeaperl makedepend \
655635e8 188 makedir perl.exp writemain
4633a7c4 189
190# Files to be built with variable substitution after miniperl is
191# available. Dependencies handled manually below (for now).
2304df62 192
909b3858 193pl = pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL
4633a7c4 194
909b3858 195plextract = pod/pod2html pod/pod2latex pod/pod2man pod/pod2text
4633a7c4 196
197addedbyconf = UU $(shextract) $(plextract) pstruct
2304df62 198
fed7345c 199h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
a0d0e21e 200h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h
2304df62 201h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h
12ca11f6 202h4 = regexp.h scope.h sv.h unixish.h util.h perlio.h thread.h
33b839e2 203h5 = bytecode.h byterun.h
204h = $(h1) $(h2) $(h3) $(h4) $(h5)
2304df62 205
33b839e2 206c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c byterun.c
a0d0e21e 207c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c
760ac839 208c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c universal.c globals.c perlio.c
2304df62 209
a0d0e21e 210c = $(c1) $(c2) $(c3) miniperlmain.c perlmain.c
2304df62 211
33b839e2 212obj1 = $(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) byterun$(OBJ_EXT)
cd4d8a96 213obj2 = 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)
760ac839 214obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT)
655635e8 215
4633a7c4 216obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
2304df62 217
a0d0e21e 218# Once perl has been Configure'd and built ok you build different
219# perl variants (Debugging, Embedded, Multiplicity etc) by saying:
d96ebe2e 220# make clean; make LIBPERL=libperl<type>.a
a0d0e21e 221# where <type> is some combination of 'd' and(or) 'e' or 'm'.
222# See cflags to understand how this works.
223#
d96ebe2e 224# This mechanism is getting clunky and might not even work any more.
225# EMBEDDING is on by default, and MULTIPLICITY doesn't work.
226#
a0d0e21e 227
2304df62 228lintflags = -hbvxac
229
cd4d8a96 230.c$(OBJ_EXT):
d96ebe2e 231 $(CCCMD) $(PLDLFLAGS) $*.c
2304df62 232
655635e8 233all: $(FIRSTMAKEFILE) miniperl $(private) $(plextract) $(public) $(dynamic_ext)
909b3858 234 @echo " "; echo " Everything is up to date."
235
236translators: miniperl lib/Config.pm FORCE
c4f23d77 237 @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all
8e07c86e 238
909b3858 239utilities: miniperl lib/Config.pm FORCE
c4f23d77 240 @echo " "; echo " Making utilities"; cd utils; $(LDLIBPTH) $(MAKE) all
909b3858 241
242
16d20bd9 243# This is now done by installman only if you actually want the man pages.
244# @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
85e6fe83 245
246# Phony target to force checking subdirectories.
e50aee73 247# Apparently some makes require an action for the FORCE target.
85e6fe83 248FORCE:
4633a7c4 249 @sh -c true
85e6fe83 250
cd4d8a96 251miniperlmain$(OBJ_EXT): miniperlmain.c
d96ebe2e 252 $(CCCMD) $(PLDLFLAGS) $*.c
ecfc5424 253
655635e8 254perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE)
a0d0e21e 255 sh writemain $(DYNALOADER) $(static_ext) > tmp
256 sh mv-if-diff tmp perlmain.c
85e6fe83 257
cd4d8a96 258perlmain$(OBJ_EXT): perlmain.c
d96ebe2e 259 $(CCCMD) $(PLDLFLAGS) $*.c
85e6fe83 260
a0d0e21e 261# The file ext.libs is a list of libraries that must be linked in
262# for static extensions, e.g. -lm -lgdbm, etc. The individual
263# static extension Makefile's add to it.
fed7345c 264ext.libs: $(static_ext)
a0d0e21e 265 -@test -f ext.libs || touch ext.libs
85e6fe83 266
ecfc5424 267!NO!SUBS!
599a829f 268
d96ebe2e 269# How to build libperl. This is still rather convoluted.
599a829f 270# Load up custom Makefile.SH fragment for shared loading and executables:
d96ebe2e 271if test -r $osname/Makefile.SHs ; then
272 . $osname/Makefile.SHs
273 $spitshell >>Makefile <<!GROK!THIS!
cd4d8a96 274
275Makefile: $osname/Makefile.SHs
cd4d8a96 276!GROK!THIS!
277else
f0efd8cf 278 $spitshell >>Makefile <<'!NO!SUBS!'
9c9e9f08 279$(LIBPERL): $& perl$(OBJ_EXT) $(obj)
280!NO!SUBS!
d96ebe2e 281 case "$useshrplib" in
282 true)
283 $spitshell >>Makefile <<'!NO!SUBS!'
3c321fdc 284 $(LD) $(SHRPLDFLAGS) -o $@ perl$(OBJ_EXT) $(obj)
285!NO!SUBS!
286 case "$osname" in
287 aix)
288 $spitshell >>Makefile <<'!NO!SUBS!'
289 mv $@ libperl$(OBJ_EXT)
290 $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
ecfc5424 291!NO!SUBS!
3c321fdc 292 ;;
293 esac
d96ebe2e 294 ;;
295 *)
296 $spitshell >>Makefile <<'!NO!SUBS!'
297 rm -f $(LIBPERL)
298 $(AR) rcu $(LIBPERL) perl$(OBJ_EXT) $(obj)
299 @$(ranlib) $(LIBPERL)
655635e8 300!NO!SUBS!
d96ebe2e 301 ;;
302 esac
599a829f 303 $spitshell >>Makefile <<'!NO!SUBS!'
304
305# How to build executables.
306
307# The $& notation tells Sequent machines that it can do a parallel make,
308# and is harmless otherwise.
309# The miniperl -w -MExporter line is a basic cheap test to catch errors
310# before make goes on to run preplibrary and then MakeMaker on extensions.
311# This is very handy because later errors are often caused by miniperl
312# build problems but that's not obvious to the novice.
313# The Module used here must not depend on Config or any extensions.
314
315miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)
c4f23d77 316 $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL) $(libs)
317 @ $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
599a829f 318
319perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
c4f23d77 320 $(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
599a829f 321
322pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
c4f23d77 323 $(SHRPENV) $(LDLIBPTH) purify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
599a829f 324
dbadb36a 325purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
c4f23d77 326 $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
dbadb36a 327
599a829f 328quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
c4f23d77 329 $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
2304df62 330
331# This version, if specified in Configure, does ONLY those scripts which need
332# set-id emulation. Suidperl must be setuid root. It contains the "taint"
333# checks as well as the special code to validate that the script in question
334# has been invoked correctly.
335
d96ebe2e 336suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
c4f23d77 337 $(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
2304df62 338
599a829f 339!NO!SUBS!
340
341fi
342
343$spitshell >>Makefile <<'!NO!SUBS!'
344
cd4d8a96 345sperl$(OBJ_EXT): perl.c perly.h patchlevel.h $(h)
2304df62 346 $(RMS) sperl.c
85e6fe83 347 $(LNS) perl.c sperl.c
d96ebe2e 348 $(CCCMD) -DIAMSUID sperl.c
2304df62 349 $(RMS) sperl.c
350
fec02dd3 351# We have to call our ./makedir because Ultrix 4.3 make can't handle the line
352# test -d lib/auto || mkdir lib/auto
353#
4633a7c4 354preplibrary: miniperl lib/Config.pm $(plextract)
cd4d8a96 355 @sh ./makedir lib/auto
a0d0e21e 356 @echo " AutoSplitting perl library"
c4f23d77 357 @$(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \
a0d0e21e 358 autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
2304df62 359
75f92628 360# Take care to avoid modifying lib/Config.pm without reason
fb73857a 361# (If trying to create a new port and having problems with the configpm script,
362# try 'make minitest' and/or commenting out the tests at the end of configpm.)
655635e8 363lib/Config.pm: config.sh miniperl configpm
c4f23d77 364 $(LDLIBPTH) ./miniperl configpm tmp
75f92628 365 sh mv-if-diff tmp lib/Config.pm
2304df62 366
37120919 367lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm
c4f23d77 368 $(LDLIBPTH) ./miniperl minimod.pl > tmp && mv tmp $@
fed7345c 369
4633a7c4 370$(plextract): miniperl lib/Config.pm
c4f23d77 371 $(LDLIBPTH) ./miniperl -Ilib $@.PL
372
16d20bd9 373install: all install.perl install.man
374
cd4d8a96 375install.perl: all installperl
c4f23d77 376 $(LDLIBPTH) ./perl installperl
a0d0e21e 377
cd4d8a96 378install.man: all installman
c4f23d77 379 $(LDLIBPTH) ./perl installman
16d20bd9 380
84902520 381# XXX Experimental. Hardwired values, but useful for testing.
382# Eventually Configure could ask for some of these values.
383install.html: all installhtml
c4f23d77 384 $(LDLIBPTH) ./perl installhtml \
84902520 385 --podroot=. --podpath=. --recurse \
386 --htmldir=$(privlib)/html \
387 --htmlroot=$(privlib)/html \
388 --splithead=pod/perlipc \
389 --splititem=pod/perlfunc \
390 --libpods=perlfunc:perlguts:perlvar:perlrun:perlop \
391 --verbose
392
16d20bd9 393
a0d0e21e 394# I now supply perly.c with the kits, so the following section is
56febc5e 395# used only if you force byacc to run by saying
396# make run_byacc
397# Since we patch up the byacc output, the perly.fixer script needs
398# to run with precisely the same version of byacc as I use. You
399# normally shouldn't remake perly.[ch].
400
232e078e 401run_byacc: FORCE
28757baa 402 @ echo 'Expect' 113 shift/reduce and 1 reduce/reduce conflict
56febc5e 403 $(BYACC) -d perly.y
fb73857a 404 chmod 664 perly.c
56febc5e 405 sh $(shellflags) ./perly.fixer y.tab.c perly.c
55497cff 406 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
407 -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
408 echo 'extern YYSTYPE yylval;' >>y.tab.h
409 cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h
fb73857a 410 chmod 664 vms/perly_c.vms vms/perly_h.vms
411 perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
56febc5e 412
413# We don't want to regenerate perly.c and perly.h, but they might
414# appear out-of-date after a patch is applied or a new distribution is
415# made.
416perly.c: perly.y
cd4d8a96 417 -@sh -c true
56febc5e 418
419perly.h: perly.y
cd4d8a96 420 -@sh -c true
a0d0e21e 421
bd656b61 422# No compat3.sym here since and including the 5.004_50.
423SYM = global.sym interp.sym perlio.sym thread.sym
419eaf7b 424
425SYMH = perlvars.h thrdvar.h
426
a8581515 427# The following files are generated automatically
e50aee73 428# keywords.h: keywords.pl
429# opcode.h: opcode.pl
430# embed.h: embed.pl global.sym interp.sym
a8581515 431# byterun.h: bytecode.pl
432# byterun.c: bytecode.pl
433# lib/B/Asmdata.pm: bytecode.pl
e50aee73 434# The correct versions should be already supplied with the perl kit,
435# in case you don't have perl available.
436# To force them to run, type
437# make regen_headers
438regen_headers: FORCE
439 perl keywords.pl
440 perl opcode.pl
441 perl embed.pl
a8581515 442 perl bytecode.pl
8e07c86e 443
a0d0e21e 444# Extensions:
445# Names added to $(dynamic_ext) or $(static_ext) will automatically
fed7345c 446# get built. There should ordinarily be no need to change any of
a0d0e21e 447# this part of makefile.
448#
449# The dummy dependency is a place holder in case $(dynamic_ext) or
450# $(static_ext) is empty.
451#
452# DynaLoader may be needed for extensions that use Makefile.PL.
453
454$(DYNALOADER): miniperl preplibrary FORCE
c4f23d77 455 @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
a0d0e21e 456
457d_dummy $(dynamic_ext): miniperl preplibrary $(DYNALOADER) FORCE
c4f23d77 458 @$(LDLIBPTH) sh ext/util/make_ext dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
a0d0e21e 459
460s_dummy $(static_ext): miniperl preplibrary $(DYNALOADER) FORCE
c4f23d77 461 @$(LDLIBPTH) sh ext/util/make_ext static $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
2304df62 462
17b893d8 463clean: _tidy _mopup
70af249b 464
465realclean: _cleaner _mopup
4e2a5f63 466 @echo "Note that make realclean does not delete config.sh or Policy.sh"
70af249b 467
468clobber: _cleaner _mopup
4e2a5f63 469 rm -f config.sh cppstdin Policy.sh
70af249b 470
471distclean: clobber
472
473# Do not 'make _mopup' directly.
474_mopup:
cd4d8a96 475 rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c
fed7345c 476 rm -f perl.exp ext.libs
d96ebe2e 477 -rm -f perl.export perl.dll perl.libexp perl.map perl.def
70af249b 478 rm -f perl suidperl miniperl $(LIBPERL)
479
480# Do not 'make _tidy' directly.
481_tidy:
a0d0e21e 482 -cd pod; $(MAKE) clean
909b3858 483 -cd utils; $(MAKE) clean
484 -cd x2p; $(MAKE) clean
75f92628 485 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
fb73857a 486 sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \
a0d0e21e 487 done
ff68c719 488
489# Do not 'make _cleaner' directly.
490_cleaner:
4633a7c4 491 -cd os2; rm -f Makefile
909b3858 492 -cd pod; $(MAKE) realclean
493 -cd utils; $(MAKE) realclean
494 -cd x2p; $(MAKE) realclean
8e07c86e 495 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
fb73857a 496 sh ext/util/make_ext realclean $$x MAKE=$(MAKE) ; \
a0d0e21e 497 done
42793c05 498 rm -f *.orig */*.orig *~ */*~ core t/core t/c t/perl
a0d0e21e 499 rm -rf $(addedbyconf)
cd4d8a96 500 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
fed7345c 501 rm -f $(private)
a0d0e21e 502 rm -rf lib/auto
232e078e 503 rm -f lib/.exists
16d20bd9 504 rm -f h2ph.man pstruct
a0d0e21e 505 rm -rf .config
ecfc5424 506
2304df62 507# The following lint has practically everything turned on. Unfortunately,
508# you have to wade through a lot of mumbo jumbo that can't be suppressed.
509# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
510# for that spot.
511
512lint: perly.c $(c)
513 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
514
fb73857a 515# Need to unset during recursion to go out of loop.
516# The README below ensures that the dependency list is never empty and
517# that when MAKEDEPEND is empty $(FIRSTMAKEFILE) doesn't need rebuilding.
cd4d8a96 518
84902520 519MAKEDEPEND = Makefile makedepend
cd4d8a96 520
fb73857a 521$(FIRSTMAKEFILE): README $(MAKEDEPEND)
cd4d8a96 522 $(MAKE) depend MAKEDEPEND=
a0d0e21e 523
599a829f 524config.h: config_h.SH config.sh
655635e8 525 $(SHELL) config_h.SH
526
419eaf7b 527# This is an AIXism.
528perl.exp: perl_exp.SH config.sh $(SYM) $(SYMH)
655635e8 529 $(SHELL) perl_exp.SH
75f92628 530
a0d0e21e 531# When done, touch perlmain.c so that it doesn't get remade each time.
2304df62 532depend: makedepend
fb73857a 533 sh ./makedepend MAKE=$(MAKE)
a0d0e21e 534 - test -s perlmain.c && touch perlmain.c
2304df62 535 cd x2p; $(MAKE) depend
536
cd4d8a96 537# Cannot postpone this until $firstmakefile is ready ;-)
538makedepend: makedepend.SH config.sh
539 sh ./makedepend.SH
540
3e3baf6d 541test-prep: miniperl perl preplibrary $(dynamic_ext)
542 cd t && (rm -f perl$(EXE_EXT); $(LNS) ../perl$(EXE_EXT) perl$(EXE_EXT))
543
544test check: test-prep
c4f23d77 545 cd t && $(LDLIBPTH) ./perl TEST </dev/tty
3e3baf6d 546
547# For testing without a tty or controling terminal. See t/op/stat.t
548test-notty: test-prep
c4f23d77 549 cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl TEST
2304df62 550
d96ebe2e 551# Can't depend on lib/Config.pm because that might be where miniperl
552# is crashing.
599a829f 553minitest: miniperl
d96ebe2e 554 @echo "You may see some irrelevant test failures if you have been unable"
555 @echo "to build lib/Config.pm."
cd4d8a96 556 - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \
c4f23d77 557 && $(LDLIBPTH) ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t </dev/tty
16d20bd9 558
fb73857a 559# Handy way to run perlbug -ok without having to install and run the
84902520 560# installed perlbug. We don't re-run the tests here - we trust the user.
fb73857a 561# Please *don't* use this unless all tests pass.
562# If you want to report test failures, just use "perlbug -Ilib".
188cd53f 563ok: utilities
c4f23d77 564 $(LBLIBPTH) ./perl -Ilib utils/perlbug -ok -s '(UNINSTALLED)'
84902520 565
85e6fe83 566clist: $(c)
2304df62 567 echo $(c) | tr ' ' '\012' >.clist
568
85e6fe83 569hlist: $(h)
2304df62 570 echo $(h) | tr ' ' '\012' >.hlist
571
85e6fe83 572shlist: $(sh)
2304df62 573 echo $(sh) | tr ' ' '\012' >.shlist
574
4633a7c4 575pllist: $(pl)
576 echo $(pl) | tr ' ' '\012' >.pllist
577
599a829f 578Makefile: Makefile.SH ./config.sh
760ac839 579 $(SHELL) Makefile.SH
580
599a829f 581distcheck: FORCE
760ac839 582 perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
583
3ee700d1 584etags:
585 sh emacs/ptags
586
2304df62 587# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
588# If this runs make out of memory, delete /usr/include lines.
589!NO!SUBS!
590
85e6fe83 591$eunicefix Makefile
2304df62 592case `pwd` in
593*SH)
85e6fe83 594 $rm -f ../Makefile
cd4d8a96 595 $ln Makefile ../Makefile
2304df62 596 ;;
597esac
cd4d8a96 598$rm -f $firstmakefile