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