home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / MAWK113.ZIP / mawk113 / msdos / Makefile.tcc < prev    next >
Makefile  |  1993-01-14  |  7KB  |  236 lines

  1.  
  2. #  this is a makefile for mawk under DOS
  3. #  with Borland make
  4. #
  5. #   make    --  mawk.exe
  6. #   make  -DLARGE   -- bmawk.exe
  7.  
  8. #  for a unix style command line add
  9. #  -DREARV=your_reargv_file without the extension
  10. #
  11. #  e.g. -DREARGV=argvmks
  12.  
  13. #$Log: Makefile.tcc,v $
  14. #Revision 1.4  1993/01/14  13:07:48  mike
  15. #RM macro
  16. #
  17. #Revision 1.3  1992/12/27  01:44:11  mike
  18. #have to use -G- to fit small model
  19. #a bunch of small changes
  20. #
  21. #Revision 1.2  1991/11/12  09:59:26  brennan
  22. #changed tcc to $(CC) and .o to .obj
  23. #
  24. #Revision 1.1  91/10/29  07:45:29  brennan
  25. #Initial revision
  26. #
  27.  
  28. .SWAP
  29.  
  30. # user settable
  31. # change here or override from command line e.g. -DCC=bcc
  32.  
  33. !if ! $d(CC)
  34. CC=tcc   # bcc or ? 
  35. !endif
  36.  
  37. !if ! $d(LIBDIR)
  38. LIBDIR =c:\lib    # where are your Borland C libraries ?
  39. !endif  
  40.  
  41. !if !  $d(FLOATLIB)
  42. FLOATLIB=emu   #  or  fp87 if you have fp87 hardware
  43. !endif
  44.  
  45. !if ! $d(WILDCARD)
  46. WILDCARD=$(LIBDIR)\wildargs.obj
  47. !endif
  48.  
  49. # compiler flags
  50. # -G optimize for speed
  51. # -d merge duplicate strings
  52. # -v- symbolic debugging off
  53. # -O  optimize
  54. CFLAGS = -c -d -v- -O 
  55.  
  56. !if $d(LARGE)
  57. OPT = -G
  58. !else
  59. OPT = -G-  # opt for size (getting too big)
  60. !endif
  61.  
  62.  
  63. LFLAGS = /c  #case sensitive linking
  64.  
  65. # how to delete a file
  66. !if ! $d(RM)
  67. RM = del    # rm
  68. !endif
  69.  
  70. # how to rename a file
  71. !if ! $d(RENAME)
  72. RENAME = rename  # mv
  73. !endif
  74.  
  75. ##############################
  76. # end of user settable
  77. #
  78.  
  79. !if ! $d(LARGE)
  80. MODEL=s
  81. TARGET=mawk
  82. !else  
  83. MODEL=l
  84. TARGET=bmawk
  85. CFLAGS=$(CFLAGS) -DHAVE_SMALL_MEMORY=0
  86. !endif
  87.  
  88. CFLAGS=-m$(MODEL) $(OPT) $(CFLAGS)
  89.  
  90.  
  91. !if  $d(REARGV)
  92. CFLAGS=$(CFLAGS) -DHAVE_REARGV=1 # over rides def in tcc_dos.h
  93. !endif
  94.  
  95. OBS = parse.obj \
  96. array.obj \
  97. bi_funct.obj \
  98. bi_vars.obj \
  99. cast.obj \
  100. code.obj \
  101. da.obj \
  102. error.obj \
  103. execute.obj \
  104. fcall.obj \
  105. field.obj \
  106. files.obj \
  107. fin.obj \
  108. hash.obj \
  109. init.obj \
  110. jmp.obj \
  111. kw.obj \
  112. main.obj \
  113. matherr.obj \
  114. memory.obj \
  115. print.obj \
  116. re_cmpl.obj \
  117. scan.obj \
  118. scancode.obj \
  119. split.obj \
  120. zmalloc.obj  \
  121. version.obj  \
  122. dosexec.obj
  123.  
  124. !if  $d(REARGV)  
  125. OBS = $(OBS) $(REARGV).obj
  126. !endif
  127.  
  128. !if  ! $d(LARGE)
  129. OBS=$(OBS) xdosexec.obj
  130. !endif
  131.  
  132. REXP_OBS = rexp.obj \
  133. rexp0.obj \
  134. rexp1.obj \
  135. rexp2.obj \
  136. rexp3.obj
  137.  
  138. LIBS = $(LIBDIR)\$(FLOATLIB) \
  139. $(LIBDIR)\math$(MODEL) $(LIBDIR)\c$(MODEL)
  140.  
  141. $(TARGET).exe : $(OBS)  $(REXP_OBS)
  142.     tlink $(LFLAGS) @&&!
  143.     $(LIBDIR)\c0$(MODEL) $(WILDCARD) $(OBS) $(REXP_OBS)
  144.     $(TARGET),$(TARGET)
  145.     $(LIBS)
  146. !
  147.  
  148. .c.obj :
  149.     $(CC) $(CFLAGS) {$*.c }
  150.  
  151.  
  152. scancode.c :  makescan.c  scan.h
  153.     $(CC) makescan.c
  154.     makescan.exe > scancode.c
  155.     $(RM) makescan.obj  
  156.     $(RM) makescan.exe
  157.  
  158. xdosexec.obj  :  msdos\xdosexec.see
  159.     $(CC) msdos\see2obj.c
  160.     see2obj < msdos\xdosexec.see > xdosexec.obj
  161.     $(RM) see2obj.exe
  162.  
  163. #xdosexec.obj  :  xdosexec.asm
  164. #    masm /mx /z xdosexec ;
  165.  
  166. ###################################################
  167. # parse.c is provided in distribution( made with byacc)
  168. # so you don't need to make it.
  169. # But if you do:  here's how:
  170. # To make it with bison1.14 under msdos
  171. # parse.c : parse.y parse2.xc
  172. #    bison -dy parse.y
  173. #    bmawk -f modbison.awk y_tab.c parse2.xc > parse.c
  174. #    $(RENAME) y_tab.h parse.h
  175. #    $(RM) y_tab.c
  176. ########################################
  177.  
  178.  
  179. clean  :
  180.     $(RM)  *.obj
  181.  
  182.  
  183. RFLAGS=-Irexp -DMAWK
  184.  
  185. !if  $d(LARGE)
  186. RFLAGS=$(RFLAGS) -DLMDOS
  187. !endif
  188.  
  189. # there must be a better way to do this
  190. rexp.obj  :  rexp/rexp.c  rexp/rexp.h
  191.     $(CC) $(CFLAGS) $(RFLAGS) rexp/rexp.c
  192.  
  193. rexp0.obj  :  rexp/rexp0.c  rexp/rexp.h
  194.     $(CC) $(CFLAGS) $(RFLAGS) rexp/rexp0.c
  195.  
  196. rexp1.obj  :  rexp/rexp1.c  rexp/rexp.h
  197.     $(CC) $(CFLAGS) $(RFLAGS) rexp/rexp1.c
  198.  
  199. rexp2.obj  :  rexp/rexp2.c  rexp/rexp.h
  200.     $(CC) $(CFLAGS) $(RFLAGS) rexp/rexp2.c
  201.  
  202. rexp3.obj  :  rexp/rexp3.c  rexp/rexp.h
  203.     $(CC) $(CFLAGS) $(RFLAGS) rexp/rexp3.c
  204.  
  205.  
  206. #  dependencies of .objs on .h
  207. array.obj : bi_vars.h sizes.h zmalloc.h memory.h types.h field.h mawk.h config.h symtype.h config/Idefault.h
  208. bi_funct.obj : fin.h bi_vars.h sizes.h memory.h zmalloc.h regexp.h types.h field.h repl.h files.h bi_funct.h mawk.h config.h symtype.h init.h config/Idefault.h
  209. bi_vars.obj : bi_vars.h sizes.h memory.h zmalloc.h types.h field.h mawk.h config.h symtype.h config/Idefault.h init.h
  210. cast.obj : parse.h sizes.h memory.h zmalloc.h types.h field.h scan.h repl.h mawk.h config.h symtype.h config/Idefault.h
  211. code.obj : sizes.h memory.h zmalloc.h types.h field.h code.h jmp.h mawk.h config.h symtype.h config/Idefault.h init.h
  212. da.obj : sizes.h memory.h zmalloc.h types.h field.h repl.h code.h bi_funct.h mawk.h config.h symtype.h config/Idefault.h
  213. error.obj : parse.h bi_vars.h sizes.h types.h scan.h mawk.h config.h symtype.h config/Idefault.h
  214. execute.obj : bi_vars.h fin.h sizes.h memory.h zmalloc.h regexp.h types.h field.h code.h repl.h bi_funct.h mawk.h config.h symtype.h config/Idefault.h
  215. fcall.obj : sizes.h memory.h zmalloc.h types.h code.h mawk.h config.h symtype.h config/Idefault.h
  216. field.obj : parse.h bi_vars.h sizes.h memory.h zmalloc.h regexp.h types.h field.h scan.h repl.h mawk.h config.h symtype.h config/Idefault.h init.h
  217. files.obj : fin.h sizes.h memory.h zmalloc.h types.h files.h mawk.h config.h config/Idefault.h
  218. fin.obj : parse.h fin.h bi_vars.h sizes.h memory.h zmalloc.h types.h field.h scan.h mawk.h config.h symtype.h config/Idefault.h
  219. hash.obj : sizes.h memory.h zmalloc.h types.h mawk.h config.h symtype.h config/Idefault.h
  220. init.obj : bi_vars.h sizes.h memory.h zmalloc.h types.h field.h code.h mawk.h config.h symtype.h config/Idefault.h init.h
  221. jmp.obj : sizes.h memory.h zmalloc.h types.h code.h mawk.h jmp.h config.h symtype.h config/Idefault.h init.h
  222. kw.obj : parse.h sizes.h types.h mawk.h config.h symtype.h config/Idefault.h init.h
  223. main.obj : fin.h bi_vars.h sizes.h memory.h zmalloc.h types.h field.h code.h files.h mawk.h config.h symtype.h config/Idefault.h init.h
  224. makescan.obj : parse.h scan.h symtype.h
  225. matherr.obj : sizes.h types.h mawk.h config.h config/Idefault.h
  226. memory.obj : sizes.h memory.h zmalloc.h types.h mawk.h config.h config/Idefault.h
  227. parse.obj : bi_vars.h sizes.h memory.h zmalloc.h types.h field.h code.h files.h bi_funct.h mawk.h jmp.h config.h symtype.h config/Idefault.h
  228. print.obj : bi_vars.h parse.h sizes.h memory.h zmalloc.h types.h field.h scan.h files.h bi_funct.h mawk.h config.h symtype.h config/Idefault.h
  229. re_cmpl.obj : parse.h sizes.h memory.h zmalloc.h regexp.h types.h scan.h repl.h mawk.h config.h symtype.h config/Idefault.h
  230. scan.obj : parse.h fin.h sizes.h memory.h zmalloc.h types.h field.h scan.h repl.h code.h files.h mawk.h config.h symtype.h config/Idefault.h init.h
  231. split.obj : bi_vars.h parse.h sizes.h memory.h zmalloc.h regexp.h types.h field.h scan.h bi_funct.h mawk.h config.h symtype.h config/Idefault.h
  232. version.obj : patchlev.h sizes.h types.h mawk.h config.h config/Idefault.h
  233. zmalloc.obj : sizes.h zmalloc.h types.h mawk.h config.h config/Idefault.h
  234. dosexec.obj : fin.h sizes.h memory.h zmalloc.h types.h files.h mawk.h config/Idefault.h config.h
  235.