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' ;;
28 patchlevel=`egrep '^#define[ ]+PATCHLEVEL' patchlevel.h \
31 *[0-9]) plibsuf=.$so.$patchlevel;;
37 *) shrpenv="env LD_RUN_PATH=$shrpdir";;
39 pldlflags="$cccdlflags";;
44 : Prepare dependency lists for Makefile.
46 for f in $dynamic_ext; do
47 : the dependency named here will never exist
48 base=`echo "$f" | sed 's/.*\///'`
49 dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext"
54 for f in $static_ext; do
55 base=`echo "$f" | sed 's/.*\///'`
56 static_list="$static_list lib/auto/$f/$base.a"
57 if test -f ext/$f/AutoInit.c; then
58 static_ai_list="$static_ai_list ext/$f/AutoInit.c"
60 if test -f ext/$f/AutoInit.pl; then
61 static_ai_list="$static_ai_list ext/$f/AutoInit.pl"
65 echo "Extracting Makefile (with variable substitutions)"
66 $spitshell >Makefile <<'!NO!SUBS!'
68 # This file is derived from Makefile.SH. Any changes made here will
69 # be lost the next time you run Configure.
70 # Makefile is used to generate makefile. The only difference
71 # is that makefile has the dependencies filled in at the end.
76 $spitshell >>Makefile <<!GROK!THIS!
77 # I now supply perly.c with the kits, so don't remake perly.c without byacc
87 mallocsrc = $mallocsrc
88 mallocobj = $mallocobj
93 # The following are mentioned only to make metaconfig include the
94 # appropriate questions in Configure. If you want to change these,
95 # edit config.sh instead, or specify --man1dir=/wherever on
96 # installman commandline.
98 scriptdir = $scriptdir
99 privlib = $installprivlib
105 # The following are used to build and install shared libraries for
107 LDDLFLAGS = $lddlflags
108 CCDLFLAGS = $ccdlflags
110 PLDLFLAGS = $pldlflags
114 dynamic_ext = $dynamic_list
115 static_ext = $static_list
116 ext = \$(dynamic_ext) \$(static_ext)
117 static_ext_autoinit = $static_ai_list
118 DYNALOADER = lib/auto/DynaLoader/DynaLoader.a
121 libs = $libs $cryptlib
123 public = perl $suidperl
125 shellflags = $shellflags
127 ## To use an alternate make, set \$altmake in config.sh.
128 MAKE = ${altmake-make}
130 # These variables will be used in a future version to make
131 # the make file more portable to non-unix systems.
138 FIRSTMAKEFILE = $firstmakefile
140 # Any special object files needed by this architecture, e.g. os2/os2.obj
145 ## In the following dollars and backticks do not need the extra backslash.
146 $spitshell >>Makefile <<'!NO!SUBS!'
148 CCCMD = `sh $(shellflags) cflags $(perllib) $@`
150 private = preplibrary lib/ExtUtils/Miniperl.pm lib/Config.pm
152 # Files to be built with variable substitution before miniperl
154 sh = Makefile.SH cflags.SH config_h.SH makeaperl.SH makedepend.SH \
155 makedir.SH perl_exp.SH writemain.SH
157 shextract = Makefile cflags config.h makeaperl makedepend \
158 makedir perl_exp writemain
160 # Files to be built with variable substitution after miniperl is
161 # available. Dependencies handled manually below (for now).
163 pl = c2ph.PL h2ph.PL h2xs.PL perldoc.PL \
164 pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL
166 plextract = c2ph h2ph h2xs perldoc \
167 pod/pod2html pod/pod2latex pod/pod2man
169 addedbyconf = UU $(shextract) $(plextract) pstruct
171 h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
172 h2 = embed.h form.h gv.h handy.h hv.h keywords.h mg.h op.h
173 h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h
174 h4 = regexp.h scope.h sv.h unixish.h util.h
175 h = $(h1) $(h2) $(h3) $(h4)
177 c1 = $(mallocsrc) av.c scope.c op.c doop.c doio.c dump.c hv.c mg.c
178 c2 = perl.c perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c
179 c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c globals.c
181 c = $(c1) $(c2) $(c3) miniperlmain.c perlmain.c
183 obj1 = $(mallocobj) gv.o toke.o perly.o op.o regcomp.o dump.o util.o mg.o
184 obj2 = hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
185 obj3 = doop.o doio.o regexec.o taint.o deb.o globals.o
188 obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
190 # Once perl has been Configure'd and built ok you build different
191 # perl variants (Debugging, Embedded, Multiplicity etc) by saying:
192 # make clean; make perllib=libperl<type>.a
193 # where <type> is some combination of 'd' and(or) 'e' or 'm'.
194 # See cflags to understand how this works.
196 # Eventually some form of 'make-a-perl' script will automate this
197 # together with linking a perl executable with any desired
199 perllib = libperl$(PLIBSUF)
207 $(CCCMD) $(PLDLFLAGS) $*.c
209 all: makefile miniperl $(private) $(plextract) $(public) $(dynamic_ext)
210 @echo " "; echo " Making x2p stuff"; cd x2p; $(MAKE) all
212 # This is now done by installman only if you actually want the man pages.
213 # @echo " "; echo " Making docs"; cd pod; $(MAKE) all;
215 # Phony target to force checking subdirectories.
216 # Apparently some makes require an action for the FORCE target.
220 # The $& notation tells Sequent machines that it can do a parallel make,
221 # and is harmless otherwise.
223 miniperl: $& miniperlmain.o $(perllib)
224 $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain.o $(perllib) $(libs)
226 miniperlmain.o: miniperlmain.c
227 $(CCCMD) $(PLDLFLAGS) $*.c
229 perlmain.c: miniperlmain.c config.sh makefile $(static_ext_autoinit)
230 sh writemain $(DYNALOADER) $(static_ext) > tmp
231 sh mv-if-diff tmp perlmain.c
233 perlmain.o: perlmain.c
234 $(CCCMD) $(PLDLFLAGS) $*.c
236 # The file ext.libs is a list of libraries that must be linked in
237 # for static extensions, e.g. -lm -lgdbm, etc. The individual
238 # static extension Makefile's add to it.
239 ext.libs: $(static_ext)
240 -@test -f ext.libs || touch ext.libs
242 perl: $& perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
243 $(SHRPENV) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain.o $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
245 pureperl: $& perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
246 purify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain.o $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
248 quantperl: $& perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
249 quantify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain.o $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
251 $(perllib): $& perl.o $(obj)
256 $spitshell >>Makefile <<'!NO!SUBS!'
257 $(LD) $(LDDLFLAGS) -o $@ perl.o $(obj)
261 $spitshell >>Makefile <<'!NO!SUBS!'
263 $(AR) rcu $(perllib) perl.o $(obj)
264 @$(ranlib) $(perllib)
269 $spitshell >>Makefile <<'!NO!SUBS!'
271 # This version, if specified in Configure, does ONLY those scripts which need
272 # set-id emulation. Suidperl must be setuid root. It contains the "taint"
273 # checks as well as the special code to validate that the script in question
274 # has been invoked correctly.
276 suidperl: $& sperl.o perlmain.o $(perllib) $(DYNALOADER) $(static_ext) ext.libs
277 $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain.o sperl.o $(perllib) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
279 sperl.o: perl.c perly.h patchlevel.h $(h)
281 $(LNS) perl.c sperl.c
282 $(CCCMD) -DIAMSUID sperl.c
285 # We have to call our ./makedir because Ultrix 4.3 make can't handle the line
286 # test -d lib/auto || mkdir lib/auto
288 preplibrary: miniperl lib/Config.pm $(plextract)
290 @echo " AutoSplitting perl library"
291 @./miniperl -Ilib -e 'use AutoSplit; \
292 autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
294 # Take care to avoid modifying lib/Config.pm without reason
295 lib/Config.pm: config.sh miniperl
296 ./miniperl configpm tmp
297 sh mv-if-diff tmp lib/Config.pm
299 lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl minimod.pl lib/Config.pm
300 ./miniperl minimod.pl > tmp && mv tmp $@
302 $(plextract): miniperl lib/Config.pm
303 ./miniperl -Ilib $@.PL
305 install: all install.perl install.man
313 # Not implemented yet.
317 # I now supply perly.c with the kits, so the following section is
318 # used only if you force byacc to run by saying
320 # Since we patch up the byacc output, the perly.fixer script needs
321 # to run with precisely the same version of byacc as I use. You
322 # normally shouldn't remake perly.[ch].
325 @ echo 'Expect' 129 shift/reduce and 1 reduce/reduce conflict
327 sh $(shellflags) ./perly.fixer y.tab.c perly.c
329 echo 'extern YYSTYPE yylval;' >>perly.h
330 - perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
332 # We don't want to regenerate perly.c and perly.h, but they might
333 # appear out-of-date after a patch is applied or a new distribution is
341 # The following three header files are generated automatically
342 # keywords.h: keywords.pl
343 # opcode.h: opcode.pl
344 # embed.h: embed.pl global.sym interp.sym
345 # The correct versions should be already supplied with the perl kit,
346 # in case you don't have perl available.
347 # To force them to run, type
355 # Names added to $(dynamic_ext) or $(static_ext) will automatically
356 # get built. There should ordinarily be no need to change any of
357 # this part of makefile.
359 # The dummy dependency is a place holder in case $(dynamic_ext) or
360 # $(static_ext) is empty.
362 # DynaLoader may be needed for extensions that use Makefile.PL.
364 $(DYNALOADER): miniperl preplibrary FORCE
365 @sh ext/util/make_ext static $@ LIBPERL_A=$(perllib)
367 d_dummy $(dynamic_ext): miniperl preplibrary $(DYNALOADER) FORCE
368 @sh ext/util/make_ext dynamic $@ LIBPERL_A=$(perllib)
370 s_dummy $(static_ext): miniperl preplibrary $(DYNALOADER) FORCE
371 @sh ext/util/make_ext static $@ LIBPERL_A=$(perllib)
374 rm -f *.o *.a all perlmain.c
375 rm -f perl.exp ext.libs
376 -cd x2p; $(MAKE) clean
377 -cd pod; $(MAKE) clean
378 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
379 sh ext/util/make_ext clean $$x ; \
381 rm -f perl suidperl miniperl $(perllib)
384 -cd x2p; $(MAKE) realclean
385 -cd pod; $(MAKE) realclean
386 -cd os2; rm -f Makefile
387 -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \
388 sh ext/util/make_ext realclean $$x ; \
390 rm -f *.orig */*.orig *~ */*~ core t/core t/c t/perl
391 rm -rf $(addedbyconf)
392 rm -f makefile makefile.old
396 rm -f h2ph.man pstruct
398 @echo "Note that make realclean does not delete config.sh"
401 rm -f config.sh cppstdin
405 # The following lint has practically everything turned on. Unfortunately,
406 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
407 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
411 lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
419 # When done, touch perlmain.c so that it doesn't get remade each time.
422 - test -s perlmain.c && touch perlmain.c
423 cd x2p; $(MAKE) depend
425 test: miniperl perl preplibrary $(dynamic_ext)
426 - cd t && chmod +x TEST */*.t
427 - cd t && (rm -f perl; $(LNS) ../perl perl) && ./perl TEST </dev/tty
430 - cd t && chmod +x TEST */*.t
431 - cd t && (rm -f perl; $(LNS) ../miniperl perl) \
432 && ./perl TEST base/*.t comp/*.t cmd/*.t io/*.t op/*.t </dev/tty
435 echo $(c) | tr ' ' '\012' >.clist
438 echo $(h) | tr ' ' '\012' >.hlist
441 echo $(sh) | tr ' ' '\012' >.shlist
444 echo $(pl) | tr ' ' '\012' >.pllist
446 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
447 # If this runs make out of memory, delete /usr/include lines.
454 ln Makefile ../Makefile