summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile311
1 files changed, 110 insertions, 201 deletions
diff --git a/Makefile b/Makefile
index 867f56d02e..0babdb10ab 100644
--- a/Makefile
+++ b/Makefile
@@ -26,32 +26,34 @@
#
#
+# I now supply perly.c with the kits, so don't remake perly.c without byacc
+BYACC = byacc
CC = cc
-YACC = /bin/yacc
bin = /usr/local/bin
scriptdir = /usr/local/bin
privlib = /usr/local/lib/perl
-mansrc = /usr/man/manl
-manext = l
+mansrc = /usr/local/man/man1
+manext = 1
LDFLAGS =
CLDFLAGS =
SMALL =
LARGE =
mallocsrc = malloc.c
mallocobj = malloc.o
+dlsrc = dl.c
+dlobj = dl.o
SLN = ln -s
RMS = rm -f
-libs = -ldbm -lm -lposix
+libs = -ldbm -ldl -lm -lposix
-public = perl
+public = perl
shellflags =
# To use an alternate make, set in config.sh.
MAKE = make
-
CCCMD = `sh $(shellflags) cflags $@`
private =
@@ -67,31 +69,29 @@ sh = Makefile.SH makedepend.SH h2ph.SH
h1 = EXTERN.h INTERN.h av.h cop.h config.h embed.h form.h handy.h
h2 = hv.h op.h opcode.h perl.h regcomp.h regexp.h gv.h sv.h util.h
-h = $(h1) $(h2)
+h1 = EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h
+h2 = embed.h form.h gv.h handy.h hv.h hvdbm.h keywords.h mg.h op.h
+h3 = opcode.h patchlevel.h perl.h perly.h pp.h proto.h regcomp.h
+h4 = regexp.h scope.h sv.h unixish.h util.h
+h = $(h1) $(h2) $(h3) $(h4)
-c1 = av.c cop.c cons.c consop.c doop.c doio.c dolist.c
-c2 = eval.c hv.c main.c $(mallocsrc) perl.c pp.c regcomp.c regexec.c
-c3 = gv.c sv.c toke.c util.c usersub.c
+c1 = av.c scope.c op.c doop.c doio.c dump.c hv.c
+c2 = $(mallocsrc) mg.c perly.c pp.c regcomp.c regexec.c
+c3 = gv.c sv.c taint.c toke.c util.c deb.c run.c
c = $(c1) $(c2) $(c3)
-s1 = av.c cop.c cons.c consop.c doop.c doio.c dolist.c
-s2 = eval.c hv.c main.c perl.c pp.c regcomp.c regexec.c
-s3 = gv.c sv.c toke.c util.c usersub.c perly.c
+s1 = av.c scope.c op.c doop.c doio.c dump.c hv.c
+s2 = $(mallocobj) mg.c perly.c pp.c regcomp.c regexec.c
+s3 = gv.c sv.c taint.c toke.c util.c deb.c run.c perly.c
saber = $(s1) $(s2) $(s3)
-obj1 = av.o scope.o op.o doop.o doio.o dolist.o dump.o
-obj2 = $(mallocobj) mg.o pp.o regcomp.o regexec.o
-obj3 = gv.o sv.o toke.o util.o deb.o run.o
-
-obj = $(obj1) $(obj2) $(obj3)
-
-tobj1 = tav.o tcop.o tcons.o tconsop.o tdoop.o tdoio.o tdolist.o tdump.o
-tobj2 = teval.o thv.o $(mallocobj) tpp.o tregcomp.o tregexec.o
-tobj3 = tgv.o tsv.o ttoke.o tutil.o
+obj1 = av.o scope.o op.o doop.o doio.o dump.o hv.o
+obj2 = $(mallocobj) mg.o perly.o pp.o regcomp.o regexec.o
+obj3 = gv.o sv.o taint.o toke.o util.o deb.o run.o
-tobj = $(tobj1) $(tobj2) $(tobj3)
+obj = $(obj1) $(obj2) $(obj3) $(dlobj)
lintflags = -hbvxac
@@ -100,215 +100,129 @@ addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
# grrr
SHELL = /bin/sh
+.SUFFIXES: .x
+
.c.o:
$(CCCMD) $*.c
+.x.c:
+ sh writemain $*.x >$*.c
-all: perl
+all: miniperl perl lib/Config.pm
-#all: $(public) $(private) $(util) uperl.o $(scripts)
+#all: $(public) $(private) $(util) $(scripts)
# cd x2p; $(MAKE) all
# touch all
-# This is the standard version that contains no "taint" checks and is
-# used for all scripts that aren't set-id or running under something set-id.
-# The $& notation is tells Sequent machines that it can do a parallel make,
+# NDBM_File extension
+NDBM_File.c: ext/dbm/NDBM_File.xs ext/xsubpp ext/typemap
+ test -f miniperl || make miniperl
+ ext/xsubpp ext/dbm/NDBM_File.xs >tmp
+ mv tmp NDBM_File.c
+
+NDBM_File.o: NDBM_File.c
+
+# ODBM_File extension
+ODBM_File.c: ext/dbm/ODBM_File.xs ext/xsubpp ext/typemap
+ test -f miniperl || make miniperl
+ ext/xsubpp ext/dbm/ODBM_File.xs >tmp
+ mv tmp ODBM_File.c
+
+ODBM_File.o: ODBM_File.c
+
+# GDBM_File extension
+GDBM_File.c: ext/dbm/GDBM_File.xs ext/xsubpp ext/typemap
+ test -f miniperl || make miniperl
+ ext/xsubpp ext/dbm/GDBM_File.xs >tmp
+ mv tmp GDBM_File.c
+
+GDBM_File.o: GDBM_File.c
+
+# SDBM_File extension
+SDBM_File.c: ext/dbm/SDBM_File.xs ext/xsubpp ext/typemap
+ test -f miniperl || make miniperl
+ ext/xsubpp ext/dbm/SDBM_File.xs >tmp
+ mv tmp SDBM_File.c
+
+SDBM_File.o: SDBM_File.c
+
+lib/auto/SDBM_File/SDBM_File.so: SDBM_File.o ext/dbm/sdbm/libsdbm.a
+ @- mkdir lib/auto/SDBM_File 2>/dev/null
+ ld -o lib/auto/SDBM_File/SDBM_File.so SDBM_File.o ext/dbm/sdbm/libsdbm.a
+
+ext/dbm/sdbm/libsdbm.a: ext/dbm/sdbm/sdbm.c ext/dbm/sdbm/sdbm.h
+ cd ext/dbm/sdbm; $(MAKE) sdbm
+
+# POSIX extension
+POSIX.c: ext/posix/POSIX.xs ext/xsubpp ext/typemap
+ test -f miniperl || make miniperl
+ ext/xsubpp ext/posix/POSIX.xs >tmp
+ mv tmp POSIX.c
+
+POSIX.o: POSIX.c
+lib/auto/POSIX/POSIX.so: POSIX.o ext/dbm/sdbm/libsdbm.a
+ @- mkdir lib/auto/POSIX 2>/dev/null
+ ld -o lib/auto/POSIX/POSIX.so POSIX.o ext/dbm/sdbm/libsdbm.a
+extobjs= ext/dbm/NDBM_File.xs.o ext/dbm/ODBM_File.xs.o ext/dbm/GDBM_File.xs.o ext/dbm/SDBM_File.xs.o ext/posix/POSIX.xs.o
+# The $& notation tells Sequent machines that it can do a parallel make,
# and is harmless otherwise.
-perl: $& main.o perly.o perl.o $(obj) hv.o usersub.o
- $(CC) -Bstatic $(LARGE) $(CLDFLAGS) main.o perly.o perl.o $(obj) hv.o usersub.o $(libs) -o perl
- echo ""
+miniperlmain.c: miniperlmain.x
+miniperlmain.o: miniperlmain.c
+miniperl: $& miniperlmain.o perl.o $(obj)
+ $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain.o perl.o $(obj) $(libs)
+
+perlmain.c: perlmain.x
+perlmain.o: perlmain.c
+perl: $& perlmain.o perl.o $(obj) NDBM_File.o ODBM_File.o POSIX.o
+ $(CC) $(LARGE) $(CLDFLAGS) -o perl perlmain.o perl.o $(obj) NDBM_File.o ODBM_File.o POSIX.o $(libs)
libperl.rlb: libperl.a
ranlib libperl.a
touch libperl.rlb
-libperl.a: $& perly.o perl.o $(obj) hv.o usersub.o
- ar rcuv libperl.a $(obj) hv.o perly.o usersub.o
+libperl.a: $& perl.o $(obj)
+ ar rcuv libperl.a $(obj)
# This version, if specified in Configure, does ONLY those scripts which need
# set-id emulation. Suidperl must be setuid root. It contains the "taint"
# checks as well as the special code to validate that the script in question
# has been invoked correctly.
-suidperl: $& sperl.o tmain.o libtperl.rlb
- $(CC) $(LARGE) $(CLDFLAGS) sperl.o tmain.o libtperl.a $(libs) -o suidperl
-
-# This version interprets scripts that are already set-id either via a wrapper
-# or through the kernel allowing set-id scripts (bad idea). Taintperl must
-# NOT be setuid to root or anything else. The only difference between it
-# and normal perl is the presence of the "taint" checks.
-
-taintperl: $& tmain.o libtperl.rlb
- $(CC) $(LARGE) $(CLDFLAGS) tmain.o libtperl.a $(libs) -o taintperl
-
-libtperl.rlb: libtperl.a
- ranlib libtperl.a
- touch libtperl.rlb
-
-libtperl.a: $& tperly.o tperl.o $(tobj) thv.o usersub.o
- ar rcuv libtperl.a $(tobj) thv.o tperly.o usersub.o tperl.o
+suidperl: $& sperl.o main.o libperl.rlb
+ $(CC) $(LARGE) $(CLDFLAGS) sperl.o main.o libperl.a $(libs) -o suidperl
-# This command assumes that /usr/include/dbz.h and /usr/lib/dbz.o exist.
-
-dbzperl: $& main.o zhv.o libperl.rlb
- $(CC) $(LARGE) $(CLDFLAGS) main.o zhv.o /usr/lib/dbz.o libperl.a $(libs) -o dbzperl
-
-zhv.o: hv.c $(h)
- $(RMS) zhv.c
- $(SLN) hv.c zhv.c
- $(CCCMD) -DWANT_DBZ zhv.c
- $(RMS) zhv.c
-
-uperl.o: $& $(obj) main.o hv.o perly.o
- -ld $(LARGE) $(LDFLAGS) -r $(obj) main.o hv.o perly.o -o uperl.o
+lib/Config.pm: config.sh
+ ./configpm
saber: $(saber)
# load $(saber)
# load /lib/libm.a
-# Replicating all this junk is yucky, but I don't see a portable way to fix it.
-
-tperly.o: perly.c perly.h $(h)
- $(RMS) tperly.c
- $(SLN) perly.c tperly.c
- $(CCCMD) -DTAINT tperly.c
- $(RMS) tperly.c
-
-tperl.o: perl.c perly.h patchlevel.h perl.h $(h)
- $(RMS) tperl.c
- $(SLN) perl.c tperl.c
- $(CCCMD) -DTAINT tperl.c
- $(RMS) tperl.c
-
sperl.o: perl.c perly.h patchlevel.h $(h)
$(RMS) sperl.c
$(SLN) perl.c sperl.c
- $(CCCMD) -DTAINT -DIAMSUID sperl.c
+ $(CCCMD) -DIAMSUID sperl.c
$(RMS) sperl.c
-tav.o: av.c $(h)
- $(RMS) tav.c
- $(SLN) av.c tav.c
- $(CCCMD) -DTAINT tav.c
- $(RMS) tav.c
-
-tcop.o: cop.c $(h)
- $(RMS) tcop.c
- $(SLN) cop.c tcop.c
- $(CCCMD) -DTAINT tcop.c
- $(RMS) tcop.c
-
-tcons.o: cons.c $(h) perly.h
- $(RMS) tcons.c
- $(SLN) cons.c tcons.c
- $(CCCMD) -DTAINT tcons.c
- $(RMS) tcons.c
-
-tconsop.o: consop.c $(h)
- $(RMS) tconsop.c
- $(SLN) consop.c tconsop.c
- $(CCCMD) -DTAINT tconsop.c
- $(RMS) tconsop.c
-
-tdoop.o: doop.c $(h)
- $(RMS) tdoop.c
- $(SLN) doop.c tdoop.c
- $(CCCMD) -DTAINT tdoop.c
- $(RMS) tdoop.c
-
-tdoio.o: doio.c $(h)
- $(RMS) tdoio.c
- $(SLN) doio.c tdoio.c
- $(CCCMD) -DTAINT tdoio.c
- $(RMS) tdoio.c
-
-tdolist.o: dolist.c $(h)
- $(RMS) tdolist.c
- $(SLN) dolist.c tdolist.c
- $(CCCMD) -DTAINT tdolist.c
- $(RMS) tdolist.c
-
-tdump.o: dump.c $(h)
- $(RMS) tdump.c
- $(SLN) dump.c tdump.c
- $(CCCMD) -DTAINT tdump.c
- $(RMS) tdump.c
-
-teval.o: eval.c $(h)
- $(RMS) teval.c
- $(SLN) eval.c teval.c
- $(CCCMD) -DTAINT teval.c
- $(RMS) teval.c
-
-thv.o: hv.c $(h)
- $(RMS) thv.c
- $(SLN) hv.c thv.c
- $(CCCMD) -DTAINT thv.c
- $(RMS) thv.c
-
-tmain.o: main.c $(h)
- $(RMS) tmain.c
- $(SLN) main.c tmain.c
- $(CCCMD) -DTAINT tmain.c
- $(RMS) tmain.c
-
-tpp.o: pp.c $(h)
- $(RMS) tpp.c
- $(SLN) pp.c tpp.c
- $(CCCMD) -DTAINT tpp.c
- $(RMS) tpp.c
-
-tregcomp.o: regcomp.c $(h)
- $(RMS) tregcomp.c
- $(SLN) regcomp.c tregcomp.c
- $(CCCMD) -DTAINT tregcomp.c
- $(RMS) tregcomp.c
-
-tregexec.o: regexec.c $(h)
- $(RMS) tregexec.c
- $(SLN) regexec.c tregexec.c
- $(CCCMD) -DTAINT tregexec.c
- $(RMS) tregexec.c
-
-tgv.o: gv.c $(h)
- $(RMS) tgv.c
- $(SLN) gv.c tgv.c
- $(CCCMD) -DTAINT tgv.c
- $(RMS) tgv.c
-
-tsv.o: sv.c $(h) perly.h
- $(RMS) tsv.c
- $(SLN) sv.c tsv.c
- $(CCCMD) -DTAINT tsv.c
- $(RMS) tsv.c
-
-ttoke.o: toke.c $(h) perly.h
- $(RMS) ttoke.c
- $(SLN) toke.c ttoke.c
- $(CCCMD) -DTAINT ttoke.c
- $(RMS) ttoke.c
-
-tutil.o: util.c $(h)
- $(RMS) tutil.c
- $(SLN) util.c tutil.c
- $(CCCMD) -DTAINT tutil.c
- $(RMS) tutil.c
+dl.o: ext/dl/dl.c
+ cp ext/dl/dl.c dl.c
+ $(CC) -c dl.c
+
perly.h: perly.c
@ echo Dummy dependency for dumb parallel make
touch perly.h
-embed.h: embed_h.SH global.var interp.var
+opcode.h: opcode.pl
+ - opcode.pl
+
+embed.h: embed_h.SH global.sym interp.sym
sh embed_h.SH
-perly.c: perly.y perly.fixer
- @ \
-case "$(YACC)" in \
- *bison*) echo 'Expect' 25 shift/reduce and 53 reduce/reduce conflicts;; \
- *) echo 'Expect' 27 shift/reduce and 51 reduce/reduce conflicts;; \
-esac
- $(YACC) -d perly.y
+perly.c:
+ @ echo 'Expect' 80 shift/reduce and 62 reduce/reduce conflicts
+ $(BYACC) -d perly.y
sh $(shellflags) ./perly.fixer y.tab.c perly.c
mv y.tab.h perly.h
echo 'extern YYSTYPE yylval;' >>perly.h
@@ -320,13 +234,13 @@ install: all
./perl installperl
clean:
- rm -f *.o all perl taintperl suidperl perly.c
+ rm -f *.o all perl taintperl suidperl miniperl
cd x2p; $(MAKE) clean
realclean: clean
cd x2p; $(MAKE) realclean
rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
- rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir
+ rm -f perly.h t/perl Makefile config.h makedepend makedir
rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags
rm -f c2ph pstruct
@@ -358,9 +272,4 @@ shlist:
echo $(sh) | tr ' ' '\012' >.shlist
# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
-$(obj) hv.o:
- @ echo "You haven't done a "'"make depend" yet!'; exit 1
-
-makedepend: makedepend.SH
- /bin/sh $(shellflags) makedepend.SH
-
+# If this runs make out of memory, delete /usr/include lines.