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.SH < prev    next >
Makefile  |  1992-04-11  |  9KB  |  367 lines

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