home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / msdos / perl386 / makefile < prev    next >
Encoding:
Makefile  |  1993-07-21  |  9.3 KB  |  370 lines

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