home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / HARDDISK / BADCLU.ZIP / BUILTINS.MAK < prev    next >
Encoding:
Makefile  |  1990-04-25  |  9.4 KB  |  338 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_HUGE_MODEL)
  60. CC_MEM_MODEL=h
  61. !endif
  62.  
  63. !if !$d(CC_MEM_MODEL)
  64. CC_MEM_MODEL=l
  65. !endif
  66.  
  67. #**********************************************************************
  68. # set the optimization if not already specified
  69. #**********************************************************************
  70.  
  71. !if !$d(CC_OPTIMIZE)
  72. !if !$d(CC_DEBUG)
  73. CC_OPTIMIZE=-G -O -Z
  74. !else
  75. CC_OPTIMIZE=-G- -O- -Z-
  76. !endif
  77. !endif
  78.  
  79. #**********************************************************************
  80. # set the debugging options, if not already specified
  81. #**********************************************************************
  82.  
  83. !if !$d(CC_DEBUG)
  84. CC_DEBUG=
  85. !else
  86. CC_DEBUG=-v -N
  87. !endif
  88.  
  89. #**********************************************************************
  90. # miscellaneous compiler flags the user might want
  91. #**********************************************************************
  92.  
  93. !if !$d(CFLAGS)
  94. CFLAGS=
  95. !endif
  96.  
  97. #**********************************************************************
  98. # the compiler include files are here
  99. #**********************************************************************
  100.  
  101. CC_INCLUDE=$(DRIVE)\tc\inc
  102.  
  103. #**********************************************************************
  104. # tell where to find application include files
  105. #**********************************************************************
  106.  
  107. !if !$d(CC_APPL_INCLUDE)
  108. CC_APPL_INCLUDE=
  109. !endif
  110.  
  111. #**********************************************************************
  112. # controls structure packing
  113. #**********************************************************************
  114.  
  115. !if !$d(CC_ALIGN)
  116. CC_PACK=1
  117. !endif
  118.  
  119. !if !$d(CC_PACK)
  120. CC_STRUC=-a
  121. !else
  122. CC_STRUC=-a-
  123. !endif
  124.  
  125. #**********************************************************************
  126. # this command runs the compiler
  127. #**********************************************************************
  128.  
  129. RUN_CC=$(CMD_COMPILER) -m$(CC_MEM_MODEL) $(CC_DEBUG) \
  130. -I$(CC_INCLUDE) -I$(CC_APPL_INCLUDE) $(CC_OPTIMIZE) -c -K $(CC_STRUC)
  131.  
  132. #**********************************************************************
  133. # here's how to compile a .c to get a .obj file
  134. #**********************************************************************
  135.  
  136. CC=$(RUN_CC) -o$* $&
  137.  
  138. .c.obj:
  139.     $(CC)
  140.  
  141. #**********************************************************************
  142. # this command runs the c preprocessor
  143. #**********************************************************************
  144.  
  145. RUN_CPP=$(CMD_PREPROCESS) -m$(CC_MEM_MODEL) \
  146. -I$(CC_INCLUDE) -I$(CC_APPL_INCLUDE) -A -P-
  147.  
  148. #**********************************************************************
  149. # create a .i file from a .c file (run cpp)
  150. #**********************************************************************
  151.  
  152. CPP=$(RUN_CPP) -o$&.i $&
  153.  
  154. .c.i:
  155.     $(CPP)
  156.  
  157. #**********************************************************************
  158. # this command runs the prototype generator
  159. #**********************************************************************
  160.  
  161. PROTO_ARGS=-r -i$(CC_APPL_INCLUDE) -i$(CC_INCLUDE) -o $*.pro 
  162.  
  163. PROTO=-proto $&.i $(PROTO_ARGS)
  164.  
  165. MAKEPROTO=-mkproto $&.i $(PROTO_ARGS)
  166.  
  167. RUN_PROTO=-proto $(PROTO_ARGS)
  168.  
  169. #**********************************************************************
  170. # a .pro file is a .h file containing function prototypes
  171. #**********************************************************************
  172.  
  173. .c.pro:
  174.     $(CPP)
  175.     $(MAKEPROTO)
  176.  
  177. .i.pro:
  178.     $(PROTO)
  179.  
  180. #**********************************************************************
  181. # user assembly language includes 
  182. #**********************************************************************
  183.  
  184. !if !$d(ASM_APPL_INCLUDE)
  185. ASM_APPL_INCLUDE=
  186. !endif
  187.  
  188. #**********************************************************************
  189. # the assembler include files are here
  190. #**********************************************************************
  191.  
  192. ASM_INCLUDE=$(DRIVE)\tc\mac
  193.  
  194. #**********************************************************************
  195. # by default, it thinks it's masm 5.1
  196. #**********************************************************************
  197.  
  198. !if !$d(ASM_SYNTAX)
  199. ASM_SYNTAX=MASM51
  200. !endif
  201.  
  202. #**********************************************************************
  203. # by default, everything should be case sensitive (for C)
  204. #**********************************************************************
  205.  
  206. !if !$d(ASM_CASE_SENS)
  207. ASM_CASE_SENS=/ml
  208. !endif
  209.  
  210. #**********************************************************************
  211. # debug info from assembler
  212. #**********************************************************************
  213.  
  214. !if !$d(ASM_DEBUG)
  215. ASM_DEBUG=/zi
  216. !endif
  217.  
  218. #**********************************************************************
  219. # miscellaneous assembler flags the user might want
  220. #**********************************************************************
  221.  
  222. !if !$d(AFLAGS)
  223. AFLAGS=
  224. !endif
  225.  
  226. #**********************************************************************
  227. # this command runs the assembler
  228. #**********************************************************************
  229.  
  230. RUN_ASM=$(CMD_ASSEMBLER) $(ASM_DEBUG) /j$(ASM_SYNTAX) /i$(ASM_INCLUDE) \
  231. /i$(ASM_APPL_INCLUDE) $(ASM_CASE_SENS) $(AFLAGS)
  232.  
  233. #**********************************************************************
  234. # here's how to assemble a .asm to get a .obj file
  235. #**********************************************************************
  236.  
  237. ASM=$(RUN_ASM) $&,$*
  238.  
  239. .asm.obj:
  240.     $(ASM)
  241.  
  242. #**********************************************************************
  243. # how to create a .lib from a .bld (a list of .obj's)
  244. #
  245. # a .bld file is a file containing a list of .obj filenames, each
  246. # preceded by a '-+' sequence, and each line except the last ends
  247. # with a '&' character
  248. #
  249. # the list of files in the .bld file should match the list of
  250. # .obj files in the library's dependency list in the makefile,
  251. # or else it isn't of much use
  252. #**********************************************************************
  253.  
  254. RUN_LIB=$(CMD_LIBMGR) /C
  255.  
  256. MAKELIB=$(RUN_LIB) $*.lib @$&.bld
  257.  
  258. .bld.lib:
  259.     $(MAKELIB)
  260.  
  261. #**********************************************************************
  262. # misc linker flags
  263. #**********************************************************************
  264.  
  265. !if !$d(LFLAGS)
  266. LFLAGS=
  267. !endif
  268.  
  269. #**********************************************************************
  270. # linker map file options
  271. #**********************************************************************
  272.  
  273. !if !$d(LINK_MAP)
  274. LINK_MAP=/m
  275. !endif
  276.  
  277. #**********************************************************************
  278. # linker debug info options
  279. #**********************************************************************
  280.  
  281. !if !$d(LINK_DBG)
  282. LINK_DBG=/v
  283. !endif
  284.  
  285. #**********************************************************************
  286. # macro for location of turbo libraries
  287. #**********************************************************************
  288.  
  289. !if !$d(CC_LIB_DIR)
  290. CC_LIB_DIR=$(DRIVE)\tc\lib
  291. !endif
  292.  
  293. #**********************************************************************
  294. # macros for full pathnames of compiler libraries
  295. #
  296. # if CC_NO_FLOAT is defined, then math libs will not be linked in
  297. # if CC_GRAFIX is defined, the graphics library will be searched
  298. #**********************************************************************
  299.  
  300. CC_STARTUP=$(CC_LIB_DIR)\c0$(CC_MEM_MODEL)
  301.  
  302. !if $d(CC_GRAFIX)
  303. CC_GRAFLIB=$(CC_LIB_DIR)\graphics
  304. !else
  305. CC_GRAFLIB=
  306. !endif
  307.  
  308. !if !$d(CC_FP_LIB)
  309. CC_FP_LIB=$(CC_LIB_DIR)\emu
  310. !endif
  311.  
  312. CC_MATH_LIB=$(CC_LIB_DIR)\math$(CC_MEM_MODEL)
  313.  
  314. CC_C_LIB=$(CC_LIB_DIR)\c$(CC_MEM_MODEL)
  315.  
  316. !if !$d(CC_NO_FLOAT)
  317. CC_LIBS=$(CC_GRAFLIB) $(CC_FP_LIB) $(CC_MATH_LIB) $(CC_C_LIB)
  318. !else
  319. CC_LIBS=$(CC_GRAFLIB) $(CC_C_LIB)
  320. !endif
  321.  
  322. #**********************************************************************
  323. # how to create a .exe file from a .lnk file
  324. # a .lnk file is a list of objs, libs, etc in linker command format
  325. # (see the documentation of the linker for more information)
  326. #
  327. # the list of .objs and .libs in the .lnk file should match the
  328. # dependency list for the .exe file, or else it isn't of much use
  329. #********************************************************************** 
  330.  
  331. RUN_LINK=$(CMD_LINKER) /c $(LFLAGS) $(LINK_MAP) $(LINK_DBG)
  332.  
  333. LINK=$(RUN_LINK) $(CC_STARTUP)+ @$&.lnk $(CC_LIBS)
  334.  
  335. .lnk.exe:
  336.     $(LINK)
  337.