perldoc under OS/2
[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)'
d96ebe2e 28case "$useshrplib" in
29true)
d5d19f97 30 pldlflags="$cccdlflags"
f0efd8cf 31 # NeXT-4 specific stuff. Can't we do this in the hint file?
d96ebe2e 32 case "${osname}${osvers}" in
33 next4*)
3c321fdc 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 40 linklibperl="-lperl"
41 ;;
3c321fdc 42 aix*)
43 shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
1553ab04 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 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 59esac
60
a0d0e21e 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 67done
68
69static_list=' '
a0d0e21e 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 73done
74
2304df62 75echo "Extracting Makefile (with variable substitutions)"
655635e8 76$spitshell >Makefile <<!GROK!THIS!
a0d0e21e 77# Makefile.SH
85e6fe83 78# This file is derived from Makefile.SH. Any changes made here will
79# be lost the next time you run Configure.
655635e8 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 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 89LDFLAGS = $ldflags
90CLDFLAGS = $ldflags
85e6fe83 91
2304df62 92SMALL = $small
93LARGE = $large $split
94mallocsrc = $mallocsrc
95mallocobj = $mallocobj
85e6fe83 96LNS = $lns
2304df62 97RMS = rm -f
85e6fe83 98ranlib = $ranlib
99
16d20bd9 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 103# installman commandline.
104bin = $installbin
105scriptdir = $scriptdir
d96ebe2e 106shrpdir = $archlibexp/CORE
16d20bd9 107privlib = $installprivlib
108man1dir = $man1dir
109man1ext = $man1ext
110man3dir = $man3dir
111man3ext = $man3ext
112
85e6fe83 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 123
124dynamic_ext = $dynamic_list
125static_ext = $static_list
126ext = \$(dynamic_ext) \$(static_ext)
cd4d8a96 127DYNALOADER = lib/auto/DynaLoader/DynaLoader\$(LIB_EXT)
2304df62 128
129libs = $libs $cryptlib
130
909b3858 131public = perl $suidperl utilities translators
2304df62 132
133shellflags = $shellflags
134
d96ebe2e 135# This is set to MAKE=$make if your $make command doesn't
136# do it for you.
137$make_set_make
4633a7c4 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 152.SUFFIXES: .c \$(OBJ_EXT)
153
d96ebe2e 154# grrr
155SHELL = $sh
655635e8 156
2304df62 157!GROK!THIS!
158
85e6fe83 159## In the following dollars and backticks do not need the extra backslash.
2304df62 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 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 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 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 187h = $(h1) $(h2) $(h3) $(h4)
188
a0d0e21e 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 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 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 204# where <type> is some combination of 'd' and(or) 'e' or 'm'.
205# See cflags to understand how this works.
206#
d96ebe2e 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 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 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 222utilities: miniperl lib/Config.pm FORCE
223 @echo " "; echo " Making utilities"; cd utils; $(MAKE) all
224
225
16d20bd9 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 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 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 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 254if test -r $osname/Makefile.SHs ; then
255 . $osname/Makefile.SHs
256 $spitshell >>Makefile <<!GROK!THIS!
cd4d8a96 257
258Makefile: $osname/Makefile.SHs
cd4d8a96 259!GROK!THIS!
260else
f0efd8cf 261 $spitshell >>Makefile <<'!NO!SUBS!'
9c9e9f08 262$(LIBPERL): $& perl$(OBJ_EXT) $(obj)
263!NO!SUBS!
d96ebe2e 264 case "$useshrplib" in
265 true)
266 $spitshell >>Makefile <<'!NO!SUBS!'
3c321fdc 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 275 ;;
276 esac
d96ebe2e 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 284 ;;
285 esac
599a829f 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 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 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 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 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 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 332 $(RMS) sperl.c
333
fec02dd3 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 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 345 ./miniperl configpm tmp
346 sh mv-if-diff tmp lib/Config.pm
2304df62 347
37120919 348lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm
349 ./miniperl minimod.pl > tmp && mv tmp $@
fed7345c 350
4633a7c4 351$(plextract): miniperl lib/Config.pm
352 ./miniperl -Ilib $@.PL
353
16d20bd9 354install: all install.perl install.man
355
cd4d8a96 356install.perl: all installperl
2304df62 357 ./perl installperl
a0d0e21e 358
cd4d8a96 359install.man: all installman
16d20bd9 360 ./perl installman
361
362# Not implemented yet.
cd4d8a96 363#install.html: all installhtml
16d20bd9 364# ./perl installhtml
365
a0d0e21e 366# I now supply perly.c with the kits, so the following section is
56febc5e 367# used only if you force byacc to run by saying
368# make run_byacc
369# Since we patch up the byacc output, the perly.fixer script needs
370# to run with precisely the same version of byacc as I use. You
371# normally shouldn't remake perly.[ch].
372
232e078e 373run_byacc: FORCE
28757baa 374 @ echo 'Expect' 113 shift/reduce and 1 reduce/reduce conflict
56febc5e 375 $(BYACC) -d perly.y
376 sh $(shellflags) ./perly.fixer y.tab.c perly.c
55497cff 377 sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
378 -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
379 echo 'extern YYSTYPE yylval;' >>y.tab.h
380 cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h
4633a7c4 381 - perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
56febc5e 382
383# We don't want to regenerate perly.c and perly.h, but they might
384# appear out-of-date after a patch is applied or a new distribution is
385# made.
386perly.c: perly.y
cd4d8a96 387 -@sh -c true
56febc5e 388
389perly.h: perly.y
cd4d8a96 390 -@sh -c true
a0d0e21e 391
e50aee73 392# The following three header files are generated automatically
393# keywords.h: keywords.pl
394# opcode.h: opcode.pl
395# embed.h: embed.pl global.sym interp.sym
396# The correct versions should be already supplied with the perl kit,
397# in case you don't have perl available.
398# To force them to run, type
399# make regen_headers
400regen_headers: FORCE
401 perl keywords.pl
402 perl opcode.pl
403 perl embed.pl
8e07c86e 404
a0d0e21e 405# Extensions:
406# Names added to $(dynamic_ext) or $(static_ext) will automatically
fed7345c 407# get built. There should ordinarily be no need to change any of
a0d0e21e 408# this part of makefile.
409#
410# The dummy dependency is a place holder in case $(dynamic_ext) or
411# $(static_ext) is empty.
412#
413# DynaLoader may be needed for extensions that use Makefile.PL.
414
415$(DYNALOADER): miniperl preplibrary FORCE
d96ebe2e 416 @sh ext/util/make_ext static $@ LIBPERL_A=$(LIBPERL)
a0d0e21e 417
418d_dummy $(dynamic_ext): miniperl preplibrary $(DYNALOADER) FORCE
d96ebe2e 419 @sh ext/util/make_ext dynamic $@ LIBPERL_A=$(LIBPERL)
a0d0e21e 420
421s_dummy $(static_ext): miniperl preplibrary $(DYNALOADER) FORCE
d96ebe2e 422 @sh ext/util/make_ext static $@ LIBPERL_A=$(LIBPERL)
2304df62 423
17b893d8 424clean: _tidy _mopup
70af249b 425
426realclean: _cleaner _mopup
427 @echo "Note that make realclean does not delete config.sh"
428
429clobber: _cleaner _mopup
430 rm -f config.sh cppstdin
431
432distclean: clobber
433
434# Do not 'make _mopup' directly.
435_mopup:
cd4d8a96 436 rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c
fed7345c 437 rm -f perl.exp ext.libs
d96ebe2e 438 -rm -f perl.export perl.dll perl.libexp perl.map perl.def
70af249b 439 rm -f perl suidperl miniperl $(LIBPERL)
440
441# Do not 'make _tidy' directly.
442_tidy:
a0d0e21e 443 -cd pod; $(MAKE) clean
909b3858 444 -cd utils; $(MAKE) clean
445 -cd x2p; $(MAKE) clean
75f92628 446 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
42793c05 447 sh ext/util/make_ext clean $$x ; \
a0d0e21e 448 done
ff68c719 449
450# Do not 'make _cleaner' directly.
451_cleaner:
4633a7c4 452 -cd os2; rm -f Makefile
909b3858 453 -cd pod; $(MAKE) realclean
454 -cd utils; $(MAKE) realclean
455 -cd x2p; $(MAKE) realclean
8e07c86e 456 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
42793c05 457 sh ext/util/make_ext realclean $$x ; \
a0d0e21e 458 done
42793c05 459 rm -f *.orig */*.orig *~ */*~ core t/core t/c t/perl
a0d0e21e 460 rm -rf $(addedbyconf)
cd4d8a96 461 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
fed7345c 462 rm -f $(private)
a0d0e21e 463 rm -rf lib/auto
232e078e 464 rm -f lib/.exists
16d20bd9 465 rm -f h2ph.man pstruct
a0d0e21e 466 rm -rf .config
ecfc5424 467
2304df62 468# The following lint has practically everything turned on. Unfortunately,
469# you have to wade through a lot of mumbo jumbo that can't be suppressed.
470# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
471# for that spot.
472
473lint: perly.c $(c)
474 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
475
cd4d8a96 476# Need to unset during recursion to go out of loop
477
478MAKEDEPEND = makedepend
479
480$(FIRSTMAKEFILE): Makefile $(MAKEDEPEND)
481 $(MAKE) depend MAKEDEPEND=
a0d0e21e 482
599a829f 483config.h: config_h.SH config.sh
655635e8 484 $(SHELL) config_h.SH
485
486perl.exp: perl_exp.SH config.sh
487 $(SHELL) perl_exp.SH
75f92628 488
a0d0e21e 489# When done, touch perlmain.c so that it doesn't get remade each time.
2304df62 490depend: makedepend
cd4d8a96 491 sh ./makedepend
a0d0e21e 492 - test -s perlmain.c && touch perlmain.c
2304df62 493 cd x2p; $(MAKE) depend
494
cd4d8a96 495# Cannot postpone this until $firstmakefile is ready ;-)
496makedepend: makedepend.SH config.sh
497 sh ./makedepend.SH
498
3e3baf6d 499test-prep: miniperl perl preplibrary $(dynamic_ext)
500 cd t && (rm -f perl$(EXE_EXT); $(LNS) ../perl$(EXE_EXT) perl$(EXE_EXT))
501
502test check: test-prep
503 cd t && ./perl TEST </dev/tty
504
505# For testing without a tty or controling terminal. See t/op/stat.t
506test-notty: test-prep
507 cd t && PERL_SKIP_TTY_TEST=1 ./perl TEST
2304df62 508
d96ebe2e 509# Can't depend on lib/Config.pm because that might be where miniperl
510# is crashing.
599a829f 511minitest: miniperl
d96ebe2e 512 @echo "You may see some irrelevant test failures if you have been unable"
513 @echo "to build lib/Config.pm."
cd4d8a96 514 - cd t && (rm -f perl$(EXE_EXT); $(LNS) ../miniperl$(EXE_EXT) perl$(EXE_EXT)) \
44a8e56a 515 && ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t </dev/tty
16d20bd9 516
85e6fe83 517clist: $(c)
2304df62 518 echo $(c) | tr ' ' '\012' >.clist
519
85e6fe83 520hlist: $(h)
2304df62 521 echo $(h) | tr ' ' '\012' >.hlist
522
85e6fe83 523shlist: $(sh)
2304df62 524 echo $(sh) | tr ' ' '\012' >.shlist
525
4633a7c4 526pllist: $(pl)
527 echo $(pl) | tr ' ' '\012' >.pllist
528
599a829f 529Makefile: Makefile.SH ./config.sh
760ac839 530 $(SHELL) Makefile.SH
531
599a829f 532distcheck: FORCE
760ac839 533 perl '-MExtUtils::Manifest=&fullcheck' -e 'fullcheck()'
534
2304df62 535# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
536# If this runs make out of memory, delete /usr/include lines.
537!NO!SUBS!
538
85e6fe83 539$eunicefix Makefile
2304df62 540case `pwd` in
541*SH)
85e6fe83 542 $rm -f ../Makefile
cd4d8a96 543 $ln Makefile ../Makefile
2304df62 544 ;;
545esac
cd4d8a96 546$rm -f $firstmakefile