home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / src / perl / Makefile < prev    next >
Makefile  |  1992-08-19  |  8KB  |  328 lines

  1. # : Makefile.SH,v 17045Revision: 4.0.1.3 17045Date: 91/11/05 15:48:11 $
  2. #
  3. # $Log:    Makefile.SH,v $
  4. # Revision 4.0.1.3  91/11/05  15:48:11  lwall
  5. # patch11: saberized perl
  6. # patch11: added support for dbz
  7. # Revision 4.0.1.2  91/06/07  10:14:43  lwall
  8. # patch4: cflags now emits entire cc command except for the filename
  9. # patch4: alternate make programs are now semi-supported
  10. # patch4: uperl.o no longer tries to link in libraries prematurely
  11. # patch4: installperl now installs x2p stuff too
  12. # Revision 4.0.1.1  91/04/11  17:30:39  lwall
  13. # patch1: C flags are now settable on a per-file basis
  14. # Revision 4.0  91/03/20  00:58:54  lwall
  15. # 4.0 baseline.
  16.  
  17. CC = gcc
  18. YACC = /bin/yacc
  19. bin = /usr/local/bin
  20. scriptdir = /usr/local/bin
  21. privlib = /usr/local/lib/perl
  22. mansrc = /usr/local/man/manl
  23. manext = l
  24. LDFLAGS = 
  25. CLDFLAGS = 
  26. SMALL = 
  27. LARGE =  
  28. mallocsrc = malloc.c
  29. mallocobj = malloc.o
  30. SLN = ln -s
  31. RMS = rm -f
  32.  
  33. libs = -ldbm -lm 
  34.  
  35. public = perl taintperl 
  36.  
  37. # To use an alternate make, set  in config.sh.
  38. MAKE = make
  39.  
  40.  
  41. CCCMD = `sh cflags $@`
  42.  
  43. private = 
  44.  
  45. scripts = h2ph
  46.  
  47. manpages = perl.man h2ph.man
  48.  
  49. util =
  50.  
  51. sh = Makefile.SH makedepend.SH h2ph.SH
  52.  
  53. h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
  54. h2 = hash.h perl.h regcomp.h regexp.h spat.h stab.h str.h util.h
  55.  
  56. h = $(h1) $(h2)
  57.  
  58. c1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
  59. c2 = eval.c form.c hash.c $(mallocsrc) perl.c regcomp.c regexec.c
  60. c3 = stab.c str.c toke.c util.c usersub.c
  61.  
  62. c = $(c1) $(c2) $(c3)
  63.  
  64. s1 = array.c cmd.c cons.c consarg.c doarg.c doio.c dolist.c dump.c
  65. s2 = eval.c form.c hash.c perl.c regcomp.c regexec.c
  66. s3 = stab.c str.c toke.c util.c usersub.c perly.c
  67.  
  68. saber = $(s1) $(s2) $(s3)
  69.  
  70. obj1 = array.o cmd.o cons.o consarg.o doarg.o doio.o dolist.o dump.o
  71. obj2 = eval.o form.o $(mallocobj) perl.o regcomp.o regexec.o
  72. obj3 = stab.o str.o toke.o util.o
  73.  
  74. obj = $(obj1) $(obj2) $(obj3)
  75.  
  76. tobj1 = tarray.o tcmd.o tcons.o tconsarg.o tdoarg.o tdoio.o tdolist.o tdump.o
  77. tobj2 = teval.o tform.o thash.o $(mallocobj) tregcomp.o tregexec.o
  78. tobj3 = tstab.o tstr.o ttoke.o tutil.o
  79.  
  80. tobj = $(tobj1) $(tobj2) $(tobj3)
  81.  
  82. lintflags = -hbvxac
  83.  
  84. addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
  85.  
  86. # grrr
  87. SHELL = /bin/sh
  88.  
  89. .c.o:
  90.     $(CCCMD) $*.c
  91.  
  92. all: $(public) $(private) $(util) uperl.o $(scripts)
  93.     cd x2p; $(MAKE) all
  94.     touch all
  95.  
  96. # This is the standard version that contains no "taint" checks and is
  97. # used for all scripts that aren't set-id or running under something set-id.
  98. # The $& notation is tells Sequent machines that it can do a parallel make,
  99. # and is harmless otherwise.
  100.  
  101. perl: $& perly.o $(obj) hash.o usersub.o
  102.     $(CC) $(LARGE) $(CLDFLAGS) $(obj) hash.o perly.o usersub.o $(libs) -o perl
  103.  
  104. # This command assumes that /usr/include/dbz.h and /usr/lib/dbz.o exist.
  105.  
  106. dbzperl: $& perly.o $(obj) zhash.o usersub.o
  107.     $(CC) $(LARGE) $(CLDFLAGS) $(obj) zhash.o /usr/lib/dbz.o perly.o usersub.o $(libs) -o dbzperl
  108.  
  109. zhash.o: hash.c $(h)
  110.     $(RMS) zhash.c
  111.     $(SLN) hash.c zhash.c
  112.     $(CCCMD) -DWANT_DBZ zhash.c
  113.     $(RMS) zhash.c
  114.  
  115. uperl.o: $& perly.o $(obj) hash.o
  116.     -ld $(LARGE) $(LDFLAGS) -r $(obj) hash.o perly.o -o uperl.o
  117.  
  118. saber: $(saber)
  119.     # load $(saber)
  120.     # load /lib/libm.a
  121.  
  122. # This version, if specified in Configure, does ONLY those scripts which need
  123. # set-id emulation.  Suidperl must be setuid root.  It contains the "taint"
  124. # checks as well as the special code to validate that the script in question
  125. # has been invoked correctly.
  126.  
  127. suidperl: $& tperly.o sperl.o $(tobj) usersub.o
  128.     $(CC) $(LARGE) $(CLDFLAGS) sperl.o $(tobj) tperly.o usersub.o $(libs) \
  129.         -o suidperl
  130.  
  131. # This version interprets scripts that are already set-id either via a wrapper
  132. # or through the kernel allowing set-id scripts (bad idea).  Taintperl must
  133. # NOT be setuid to root or anything else.  The only difference between it
  134. # and normal perl is the presence of the "taint" checks.
  135.  
  136. taintperl: $& tperly.o tperl.o $(tobj) usersub.o
  137.     $(CC) $(LARGE) $(CLDFLAGS) tperl.o $(tobj) tperly.o usersub.o $(libs) \
  138.         -o taintperl
  139.  
  140. # Replicating all this junk is yucky, but I don't see a portable way to fix it.
  141.  
  142. tperly.o: perly.c perly.h $(h)
  143.     $(RMS) tperly.c
  144.     $(SLN) perly.c tperly.c
  145.     $(CCCMD) -DTAINT tperly.c
  146.     $(RMS) tperly.c
  147.  
  148. tperl.o: perl.c perly.h patchlevel.h perl.h $(h)
  149.     $(RMS) tperl.c
  150.     $(SLN) perl.c tperl.c
  151.     $(CCCMD) -DTAINT tperl.c
  152.     $(RMS) tperl.c
  153.  
  154. sperl.o: perl.c perly.h patchlevel.h $(h)
  155.     $(RMS) sperl.c
  156.     $(SLN) perl.c sperl.c
  157.     $(CCCMD) -DTAINT -DIAMSUID sperl.c
  158.     $(RMS) sperl.c
  159.  
  160. tarray.o: array.c $(h)
  161.     $(RMS) tarray.c
  162.     $(SLN) array.c tarray.c
  163.     $(CCCMD) -DTAINT tarray.c
  164.     $(RMS) tarray.c
  165.  
  166. tcmd.o: cmd.c $(h)
  167.     $(RMS) tcmd.c
  168.     $(SLN) cmd.c tcmd.c
  169.     $(CCCMD) -DTAINT tcmd.c
  170.     $(RMS) tcmd.c
  171.  
  172. tcons.o: cons.c $(h) perly.h
  173.     $(RMS) tcons.c
  174.     $(SLN) cons.c tcons.c
  175.     $(CCCMD) -DTAINT tcons.c
  176.     $(RMS) tcons.c
  177.  
  178. tconsarg.o: consarg.c $(h)
  179.     $(RMS) tconsarg.c
  180.     $(SLN) consarg.c tconsarg.c
  181.     $(CCCMD) -DTAINT tconsarg.c
  182.     $(RMS) tconsarg.c
  183.  
  184. tdoarg.o: doarg.c $(h)
  185.     $(RMS) tdoarg.c
  186.     $(SLN) doarg.c tdoarg.c
  187.     $(CCCMD) -DTAINT tdoarg.c
  188.     $(RMS) tdoarg.c
  189.  
  190. tdoio.o: doio.c $(h)
  191.     $(RMS) tdoio.c
  192.     $(SLN) doio.c tdoio.c
  193.     $(CCCMD) -DTAINT tdoio.c
  194.     $(RMS) tdoio.c
  195.  
  196. tdolist.o: dolist.c $(h)
  197.     $(RMS) tdolist.c
  198.     $(SLN) dolist.c tdolist.c
  199.     $(CCCMD) -DTAINT tdolist.c
  200.     $(RMS) tdolist.c
  201.  
  202. tdump.o: dump.c $(h)
  203.     $(RMS) tdump.c
  204.     $(SLN) dump.c tdump.c
  205.     $(CCCMD) -DTAINT tdump.c
  206.     $(RMS) tdump.c
  207.  
  208. teval.o: eval.c $(h)
  209.     $(RMS) teval.c
  210.     $(SLN) eval.c teval.c
  211.     $(CCCMD) -DTAINT teval.c
  212.     $(RMS) teval.c
  213.  
  214. tform.o: form.c $(h)
  215.     $(RMS) tform.c
  216.     $(SLN) form.c tform.c
  217.     $(CCCMD) -DTAINT tform.c
  218.     $(RMS) tform.c
  219.  
  220. thash.o: hash.c $(h)
  221.     $(RMS) thash.c
  222.     $(SLN) hash.c thash.c
  223.     $(CCCMD) -DTAINT thash.c
  224.     $(RMS) thash.c
  225.  
  226. tregcomp.o: regcomp.c $(h)
  227.     $(RMS) tregcomp.c
  228.     $(SLN) regcomp.c tregcomp.c
  229.     $(CCCMD) -DTAINT tregcomp.c
  230.     $(RMS) tregcomp.c
  231.  
  232. tregexec.o: regexec.c $(h)
  233.     $(RMS) tregexec.c
  234.     $(SLN) regexec.c tregexec.c
  235.     $(CCCMD) -DTAINT tregexec.c
  236.     $(RMS) tregexec.c
  237.  
  238. tstab.o: stab.c $(h)
  239.     $(RMS) tstab.c
  240.     $(SLN) stab.c tstab.c
  241.     $(CCCMD) -DTAINT tstab.c
  242.     $(RMS) tstab.c
  243.  
  244. tstr.o: str.c $(h) perly.h
  245.     $(RMS) tstr.c
  246.     $(SLN) str.c tstr.c
  247.     $(CCCMD) -DTAINT tstr.c
  248.     $(RMS) tstr.c
  249.  
  250. ttoke.o: toke.c $(h) perly.h
  251.     $(RMS) ttoke.c
  252.     $(SLN) toke.c ttoke.c
  253.     $(CCCMD) -DTAINT ttoke.c
  254.     $(RMS) ttoke.c
  255.  
  256. tutil.o: util.c $(h)
  257.     $(RMS) tutil.c
  258.     $(SLN) util.c tutil.c
  259.     $(CCCMD) -DTAINT tutil.c
  260.     $(RMS) tutil.c
  261.  
  262. perly.h: perly.c
  263.     @ echo Dummy dependency for dumb parallel make
  264.     touch perly.h
  265.  
  266. perly.c: perly.y perly.fixer
  267.     @ echo 'Expect either' 29 shift/reduce and 59 reduce/reduce conflicts...
  268.     @ echo '           or' 27 shift/reduce and 61 reduce/reduce conflicts...
  269.     $(YACC) -d perly.y
  270.     sh ./perly.fixer y.tab.c perly.c
  271.     mv y.tab.h perly.h
  272.     echo 'extern YYSTYPE yylval;' >>perly.h
  273.  
  274. perly.o: perly.c perly.h $(h)
  275.     $(CCCMD) perly.c
  276.  
  277. install: all
  278.     ./perl installperl
  279.  
  280. clean:
  281.     rm -f *.o all perl taintperl suidperl
  282.     cd x2p; $(MAKE) clean
  283.  
  284. realclean: clean
  285.     cd x2p; $(MAKE) realclean
  286.     rm -f *.orig */*.orig *~ */*~ core $(addedbyconf) h2ph h2ph.man
  287.     rm -f perly.c perly.h t/perl Makefile config.h makedepend makedir
  288.     rm -f makefile x2p/Makefile x2p/makefile cflags x2p/cflags
  289.     rm -f c2ph pstruct
  290.  
  291. # The following lint has practically everything turned on.  Unfortunately,
  292. # you have to wade through a lot of mumbo jumbo that can't be suppressed.
  293. # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
  294. # for that spot.
  295.  
  296. lint: perly.c $(c)
  297.     lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz
  298.  
  299. depend: makedepend
  300.     - test -f perly.h || cp /dev/null perly.h
  301.     ./makedepend
  302.     - test -s perly.h || /bin/rm -f perly.h
  303.     cd x2p; $(MAKE) depend
  304.  
  305. test: perl
  306.     - cd t && chmod +x TEST */*.t
  307.     - cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST </dev/tty
  308.  
  309. clist:
  310.     echo $(c) | tr ' ' '\012' >.clist
  311.  
  312. hlist:
  313.     echo $(h) | tr ' ' '\012' >.hlist
  314.  
  315. shlist:
  316.     echo $(sh) | tr ' ' '\012' >.shlist
  317.  
  318. # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
  319. $(obj) hash.o:
  320.     @ echo "You haven't done a "'"make depend" yet!'; exit 1
  321. makedepend: makedepend.SH
  322.     /bin/sh makedepend.SH
  323.