3 if test -f config.sh; then TOP=.;
4 elif 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=../../../..;
9 echo "Can't find config.sh."; exit 1
14 : This forces SH files to create target in same directory as SH file.
15 : This is so that make depend always knows where to find SH derivatives.
17 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
21 *define*) suidperl='suidperl' ;;
25 : Certain parts of Makefile need to be commented out if dynamic
26 : loading is not used.
32 echo "Extracting Makefile (with variable substitutions)"
33 : This section of the file will have variable substitutions done on it.
34 : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
35 : Protect any dollar signs and backticks that you do not want interpreted
36 : by putting a backslash in front. You may delete these comments.
37 $spitshell >Makefile <<!GROK!THIS!
38 # $Makefile.SH,v $Revision: 4.1 $Date: 92/08/07 17:18:08 $
39 # This file is derived from Makefile.SH. Any changes made here will
40 # be lost the next time you run Configure.
41 # Makefile is used to generate makefile. The only difference
42 # is that makefile has the dependencies filled in at the end.
44 # \$Log: Makefile.SH,v \$
45 # Revision 4.1 92/08/07 17:18:08 lwall
48 # Revision 4.0.1.4 92/06/08 11:40:43 lwall
49 # patch20: cray didn't give enough memory to /bin/sh
50 # patch20: various and sundry fixes
52 # Revision 4.0.1.3 91/11/05 15:48:11 lwall
53 # patch11: saberized perl
54 # patch11: added support for dbz
56 # Revision 4.0.1.2 91/06/07 10:14:43 lwall
57 # patch4: cflags now emits entire cc command except for the filename
58 # patch4: alternate make programs are now semi-supported
59 # patch4: uperl.o no longer tries to link in libraries prematurely
60 # patch4: installperl now installs x2p stuff too
62 # Revision 4.0.1.1 91/04/11 17:30:39 lwall
63 # patch1: C flags are now settable on a per-file basis
65 # Revision 4.0 91/03/20 00:58:54 lwall
70 # I now supply perly.c with the kits, so don't remake perly.c without byacc
74 scriptdir = $scriptdir
75 privlib = $installprivlib
83 mallocsrc = $mallocsrc
84 mallocobj = $mallocobj
92 # The following are used to build and install shared libraries for
94 LDDLFLAGS = $lddlflags
95 CCDLFLAGS = $ccdlflags
96 CCCDLFLAGS = $cccdlflags
97 SHLIBSUFFIX = $shlibsuffix
99 libs = $libs $cryptlib
101 public = perl $suidperl
103 shellflags = $shellflags
105 ## To use an alternate make, set $altmake in config.sh.
106 MAKE = ${altmake-make}
109 ## In the following dollars and backticks do not need the extra backslash.
110 $spitshell >>Makefile <<'!NO!SUBS!'
112 CCCMD = `sh $(shellflags) cflags $@`
118 manpages = perl.man h2ph.man
122 sh = Makefile.SH cflags.SH embed_h.SH makedepend.SH makedir.SH writemain.SH
124 h1 = EXTERN.h INTERN.h av.h cop.h config.h embed.h form.h handy.h
125 h2 = hv.h op.h opcode.h perl.h regcomp.h regexp.h gv.h sv.h util.h
127 h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
128 h2 = embed.h form.h gv.h handy.h hv.h hvdbm.h keywords.h mg.h op.h
129 h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h
130 h4 = regexp.h scope.h sv.h unixish.h util.h
131 h = $(h1) $(h2) $(h3) $(h4)
133 c1 = av.c scope.c op.c doop.c doio.c dump.c hv.c
134 c2 = $(mallocsrc) mg.c perly.c pp.c regcomp.c regexec.c
135 c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c
137 c = $(c1) $(c2) $(c3) $(dlsrc) miniperlmain.c perlmain.c
139 s1 = av.c scope.c op.c doop.c doio.c dump.c hv.c
140 s2 = $(mallocsrc) mg.c perly.c pp.c regcomp.c regexec.c
141 s3 = gv.c sv.c taint.c toke.c util.c deb.c run.c perly.c
143 saber = $(s1) $(s2) $(s3) $(dlsrc)
145 obj1 = av.o scope.o op.o doop.o doio.o dump.o hv.o
146 obj2 = $(mallocobj) mg.o perly.o pp.o regcomp.o regexec.o
147 obj3 = gv.o sv.o taint.o toke.o util.o deb.o run.o
149 obj = $(obj1) $(obj2) $(obj3)
153 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
161 all: miniperl perl lib/Config.pm
163 #all: $(public) $(private) $(util) $(scripts)
164 # cd x2p; $(MAKE) all
167 # Phony target to force checking subdirectories.
172 ### Some makes have problems with the following dependency
173 ### if $(dlsrc) or $(dlobj) is empty.
174 ### Therefore, comment it out if dlsrc is null.
176 $spitshell >>Makefile <<!GROK!THIS!
178 ${comment}\$(dlsrc): \$(dldir)/\$(dlsrc)
179 ${comment} cp \$(dldir)/\$(dlsrc) \$(dlsrc)
181 ${comment}\$(dlobj): \$(dlsrc)
182 ${comment} \$(CCCMD) \$(dlsrc)
187 ### Boilerplate for all the .xs files in the ext directory.
188 ### XXX FIXME: At some point we also need to copy .pm files out of
189 ### XXX the ext directory into lib.
190 ### XXX FIXME: At some point we need to run autosplit on the .pm
192 ### Configure sets extensions to a string like
193 ### "ext/dbm/NDBM_File.xs ext/dbm/ODBM_File.xs ext/dbm/GDBM_File.xs \
194 ### ext/dbm/SDBM_File.xs ext/posix/POSIX.xs"
199 # extradep gives any extra dependencies of this extension.
200 # extraobj gives any extra thinks to link with this extension.
203 base=`echo $f | $sed -e 's@.*/\(.*\).xs@\1@'`
205 extsrc="$extsrc $base.c"
207 SDBM_File) extradep="ext/dbm/sdbm/libsdbm.a"
208 extraobj="ext/dbm/sdbm/libsdbm.a" ;;
215 define) extdep="$extdep lib/auto/$base/${base}\$(SHLIBSUFFIX)"
217 *) extdep="$extdep $base.o $extradep"
218 extobj="$extobj $base.o $extraobj" ;;
221 $spitshell >>Makefile <<!GROK!THIS!
225 \$(CCCMD) \$(CCCDLFLAGS) \$*.c
227 $base.c: $f ext/xsubpp ext/typemap
228 test -f miniperl || make miniperl
229 ./miniperl ext/xsubpp $f >tmp
232 ${comment}lib/auto/$base/$base\$(SHLIBSUFFIX): $base.o $extradep
233 ${comment} test -d lib/auto/$base || mkdir lib/auto/$base
234 ${comment} ld \$(LDDLFLAGS) -o \$@ $base.o $extraobj
239 $spitshell >>Makefile <<!GROK!THIS!
241 # List of extensions (used by writemain) to generate perlmain.c
244 # Extension dependencies.
246 # How to include extensions in linking command
249 ext/dbm/sdbm/libsdbm.a: ext/dbm/sdbm/sdbm.h ext/dbm/sdbm/sdbm.c
250 cd ext/dbm/sdbm; \$(MAKE) -f Makefile libsdbm.a
254 ### Now on to the rest of the Makefile.
255 $spitshell >>Makefile <<'!NO!SUBS!'
256 # The $& notation tells Sequent machines that it can do a parallel make,
257 # and is harmless otherwise.
259 miniperl: $& miniperlmain.o perl.o $(obj)
260 $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain.o perl.o $(obj) $(libs)
262 perlmain.c: miniperlmain.c
263 sh writemain $(ext) > perlmain.c
265 perlmain.o: perlmain.c
267 perl: $& perlmain.o perl.o $(obj) $(dlobj) $(extdep)
268 $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain.o perl.o $(obj) $(dlobj) $(extobj) $(libs)
270 pureperl: $& perlmain.o perl.o $(obj) $(dlobj) $(extdep)
271 purify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain.o perl.o $(obj) $(dlobj) $(extobj) $(libs)
273 quantperl: $& perlmain.o perl.o $(obj) $(dlobj) $(extdep)
274 quantify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain.o perl.o $(obj) $(dlobj) $(extobj) $(libs)
276 libperl.rlb: libperl.a
280 libperl.a: $& perl.o $(obj)
281 ar rcuv libperl.a $(obj)
283 # This version, if specified in Configure, does ONLY those scripts which need
284 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
285 # checks as well as the special code to validate that the script in question
286 # has been invoked correctly.
288 suidperl: $& sperl.o perlmain.o libperl.rlb
289 $(CC) $(LARGE) $(CLDFLAGS) sperl.o perlmain.o libperl.a $(libs) -o suidperl
291 lib/Config.pm: config.sh miniperl
298 sperl.o: perl.c perly.h patchlevel.h $(h)
300 $(LNS) perl.c sperl.c
301 $(CCCMD) -DIAMSUID sperl.c
305 @ echo Dummy dependency for dumb parallel make
311 embed.h: embed_h.SH global.sym interp.sym
315 @ echo 'Expect' 80 shift/reduce and 62 reduce/reduce conflicts
317 sh $(shellflags) ./perly.fixer y.tab.c perly.c
319 echo 'extern YYSTYPE yylval;' >>perly.h
321 perly.o: perly.c perly.h $(h)
328 rm -f *.o all perl miniperl
329 rm -f POSIX.c ?DBM_File.c perlmain.c
330 rm -f ext/dbm/sdbm/libsdbm.a
331 cd ext/dbm/sdbm; $(MAKE) -f Makefile clean
332 cd x2p; $(MAKE) clean
335 cd x2p; $(MAKE) realclean
336 cd ext/dbm/sdbm; $(MAKE) -f Makefile realclean
337 rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
338 rm -f Makefile cflags embed_h makedepend makedir writemain
339 rm -f config.h t/perl makefile makefile.old cflags
340 rm -rf lib/auto/?DBM_File lib/auto/POSIX
341 rm -f x2p/Makefile x2p/makefile x2p/makefile.old x2p/cflags
345 # The following lint has practically everything turned on. Unfortunately,
346 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
347 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
351 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
354 - test -f perly.h || cp /dev/null perly.h
356 - test -s perly.h || /bin/rm -f perly.h
357 cd x2p; $(MAKE) depend
359 test: perl lib/Config.pm
360 - cd t && chmod +x TEST */*.t
361 - cd t && (rm -f perl; $(LNS) ../perl perl) && ./perl TEST </dev/tty
364 echo $(c) | tr ' ' '\012' >.clist
367 echo $(h) | tr ' ' '\012' >.hlist
370 echo $(sh) | tr ' ' '\012' >.shlist
372 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
373 # If this runs make out of memory, delete /usr/include lines.
380 ln Makefile ../Makefile