home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 5.ddi / CLASSBLD.ZIP / MAKEFILE
Encoding:
Text File  |  1992-06-10  |  9.1 KB  |  358 lines

  1. #--------------------------------------------------------------------------#
  2. #                                                                          #
  3. #   MAKEFILE for Class Libraries                                           #
  4. #                                                                          #
  5. #   Copyright (c) Borland International 1991, 1992                         #
  6. #   All Rights Reserved                                                    #
  7. #                                                                          #
  8. #   Usage:                                                                 #
  9. #                                                                          #
  10. #       make                                                               #
  11. #           builds all libraries for all memory models and for DLLs        #
  12. #                                                                          #
  13. #       make -DDLL                                                         #
  14. #           builds DLLs                                                    #
  15. #                                                                          #
  16. #       make -DMDL=x                                                       #
  17. #           builds all libraries for memory model x, where x               #
  18. #           should be replaced by s, c, m, l, or h.                        #
  19. #                                                                          #
  20. #       options:                                                           #
  21. #                                                                          #
  22. #           -DDBG specifies the debugging version, which enables           #
  23. #                 PRECONDITION and CHECK testing.  See CHECKS.H.           #
  24. #                                                                          #
  25. #           -DTEMPLATES specifies the template version of the library.     #
  26. #                                                                          #
  27. #           -DINCLUDE=... specifies the directories for include files.     #
  28. #                 Only needed if the class library was not installed in    #
  29. #                 in the default location, beneath the compiler root       #
  30. #                 directory.                                               #
  31. #                                                                          #
  32. #           -DLIB=... specifies the directory where the compiler libraries #
  33. #                 are located.  Only needed if the class library was not   #
  34. #                 installed in the default location, beneath the compiler  #
  35. #                 root directory.                                          #
  36. #                                                                          #
  37. #       compiling with Object Data Calling Convention                      #
  38. #           This makefile builds generic libraries that can be used with   #
  39. #           both Windows and DOS.  This doesn't work if you want to use    #
  40. #           the Object Data Calling Convention, so you'll have to build    #
  41. #           separate libraries for DOS and Windows.                        #
  42. #                                                                          #
  43. #--------------------------------------------------------------------------#
  44.  
  45. # USE_po = 1    # uncomment this line to use -po
  46.  
  47. # WINDOWS = 1   # uncomment this line when using -po and building a
  48.                 # Windows library
  49.  
  50. .autodepend
  51. .swap
  52.  
  53. !if $d(DLL)
  54. MDL=l
  55. !endif
  56.  
  57. all:
  58. !if $d(DLL)
  59.     make -DDLL lib
  60.     make -DDLL -DTEMPLATES lib
  61. !elif $d(MDL)
  62.     make -DMDL=$(MDL) lib
  63.     make -DMDL=$(MDL) -DDBG lib
  64.     make -DMDL=$(MDL) -DTEMPLATES lib
  65.     make -DMDL=$(MDL) -DDBG -DTEMPLATES lib
  66. !else
  67.     for %m in (s c m l h) do make -DMDL=%m
  68.     make -DDLL
  69. !endif
  70.  
  71. !if $d(TEMPLATES)
  72. TFLAG = -DTEMPLATES
  73. !endif
  74.  
  75. !if $(MDL) == h
  76. WFLAG =
  77. !elif $d(DLL)
  78. WFLAG = -WDE
  79. !elif $(MDL) == s || $(MDL) == c
  80. !if !$d(USE_po) || $d(WINDOWS)
  81. WFLAG = -WE
  82. !endif
  83. !else
  84. !if !$d(USE_po)
  85. WFLAG = -Y      # for generic libraries
  86. !elif $d(WINDOWS)
  87. WFLAG = -WE
  88. !endif
  89. !endif
  90.  
  91. !if $d(DLL)
  92.  
  93. DEBUG = -D__DEBUG=0
  94. .PATH.obj = objs\dll
  95. LIBR = tlib /0
  96. FLAGS = -v- -D_CLASSDLL
  97. BFLAG = -D_BUILDRTLDLL
  98.  
  99. !if $d( TEMPLATES )
  100. LIBNAME = bidsdll.lib
  101. DLLNAME = bids31.dll
  102. !else
  103. LIBNAME = tclasdll.lib
  104. DLLNAME = tclass31.dll
  105. !endif
  106.  
  107. !elif $d(DBG)
  108.  
  109. DEBUG = -D__DEBUG=2
  110. .PATH.obj = objs\d$(MDL)
  111. LIBR = tlib /0
  112. FLAGS = -v-
  113.  
  114. !if $d( TEMPLATES )
  115. LIBNAME = bidsdb$(MDL)
  116. !else
  117. LIBNAME = tclasdb$(MDL)
  118. !endif
  119.  
  120. !else
  121.  
  122. DEBUG = -D__DEBUG=0
  123. .PATH.obj = objs\$(MDL)
  124. LIBR = tlib /0
  125. FLAGS = -v-
  126.  
  127. !if $d( TEMPLATES )
  128. LIBNAME = bids$(MDL)
  129. !else
  130. LIBNAME = tclass$(MDL)
  131. !endif
  132.  
  133. !endif
  134.  
  135. .PATH.cpp = source
  136. .PATH.lib = lib
  137.  
  138. !if $d(INCLUDE)
  139. IFLAG = -I$(INCLUDE)
  140. !else
  141. IFLAG = -I..\include;include
  142. !endif
  143.  
  144. !if !$d(LIB)
  145. LIB=..\..\..\lib
  146. !endif
  147.  
  148. MFLAG = -m$(MDL)
  149.  
  150. !if !$d(USE_po)
  151. FLAGS = $(FLAGS) $(DEBUG) $(MFLAG) $(TFLAG)
  152. !else
  153. FLAGS = $(FLAGS) $(DEBUG) $(MFLAG) $(TFLAG) -D_ALLOW_po -po
  154. !endif
  155.  
  156. AFLAGS = -c -n$(.PATH.obj) $(IFLAG) $(BFLAG)
  157. CFLAGS = $(AFLAGS) $(FLAGS)
  158.  
  159. CC = bcc
  160.  
  161. lib: config dirs $(LIBNAME)
  162.  
  163. config:
  164.     echo $(FLAGS) > turboc.cfg
  165.     echo $(AFLAGS) >> turboc.cfg
  166.  
  167. dirs: makedummy objs\dummy.txt
  168.     if exist objs\dummy.txt del objs\dummy.txt
  169.  
  170. makedummy:
  171.     echo dummy >objs\dummy.txt
  172.  
  173. objs\dummy.txt:
  174.     -md objs
  175.     -md objs\s
  176.     -md objs\c
  177.     -md objs\m
  178.     -md objs\l
  179.     -md objs\h
  180.     -md objs\ds
  181.     -md objs\dc
  182.     -md objs\dm
  183.     -md objs\dl
  184.     -md objs\dh
  185.     -md objs\dll
  186.  
  187. clean:
  188.     -for %d in (s c m l h ds dc dm dl dh dll) do del objs\%d\*.obj
  189.  
  190. timer.obj: timer.cpp
  191.   $(CC) $(CFLAGS) $(.PATH.cpp)\timer
  192.  
  193. .cpp.obj:
  194.   $(CC) $(WFLAG) {$* }
  195.  
  196. !if $d(TEMPLATES)
  197.  
  198. OBJS =              \
  199.     babstary.obj    \
  200.     bsortary.obj    \
  201.     assoc.obj       \
  202.     btree.obj       \
  203.     btreeinn.obj    \
  204.     btreelfn.obj    \
  205.     collect.obj     \
  206.     contain.obj     \
  207.     dbllist.obj     \
  208.     hashtbl.obj     \
  209.     ldate.obj       \
  210.     list.obj        \
  211.     ltime.obj       \
  212.     memmgr.obj      \
  213.     object.obj      \
  214.     strng.obj       \
  215.     bdict.obj
  216.  
  217. LINKOBJS =                      \
  218.     -+$(.PATH.obj)\babstary.obj \
  219.     -+$(.PATH.obj)\bsortary.obj \
  220.     -+$(.PATH.obj)\assoc.obj    \
  221.     -+$(.PATH.obj)\btree.obj    \
  222.     -+$(.PATH.obj)\btreeinn.obj \
  223.     -+$(.PATH.obj)\btreelfn.obj \
  224.     -+$(.PATH.obj)\collect.obj  \
  225.     -+$(.PATH.obj)\contain.obj  \
  226.     -+$(.PATH.obj)\dbllist.obj  \
  227.     -+$(.PATH.obj)\hashtbl.obj  \
  228.     -+$(.PATH.obj)\ldate.obj    \
  229.     -+$(.PATH.obj)\list.obj     \
  230.     -+$(.PATH.obj)\ltime.obj    \
  231.     -+$(.PATH.obj)\memmgr.obj   \
  232.     -+$(.PATH.obj)\object.obj   \
  233.     -+$(.PATH.obj)\strng.obj    \
  234.     -+$(.PATH.obj)\bdict.obj
  235.  
  236. !else
  237.  
  238. OBJS =              \
  239.     abstarry.obj    \
  240.     array.obj       \
  241.     deque.obj       \
  242.     sortarry.obj    \
  243.     stack.obj       \
  244.     assoc.obj       \
  245.     btree.obj       \
  246.     btreeinn.obj    \
  247.     btreelfn.obj    \
  248.     collect.obj     \
  249.     contain.obj     \
  250.     dbllist.obj     \
  251.     dict.obj        \
  252.     hashtbl.obj     \
  253.     ldate.obj       \
  254.     list.obj        \
  255.     ltime.obj       \
  256.     memmgr.obj      \
  257.     object.obj      \
  258.     strng.obj
  259.  
  260. LINKOBJS =                      \
  261.     -+$(.PATH.obj)\abstarry.obj \
  262.     -+$(.PATH.obj)\array.obj    \
  263.     -+$(.PATH.obj)\deque.obj    \
  264.     -+$(.PATH.obj)\sortarry.obj \
  265.     -+$(.PATH.obj)\stack.obj    \
  266.     -+$(.PATH.obj)\assoc.obj    \
  267.     -+$(.PATH.obj)\btree.obj    \
  268.     -+$(.PATH.obj)\btreeinn.obj \
  269.     -+$(.PATH.obj)\btreelfn.obj \
  270.     -+$(.PATH.obj)\collect.obj  \
  271.     -+$(.PATH.obj)\contain.obj  \
  272.     -+$(.PATH.obj)\dbllist.obj  \
  273.     -+$(.PATH.obj)\dict.obj     \
  274.     -+$(.PATH.obj)\hashtbl.obj  \
  275.     -+$(.PATH.obj)\ldate.obj    \
  276.     -+$(.PATH.obj)\list.obj     \
  277.     -+$(.PATH.obj)\ltime.obj    \
  278.     -+$(.PATH.obj)\memmgr.obj   \
  279.     -+$(.PATH.obj)\object.obj   \
  280.     -+$(.PATH.obj)\strng.obj
  281.  
  282. !endif
  283.  
  284. !if $d(DLL)
  285.  
  286. !if $d(TEMPLATES)
  287. LINKOBJS =          \
  288.     babstary.obj +  \
  289.     bdict        +  \
  290.     bsortary.obj +  \
  291.     tmplinst.obj +
  292.  
  293. DEFNAME = bids.def
  294.  
  295. !else
  296.  
  297. LINKOBJS =          \
  298.     abstarry.obj +  \
  299.     array.obj    +  \
  300.     deque.obj    +  \
  301.     dict         +  \
  302.     sortarry.obj +  \
  303.     stack.obj    +
  304.  
  305. DEFNAME = tclass.def
  306.  
  307. !endif
  308.  
  309. DLLMAIN = clasmain.obj
  310.  
  311. $(DLLNAME) : $(DLLMAIN) tmplinst.obj $(OBJS)
  312.     cd $(.PATH.obj)
  313.     tlink @&&!
  314. $(LIB)\c0dl.obj+
  315. $(DLLMAIN)+
  316. $(LINKOBJS)
  317. assoc+
  318. btree+
  319. btreeinn+
  320. btreelfn+
  321. collect+
  322. contain+
  323. dbllist+
  324. hashtbl+
  325. ldate+
  326. list+
  327. ltime+
  328. memmgr+
  329. object+
  330. strng
  331. $(DLLNAME)
  332. /C/c/x/Twd
  333. $(LIB)\crtldll.LIB+
  334. $(LIB)\IMPORT.LIB+
  335. $(LIB)\mathwl.lib+
  336. $(LIB)\cwl.lib
  337. ..\..\$(.PATH.cpp)\$(DEFNAME)
  338. !
  339.     rc $(DLLNAME)
  340.     cd ..\..
  341.     copy $(.PATH.obj)\$(DLLNAME) $(.PATH.lib)
  342.     del $(.PATH.obj)\$(DLLNAME)
  343.  
  344. $(LIBNAME) : $(DLLNAME)
  345.     implib $(.PATH.lib)\$(LIBNAME) $(.PATH.lib)\$(DLLNAME)
  346.  
  347. !else
  348.  
  349. TIMER=timer.obj
  350. LTIMER = -+$(.PATH.obj)\timer.obj
  351.  
  352. $(LIBNAME): $(OBJS) $(TIMER)
  353.     $(LIBR) $(.PATH.lib)\$(LIBNAME) @&&!
  354.     $(LTIMER) &
  355. $(LINKOBJS)
  356. !
  357. !endif
  358.