home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / FACETV.ZIP / MAKEFILE.BCC < prev    next >
Text File  |  1994-01-05  |  16KB  |  610 lines

  1. #########################################################################
  2. #                                    #
  3. # @(#)makefile (C++ version)    01/05/94    Chris Ahlstrom        #
  4. #                                    #
  5. #########################################################################
  6.  
  7. PROJ    = FACE_TV
  8.  
  9. ########################################################################
  10. #
  11. #  ----------------------------------
  12. #  Chris Ahlstrom
  13. #  811-F Hideaway Bay Lane
  14. #  Mt. Pleasant, SC   29464
  15. #  (803)849-0985 voice
  16. #  (803)792-8483 work
  17. #  73340.26!compuserve.com
  18. #  ----------------------------------
  19. #
  20. # Borland-style C++ MAKEFILE for FACE_TV.LIB (C++ version).  This library
  21. # is extremely important for many FACE programs.
  22. #
  23. # THINGS TO DO:
  24. #
  25. #    Rewrite it so that re-inserting the new OBJ into the library
  26. # comes right after compiling it.
  27. #
  28. #================================================================
  29. # GENERAL USAGE
  30. #================================================================
  31. #
  32. # To use this makefile, copy it to a file named "makefile".  Given
  33. # that all paths are set up to reach the compiler and include files,
  34. # type
  35. #
  36. #    make [options] [target]
  37. #
  38. # where the allowed options (case is significant!) are
  39. #
  40. #    -touch        Touch (preparatory to "make -Dother options")
  41. #    -Debug        Compile for debugging under CodeView
  42. #    -Dtest        Compile without need for DT2801A board.
  43. #
  44. # See the bottom of this file for the targets allowed (touch, clean...)
  45. #
  46. #================================================================
  47. # LOCATION OF COMPILER-RELATED DIRECTORIES
  48. #================================================================
  49. #
  50. # Location of the Borland 3.1 C++ Libraries and Executables; unfortunately
  51. # it is needed to allow TLINK to find it's special OBJs and LIBs.
  52. # The best thing to do is to put all compilers on the same drive,
  53. # and set the AUTOEXEC.BAT file to define COMPILE, using the command
  54. #
  55. #    SET COMPILE=D:        (or whatever)
  56. #
  57. ########################################################################
  58.  
  59. BCL        = $(COMPILE)\BC\LIB
  60. TVL        = $(COMPILE)\BC\TVISION\LIB
  61. BGI        = $(COMPILE)\BC\BGI
  62. USR        = $(USRDISK)\USR\LIB
  63. INCLUDEPATH    = $(COMPILE)\BC\INCLUDE;$(COMPILE)\BC\TVISION\INCLUDE
  64.  
  65.  
  66. ########################################################################
  67. #
  68. #================================================================
  69. # GENERATING A DEBUGGABLE VERSION
  70. #================================================================
  71. #
  72. # To recreate the program with debugging code, first do a "make touch",
  73. # or touch each file for which debug information is desired.  Then call
  74. # "make -Debug".
  75. #
  76. #
  77. #================================================================
  78. # COMPILER VERSION INFORMATION
  79. #================================================================
  80. #
  81. #    Tool    Borland
  82. #    ====    =======
  83. #
  84. #   C Compiler    BCC   v. 3.10 (2.00 should work)
  85. #   Linker    TLINK v. 3.01
  86. #   Librarian   TLIB  v. 3.01
  87. #   Make Util.    MAKE  v. 3.00
  88. #   Assembler   TASM  v. 2.00
  89. #   Debugger    TD    v. 3.0
  90. #
  91. #
  92. # Borland 3.1 C/C++ Compiler
  93. # ==========================
  94. #
  95. # Some useful settings (not all are used):
  96. #
  97. #    ml  for large memory model
  98. #     A  for ANSI-compatible C-code compiling
  99. #    O-  (for starters) to disable optimization
  100. #     G  to optimize in favor of speed over size
  101. #    G-  to optimize in favor of size over speed
  102. #     1  to generate 80286 real-mode instructions
  103. #     S  to generate an assembly+source listing (but doesn't compile)
  104. #     c  to force compile-only
  105. #    i31 to restrict external name length to 31 characters
  106. #     w  (for starters) to yield default level of warnings
  107. #  w-stv disable passing structures by value warnings (done in source code)
  108. #     D  to define __MSDOS__ is done automatically in Borland 2.0 C.
  109. #     y  include line numbers
  110. #     v  include symbolic debugger information
  111. #     N  generate stack overflow logic
  112. #     u  Prepend an underscore before all variable names
  113. #  -f287 Use only inline 80x87 code for floating point operations.
  114. #
  115. ########################################################################
  116.  
  117. ########################################################################
  118. #
  119. # Turn on auto-dependency check of the .OBJ files (same as "-a" option)
  120. #
  121. ########################################################################
  122.  
  123. .AUTODEPEND
  124.  
  125.  
  126. ########################################################################
  127. #
  128. # Note the following "problems":  -v and -vi are always set in the
  129. # cis.cfg file, and we don't always need them; -f287 isn't yet
  130. # part of the face_tv.cfg file; we can debug with the Optimizer on,
  131. # with Borland; CFLAG definitions are used only for debugging and
  132. # control of optimization.
  133. #
  134. ########################################################################
  135.  
  136. !if $d(fp486)
  137. FP    = FP486
  138. !else
  139. FP    = FP386
  140. !endif
  141.  
  142. !if $d(test)
  143. TESTFLG    = TEST
  144. !else
  145. TESTFLG    = NOT_TEST
  146. !endif
  147.  
  148. !if $d(heap)
  149. HEAPFLG = TESTHEAP
  150. !else
  151. HEAPFLG = NOHEAP
  152. !endif
  153.  
  154. CC    = bcc +$(PROJ).CFG
  155. !if $d(ebug)
  156. CFLAGS    = -O- -v
  157. !else
  158. CFLAGS    =
  159. !endif
  160.  
  161.  
  162. ########################################################################
  163. #
  164. # =======================
  165. # Borland Turbo Assembler
  166. # =======================
  167. #
  168. # Some useful settings (not all are used):
  169. #
  170. #    t    Terse mode; suppress messages for successful assembly
  171. #    z    Display source line with error messages.
  172. #    zi    Full debug info
  173. #    zd    Debugging line numbers only
  174. #    l    Generate normal listing
  175. #    la    Generate expanded listing
  176. #    w2    Maximum level of warnings
  177. #    dTEXT    Define the symbol called "TEXT"
  178. #    mx    Treat external (public) symbols as case-sensitive
  179. #
  180. ########################################################################
  181.  
  182. AS    = tasm
  183. !if $d(ebug)
  184. AFLAGS    = /mx /t /zi /d__FARPROCS__ /d__C_CALLS__=1
  185. !else
  186. AFLAGS    = /mx /t /d__FARPROCS__ /d__C_CALLS__=1
  187. !endif
  188.  
  189.  
  190. ########################################################################
  191. #
  192. # ================================
  193. # Borland 3.1 C/C++ TLINK (Linker)
  194. # ================================
  195. #
  196. # The general form of a Turbo TLINK command line differs a lot from that
  197. # for Microsoft LINK:
  198. #
  199. #    tlink /c C0l objs,exe,[map],[usrlib][ovrlay][emu|fp87 mathx] Cl
  200. #
  201. # where the symbols mean:
  202. #
  203. #    /c        make lower case significant
  204. #    C0l        initialization module for memory model l (large)
  205. #    objs        the object modules for the current project
  206. #    exe        the root name for the *.EXE file
  207. #    map        optional mapfile's name
  208. #    usrlib        a list of user's libraries
  209. #    ovrlay        overlay-manager library
  210. #    emu|fp87     floating-point libraries (choose one)
  211. #    mathx        math library for memory model x
  212. #    Cl        run-time library for memory model l (large)
  213. #    Vt        Undocumented -- compress debugging information
  214. #
  215. # Some of these symbols are included in $(LFLAGS) and $(LNKLIBS), and
  216. # the rest are on the command line.
  217. #
  218. # NOTE the use of the faster FP87 library in lieu of the EMU library;
  219. # the code will run only if the PC has an 80x87 installed.  Also note
  220. # that EMU might run slower on a 486 than on a 386.  Don't know for sure
  221. # yet.
  222. #
  223. # NOTE that we have to be sure the FACE library also uses only 80x87
  224. # code.  This is very important.
  225. #
  226. ########################################################################
  227.  
  228. LNK    = tlink
  229. USRLIBS = $(PROJ)
  230. LNKLIBS    = graphics emu tv mathl cl
  231. !if $d(ebug)
  232. LFLAGS    = /c /l /v /Vt /s /L$(USR);$(BCL);$(TVL) C0l
  233. !else
  234. LFLAGS    = /v /x /c /P- /L$(BCL);$(USR);$(TVL) C0l
  235. !endif
  236.  
  237.  
  238. ########################################################################
  239. #
  240. # =================
  241. # Borland Librarian
  242. # =================
  243. #
  244. # /C    Do not ignore the case of symbols; however, some linkers do
  245. #    not distinguish between cases, and they won't handle a library
  246. #    created with the /C option very well.
  247. #
  248. ########################################################################
  249.  
  250. LLIB    = tlib
  251. LBFLAGS    = /C
  252.  
  253.  
  254. ########################################################################
  255. #
  256. # Implicit Inference rules for Borland 3.1 C/C++
  257. #
  258. # Some inference rules take advantage of Borland 3.1 Make's "batching"
  259. # facility, wherein any file enclosed by curly braces is added to a
  260. # list, so that the command need only be called once.
  261. #
  262. ########################################################################
  263.  
  264. .asm.obj:
  265.     $(AS) $(AFLAGS) $*;
  266.  
  267. .c.obj:
  268.     $(CC) -c $(CFLAGS) {$< }
  269.  
  270. .cpp.obj:
  271.     $(CC) -c $(CFLAGS) {$< }
  272.  
  273.  
  274. ########################################################################
  275. #
  276. # Individual File Dependencies
  277. #
  278. #    For those files with nested dependencies, we define some macros
  279. # INCS is all of them, lumped together for easy reference
  280. #
  281. ########################################################################
  282.  
  283. ########################################################################
  284. #
  285. # FACE_TV modules
  286. #
  287. ########################################################################
  288.  
  289. RBUTOBJS=        \
  290.     grafxlog.obj    \
  291.     korbutt.obj    \
  292.     math_aux.obj    \
  293.     mkbutton.obj    \
  294.     msrbutt.obj    \
  295.     rbuttons.obj    \
  296.     respintr.obj    \
  297.     respwind.obj
  298.  
  299. LIBOBJS    =        \
  300.     announce.obj    \
  301.     boxtools.obj    \
  302.     dlg_box.obj    \
  303.     dosshell.obj    \
  304.     filedlg.obj    \
  305.     heapview.obj    \
  306.     menubars.obj    \
  307.     screnmsg.obj    \
  308.     scrnmsg.obj    \
  309.     tbox.obj    \
  310.     timerctl.obj    \
  311.     tinpextd.obj    \
  312.     tinpmous.obj    \
  313.     tinput.obj    \
  314.     tmouse.obj    \
  315.     tv_confg.obj    \
  316.     tvscreen.obj    \
  317.     $(RBUTOBJS)
  318.  
  319. RBUTINCS=        \
  320.     grafxlog.h    \
  321.     korbutt.h    \
  322.     math_aux.obj    \
  323.     mkbutton.h    \
  324.     msrbutt.h    \
  325.     rbuttons.h    \
  326.     respintr.h    \
  327.     respwind.h    \
  328.     respvga.h
  329.  
  330. FACEINCS =        \
  331.     announce.h    \
  332.     boxtools.h    \
  333.     bytebox.h    \
  334.     bytemenu.h    \
  335.     compiler.h    \
  336.     dlg_box.h    \
  337.     dosshell.h    \
  338.     filedlg.h    \
  339.     heapview.h    \
  340.     menubars.h    \
  341.     screnmsg.h    \
  342.     tbox.h        \
  343.     timerctl.h    \
  344.     tinpextd.h    \
  345.     tinpmous.h    \
  346.     tinput.h    \
  347.     tmouse.h    \
  348.     tv_confg.h    \
  349.     tv_menu.h    \
  350.     tvmenus.h    \
  351.     tvscreen.h    \
  352.     tvyesno.h    \
  353.     $(RBUTINCS)
  354.  
  355.  
  356. ########################################################################
  357. #
  358. # Isolated header files
  359. #
  360. ########################################################################
  361.  
  362. BYTEMENU= bytemenu.h
  363. BOXTOOLS= boxtools.h
  364. COMPILER= compiler.h
  365. DLG_BOX    = dlg_box.h tv_box.h
  366. DOSSHELL= dosshell.h
  367. FILEDLG    = filedlg.h
  368. GRAFXLOG= grafxlog.h grafxscr.h bios_vid.h
  369. HEAPVIEW= heapview.h
  370. MENUBARS= menubars.h
  371. PROJDEPS= $(PROJ).cpp $(PROJ).h $(PROJ).men $(PROJ).cfg
  372. RBUTTONS= rbuttons.h
  373. SCRENMSG= screnmsg.h cnscreen.h tvscreen.h
  374. TIMERCTL= timerctl.h
  375. TINPEXTD= tinpextd.h
  376. TINPMOUS= tinpmous.h
  377. TINPUT    = tinput.h
  378. TMOUSE    = tmouse.h
  379. TV_MENU    = tv_menu.h datatype.h
  380. TVMENUS    = tvmenus.h
  381. TVSCREEN= tvscreen.h
  382. TV_CONFG= tv_confg.h tv_confg.err
  383. RESPINTR= respintr.h respvga.h
  384. RESPWIND= respwind.h respintr.h screen.h
  385. KORBUTT    = korbutt.h $(RBUTTONS)
  386. MSRBUTT    = msrbutt.h $(RBUTTONS)
  387.  
  388.  
  389. ########################################################################
  390. #
  391. # Explicit Rules
  392. #
  393. #    Note the @&&| and | which bracket the contents of a temporary
  394. # file that Borland's MAKE creates.
  395. #
  396. ########################################################################
  397.  
  398. all: $(PROJ).exe usrlib
  399.  
  400. $(PROJ).exe: $(PROJ).obj $(PROJ).arf $(PROJ).lib
  401.     $(LNK) $(LFLAGS) @$(PROJ).arf
  402.  
  403. $(PROJ).arf: $(INCS) makefile
  404.     @echo $(PROJ)            >  $(PROJ).arf
  405.     @echo $(PROJ)            >> $(PROJ).arf
  406.     @echo $(PROJ)            >> $(PROJ).arf
  407.     @echo $(USRLIBS) $(LNKLIBS)    >> $(PROJ).arf
  408.     @echo $(PROJ) test code automatic response file created.
  409.  
  410. $(PROJ).lib: $(LIBOBJS) $(PROJ).cfg face_lib.arf
  411.     del $(PROJ).lib
  412.     $(LLIB) $(LBFLAGS) $(PROJ) @face_lib.arf
  413.  
  414. usrlib: $(PROJ).lib
  415.     copy *.err    $(USR)
  416.     copy *.h    $(USR)
  417.     copy *.lib    $(USR)
  418.  
  419.  
  420. ########################################################################
  421. #
  422. # Configuration file for the librarian
  423. #
  424. ########################################################################
  425.  
  426. face_lib.arf: makefile
  427.     @echo +announce &    >  face_lib.arf
  428.     @echo +boxtools &    >> face_lib.arf
  429.     @echo +dlg_box     &    >> face_lib.arf
  430.     @echo +dosshell &    >> face_lib.arf
  431.     @echo +filedlg     &    >> face_lib.arf
  432.     @echo +grafxlog &    >> face_lib.arf
  433.     @echo +heapview &    >> face_lib.arf
  434.     @echo +korbutt  &    >> face_lib.arf
  435.     @echo +math_aux &    >> face_lib.arf
  436.     @echo +menubars &    >> face_lib.arf
  437.     @echo +mkbutton    &    >> face_lib.arf
  438.     @echo +msrbutt    &    >> face_lib.arf
  439.     @echo +rbuttons &    >> face_lib.arf
  440.     @echo +respintr &    >> face_lib.arf
  441.     @echo +respwind &    >> face_lib.arf
  442.     @echo +screnmsg &    >> face_lib.arf
  443.     @echo +scrnmsg     &    >> face_lib.arf
  444.     @echo +tbox     &    >> face_lib.arf
  445.     @echo +timerctl    &    >> face_lib.arf
  446.     @echo +tinpextd &    >> face_lib.arf
  447.     @echo +tinpmous &    >> face_lib.arf
  448.     @echo +tinput     &    >> face_lib.arf
  449.     @echo +tmouse     &    >> face_lib.arf
  450.     @echo +tv_confg    &    >> face_lib.arf
  451.     @echo +tvscreen        >> face_lib.arf
  452.     @echo $(PROJ) automatic response file created
  453.  
  454.  
  455. ########################################################################
  456. #
  457. # Hierarchical header files (careful about changing the order of these)
  458. #
  459. ########################################################################
  460.  
  461. TBOX    = tbox.h $(TV_MENU) $(TINPUT) $(TINPMOUS)
  462. ANNOUNCE= announce.h $(BOXTOOLS) $(TINPUT)
  463.  
  464.  
  465. ########################################################################
  466. #
  467. # Object modules to construct
  468. #
  469. ########################################################################
  470.  
  471. announce.obj: announce.cpp $(ANNOUNCE) $(PROJ).cfg
  472.  
  473. boxtools.obj: boxtools.cpp $(BOXTOOLS) $(PROJ).cfg
  474.  
  475. dlg_box.obj: dlg_box.cpp $(DLG_BOX) $(PROJ).cfg
  476.  
  477. dosshell.obj: dosshell.cpp $(DOSSHELL) $(PROJ).cfg
  478.  
  479. grafxlog.obj: grafxlog.c $(GRAFXLOG) $(PROJ).cfg
  480.  
  481. filedlg.obj: filedlg.cpp $(FILEDLG) $(PROJ).cfg
  482.  
  483. heapview.obj: heapview.cpp $(HEAPVIEW) $(PROJ).cfg
  484.  
  485. korbutt.obj: korbutt.cpp korbutt.h $(RBUTTONS) $(PROJ).cfg
  486.  
  487. math_aux.obj: math_aux.c math_aux.h $(PROJ).cfg
  488.  
  489. menubars.obj: menubars.cpp $(MENUBARS) $(PROJ).cfg
  490.  
  491. mkbutton.obj: mkbutton.cpp mkbutton.h $(MSRBUTT) $(KORBUTT) $(PROJ).cfg
  492.  
  493. msrbutt.obj: msrbutt.cpp msrbutt.h $(RBUTTONS) tmouse.h $(PROJ).cfg
  494.  
  495. respintr.obj: respintr.cpp $(RESPINTR) $(PROJ).cfg
  496.  
  497. respwind.obj: respwind.cpp $(RESPWIND) $(PROJ).cfg
  498.  
  499. screnmsg.obj: screnmsg.cpp $(SCRENMSG) $(PROJ).cfg
  500.  
  501. scrnmsg.obj: scrnmsg.c $(SCRENMSG) $(PROJ).cfg
  502.  
  503. rbuttons.obj: rbuttons.cpp $(RBUTTONS) $(PROJ).cfg
  504.  
  505. tbox.obj: tbox.cpp $(TBOX) $(PROJ).cfg
  506.  
  507. timerctl.obj: timerctl.cpp $(TIMERCTL) $(PROJ).cfg
  508.  
  509. tinpextd.obj: tinpextd.cpp $(TINPEXTD) $(TMOUSE) $(PROJ).cfg
  510.  
  511. tinpmous.obj: tinpmous.cpp $(TINPMOUS) $(TMOUSE) $(PROJ).cfg
  512.  
  513. tinput.obj: tinput.cpp $(TINPUT) $(PROJ).cfg
  514.  
  515. tmouse.obj: tmouse.c $(TMOUSE) $(PROJ).cfg
  516.  
  517. tv_confg.obj: tv_confg.cpp $(TV_CONFG) $(PROJ).cfg
  518.  
  519. tvscreen.obj: tvscreen.cpp $(TVSCREEN) $(PROJ).cfg
  520.  
  521. $(PROJ).obj: $(PROJDEPS) face_box.men announce.h
  522.  
  523.  
  524. ########################################################################
  525. #
  526. # Compiler Configuration File
  527. #
  528. #    The "&&" says to route the following lines to the file specified
  529. # after the pair of "|" characters.  (Any character besides "|" could
  530. # be used to bracket the text).
  531. #
  532. #    -b- seems to screw up the program (creates byte array indices?)
  533. #    -1  seems to screw up a small section of code when running the
  534. #        debugger; anyway, I want even 8086 machines to be able to
  535. #        run this code, so "-1-" is used.
  536. #       -vi-  why is this here???????
  537. #
  538. ########################################################################
  539.  
  540. $(PROJ).cfg: makefile
  541.     copy &&|
  542. -1-
  543. -ml
  544. -vi-
  545. -i31
  546. -w-ret
  547. -w-nci
  548. -w-inl
  549. -wpin
  550. -wamb
  551. -wamp
  552. -w-par
  553. -wasm
  554. -wcln
  555. -w-cpt
  556. -wdef
  557. -w-dup
  558. -w-pia
  559. -wsig
  560. -wnod
  561. -w-ill
  562. -w-sus
  563. -wstv
  564. -wucp
  565. -wuse
  566. -w-ext
  567. -w-ias
  568. -w-ibc
  569. -w-pre
  570. -w-nst
  571. -D$(FP)
  572. -D$(TESTFLG);$(HEAPFLG)
  573. -I$(INCLUDEPATH);$(USR)
  574. -L$(BCL);$(TVL)
  575. | $(PROJ).cfg
  576.  
  577.  
  578. ########################################################################
  579. #
  580. # Other convenient targets
  581. #
  582. ########################################################################
  583.  
  584.  
  585. clean:
  586.     del *.map
  587.     del *.obj
  588.     del *.bak
  589.  
  590. touch:
  591.     touch *.cpp
  592.     touch *.h
  593.     touch *.men
  594.     del $(PROJ).cfg
  595.     del $(PROJ).arf
  596.     del face_lib.arf
  597.  
  598. help: hlp
  599.     @type hlp
  600.  
  601. hlp: makefile
  602.     @echo "make [options] [target]"                    >  hlp
  603.     @echo The options and targets are:                >> hlp
  604.     @echo      touch     Touch files to change compiler options    >> hlp
  605.     @echo    clean     Delete junk files (MAP, OBJ, etc.)           >> hlp
  606.     @echo     -Debug     Compile for debugging under CodeView        >> hlp
  607.     @echo     -Dtest     Compile to run without board            >> hlp
  608.     @echo     -Dheap     Compile to run with heap checker        >> hlp
  609.  
  610.