home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / LASER / PM120.ZIP / BUILTINS.MAK < prev    next >
Encoding:
Makefile  |  1990-04-08  |  9.3 KB  |  330 lines

  1. #**********************************************************************
  2. # builtins.mak - "built-in" rules for Borland MAKE utility
  3. #**********************************************************************
  4.  
  5. # we're on drive c
  6. DRIVE=C:
  7.  
  8. #**********************************************************************
  9. # if the symbol MAKE_INIT is defined, then it should contain a
  10. # filename which will be included here. this file can override 
  11. # defaults supplied below, etc.
  12. #**********************************************************************
  13.  
  14. !if $d(MAKE_INIT)
  15. !include "$(MAKE_INIT)"
  16. !endif
  17.  
  18. #**********************************************************************
  19. # set the names for the compiler, assembler, etc.
  20. #**********************************************************************
  21.  
  22. !if !$d(CMD_COMPILER)
  23. CMD_COMPILER=tcc
  24. !endif
  25.  
  26. !if !$d(CMD_PREPROCESS)
  27. CMD_PREPROCESS=cpp
  28. !endif
  29.  
  30. !if !$d(CMD_ASSEMBLER)
  31. CMD_ASSEMBLER=tasm
  32. !endif
  33.  
  34. !if !$d(CMD_LINKER)
  35. CMD_LINKER=tlink
  36. !endif
  37.  
  38. !if !$d(CMD_LIBMGR)
  39. CMD_LIBMGR=tlib
  40. !endif
  41.  
  42. #**********************************************************************
  43. # set the memory model if not already specified
  44. #**********************************************************************
  45.  
  46. !if $d(CC_SMALL_MODEL)
  47. CC_MEM_MODEL=s
  48. !endif
  49. !if $d(CC_MEDIUM_MODEL)
  50. CC_MEM_MODEL=m
  51. !endif
  52. !if $d(CC_COMPACT_MODEL)
  53. CC_MEM_MODEL=c
  54. !endif
  55. !if $d(CC_LARGE_MODEL)
  56. CC_MEM_MODEL=l
  57. !endif
  58.  
  59. !if !$d(CC_MEM_MODEL)
  60. CC_MEM_MODEL=l
  61. !endif
  62.  
  63. #**********************************************************************
  64. # set the optimization if not already specified
  65. #**********************************************************************
  66.  
  67. !if !$d(CC_OPTIMIZE)
  68. !if !$d(CC_DEBUG)
  69. CC_OPTIMIZE=-G -O -Z
  70. !else
  71. CC_OPTIMIZE=-G- -O- -Z-
  72. !endif
  73. !endif
  74.  
  75. #**********************************************************************
  76. # set the debugging options, if not already specified
  77. #**********************************************************************
  78.  
  79. !if !$d(CC_DEBUG)
  80. CC_DEBUG=
  81. !else
  82. CC_DEBUG=-v -N
  83. !endif
  84.  
  85. #**********************************************************************
  86. # miscellaneous compiler flags the user might want
  87. #**********************************************************************
  88.  
  89. !if !$d(CFLAGS)
  90. CFLAGS=
  91. !endif
  92.  
  93. #**********************************************************************
  94. # the compiler include files are here
  95. #**********************************************************************
  96.  
  97. CC_INCLUDE=$(DRIVE)\tc\inc
  98.  
  99. #**********************************************************************
  100. # tell where to find application include files
  101. #**********************************************************************
  102.  
  103. !if !$d(CC_APPL_INCLUDE)
  104. CC_APPL_INCLUDE=
  105. !endif
  106.  
  107. #**********************************************************************
  108. # controls structure packing
  109. #**********************************************************************
  110.  
  111. !if !$d(CC_PACK)
  112. CC_STRUC=-a
  113. !else
  114. CC_STRUC=-a-
  115. !endif
  116.  
  117. #**********************************************************************
  118. # this command runs the compiler
  119. #**********************************************************************
  120.  
  121. RUN_CC=$(CMD_COMPILER) -m$(CC_MEM_MODEL) $(CC_DEBUG) \
  122. -I$(CC_INCLUDE) -I$(CC_APPL_INCLUDE) $(CC_OPTIMIZE) -c -K $(CC_STRUC)
  123.  
  124. #**********************************************************************
  125. # here's how to compile a .c to get a .obj file
  126. #**********************************************************************
  127.  
  128. CC=$(RUN_CC) -o$* $&
  129.  
  130. .c.obj:
  131.     $(CC)
  132.  
  133. #**********************************************************************
  134. # this command runs the c preprocessor
  135. #**********************************************************************
  136.  
  137. RUN_CPP=$(CMD_PREPROCESS) -m$(CC_MEM_MODEL) \
  138. -I$(CC_INCLUDE) -I$(CC_APPL_INCLUDE) -A -P-
  139.  
  140. #**********************************************************************
  141. # create a .i file from a .c file (run cpp)
  142. #**********************************************************************
  143.  
  144. CPP=$(RUN_CPP) -o$&.i $&
  145.  
  146. .c.i:
  147.     $(CPP)
  148.  
  149. #**********************************************************************
  150. # this command runs the prototype generator
  151. #**********************************************************************
  152.  
  153. PROTO_ARGS=-r -i$(CC_APPL_INCLUDE) -i$(CC_INCLUDE) -o $*.pro 
  154.  
  155. PROTO=-proto $&.i $(PROTO_ARGS)
  156.  
  157. MAKEPROTO=-mkproto $&.i $(PROTO_ARGS)
  158.  
  159. RUN_PROTO=-proto $(PROTO_ARGS)
  160.  
  161. #**********************************************************************
  162. # a .pro file is a .h file containing function prototypes
  163. #**********************************************************************
  164.  
  165. .c.pro:
  166.     $(CPP)
  167.     $(MAKEPROTO)
  168.  
  169. .i.pro:
  170.     $(PROTO)
  171.  
  172. #**********************************************************************
  173. # user assembly language includes 
  174. #**********************************************************************
  175.  
  176. !if !$d(ASM_APPL_INCLUDE)
  177. ASM_APPL_INCLUDE=
  178. !endif
  179.  
  180. #**********************************************************************
  181. # the assembler include files are here
  182. #**********************************************************************
  183.  
  184. ASM_INCLUDE=$(DRIVE)\tc\mac
  185.  
  186. #**********************************************************************
  187. # by default, it thinks it's masm 5.1
  188. #**********************************************************************
  189.  
  190. !if !$d(ASM_SYNTAX)
  191. ASM_SYNTAX=MASM51
  192. !endif
  193.  
  194. #**********************************************************************
  195. # by default, everything should be case sensitive (for C)
  196. #**********************************************************************
  197.  
  198. !if !$d(ASM_CASE_SENS)
  199. ASM_CASE_SENS=/ml
  200. !endif
  201.  
  202. #**********************************************************************
  203. # debug info from assembler
  204. #**********************************************************************
  205.  
  206. !if !$d(ASM_DEBUG)
  207. ASM_DEBUG=/zi
  208. !endif
  209.  
  210. #**********************************************************************
  211. # miscellaneous assembler flags the user might want
  212. #**********************************************************************
  213.  
  214. !if !$d(AFLAGS)
  215. AFLAGS=
  216. !endif
  217.  
  218. #**********************************************************************
  219. # this command runs the assembler
  220. #**********************************************************************
  221.  
  222. RUN_ASM=$(CMD_ASSEMBLER) $(ASM_DEBUG) /j$(ASM_SYNTAX) /i$(ASM_INCLUDE) \
  223. /i$(ASM_APPL_INCLUDE) $(ASM_CASE_SENS) $(AFLAGS)
  224.  
  225. #**********************************************************************
  226. # here's how to assemble a .asm to get a .obj file
  227. #**********************************************************************
  228.  
  229. ASM=$(RUN_ASM) $&,$*
  230.  
  231. .asm.obj:
  232.     $(ASM)
  233.  
  234. #**********************************************************************
  235. # how to create a .lib from a .bld (a list of .obj's)
  236. #
  237. # a .bld file is a file containing a list of .obj filenames, each
  238. # preceded by a '-+' sequence, and each line except the last ends
  239. # with a '&' character
  240. #
  241. # the list of files in the .bld file should match the list of
  242. # .obj files in the library's dependency list in the makefile,
  243. # or else it isn't of much use
  244. #**********************************************************************
  245.  
  246. RUN_LIB=$(CMD_LIBMGR) /C
  247.  
  248. MAKELIB=$(RUN_LIB) $*.lib @$&.bld
  249.  
  250. .bld.lib:
  251.     $(MAKELIB)
  252.  
  253. #**********************************************************************
  254. # misc linker flags
  255. #**********************************************************************
  256.  
  257. !if !$d(LFLAGS)
  258. LFLAGS=
  259. !endif
  260.  
  261. #**********************************************************************
  262. # linker map file options
  263. #**********************************************************************
  264.  
  265. !if !$d(LINK_MAP)
  266. LINK_MAP=/m
  267. !endif
  268.  
  269. #**********************************************************************
  270. # linker debug info options
  271. #**********************************************************************
  272.  
  273. !if !$d(LINK_DBG)
  274. LINK_DBG=/v
  275. !endif
  276.  
  277. #**********************************************************************
  278. # macro for location of turbo libraries
  279. #**********************************************************************
  280.  
  281. !if !$d(CC_LIB_DIR)
  282. CC_LIB_DIR=$(DRIVE)\tc\lib
  283. !endif
  284.  
  285. #**********************************************************************
  286. # macros for full pathnames of compiler libraries
  287. #
  288. # if CC_NO_FLOAT is defined, then math libs will not be linked in
  289. # if CC_GRAFIX is defined, the graphics library will be searched
  290. #**********************************************************************
  291.  
  292. CC_STARTUP=$(CC_LIB_DIR)\c0$(CC_MEM_MODEL)
  293.  
  294. !if $d(CC_GRAFIX)
  295. CC_GRAFLIB=$(CC_LIB_DIR)\graphics
  296. !else
  297. CC_GRAFLIB=
  298. !endif
  299.  
  300. !if !$d(CC_FP_LIB)
  301. CC_FP_LIB=$(CC_LIB_DIR)\emu
  302. !endif
  303.  
  304. CC_MATH_LIB=$(CC_LIB_DIR)\math$(CC_MEM_MODEL)
  305.  
  306. CC_C_LIB=$(CC_LIB_DIR)\c$(CC_MEM_MODEL)
  307.  
  308. !if !$d(CC_NO_FLOAT)
  309. CC_LIBS=$(CC_GRAFLIB) $(CC_FP_LIB) $(CC_MATH_LIB) $(CC_C_LIB)
  310. !else
  311. CC_LIBS=$(CC_GRAFLIB) $(CC_C_LIB)
  312. !endif
  313.  
  314. #**********************************************************************
  315. # how to create a .exe file from a .lnk file
  316. # a .lnk file is a list of objs, libs, etc in linker command format
  317. # (see the documentation of the linker for more information)
  318. #
  319. # the list of .objs and .libs in the .lnk file should match the
  320. # dependency list for the .exe file, or else it isn't of much use
  321. #********************************************************************** 
  322.  
  323. RUN_LINK=$(CMD_LINKER) /c $(LFLAGS) $(LINK_MAP) $(LINK_DBG)
  324.  
  325. LINK=$(RUN_LINK) $(CC_STARTUP)+ @$&.lnk $(CC_LIBS)
  326.  
  327. .lnk.exe:
  328.     $(LINK)
  329.