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