home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / vrac / ve2tv103.zip / DEMO.MAK < prev    next >
Text File  |  1994-08-03  |  12KB  |  446 lines

  1. #// File    : DEMO.MAK
  2. #// Author  : Eric Woodruff,  CIS ID: 72134,1150
  3. #// Updated : Sun 07/31/94 15:56:28
  4. #// Note    : Copyright 1994, Eric Woodruff, All rights reserved
  5. #// Compiler: Borland C++ 3.1 to 4.02
  6. #//
  7. #   Makefile for building the TVMEditor 2.0 demo.  Unless overridden by
  8. #   command line flags, this will generate real mode, non-overlay executables.
  9. #
  10. # File location assumptions:
  11. #
  12. # Directory Tree for TVMEditor 2.0:
  13. #   TVMEDIT2               - Base directory. The name is not significant.
  14. #                            The source and library files are found here.
  15. #                            The executables are left here after the build.
  16. #   TVMEDIT2\SOURCE        - Location of TVIRTMEM.H (Registered Version)
  17. #   TVMEDIT2\OBJ???        - Object file dir(s) generated by the build.
  18. #                            Each build uses a unique name for the object dir
  19. #                            associated with the executables being created.
  20. #                            Once the demo(s) are built, you can delete these.
  21. #
  22. # ** NOTE: Run the make file from the base directory (i.e. TVMEDIT2 above).
  23. #
  24. # MAKE with:
  25. #
  26. # No command line flags:
  27. #       Compile for Borland C++ 4.0/4.02 using Turbo Vision 2.0
  28. #       Executables created will be for real mode, non-overlay.
  29. #       Directories: Compiler Root: D:\BC4
  30. #                          Include: D:\BC4\INCLUDE
  31. #                        Libraries: D:\BC4\LIB
  32. #                       TV Include: D:\BC4\INCLUDE\TVISION
  33. #
  34. # -DBC31
  35. #       Compile for Borland C++ 3.1 using Turbo Vision 1.03
  36. #       Executables created will be for real mode, non-overlay.
  37. #       Directories: Compiler Root: D:\BC
  38. #                          Include: D:\BC\INCLUDE
  39. #                        Libraries: D:\BC\LIB;D:\BC\TVISION\LIB
  40. #                       TV Include: D:\BC\TVISION\INCLUDE
  41. #
  42. # -DTV103
  43. #       Compile for Borland C++ 4.0/4.02 using Turbo Vision 1.03
  44. #       Executables created will be for real mode, non-overlay.
  45. #       Directories: Compiler Root: D:\BC4
  46. #                          Include: D:\BC4\INCLUDE
  47. #                        Libraries: D:\BC4\LIB;D:\BC4\TVISION\LIB
  48. #                       TV Include: D:\BC4\TVISION\INCLUDE
  49. #
  50. # Flags for DEMO.MAK:
  51. #
  52. # These command line switches alter the build flags used during
  53. # compilation.  You can use them to alter the build characteristics or you
  54. # can edit the default option flag settings in the make file down below.
  55. #
  56. #     -DBC31         Build using Borland C++ 3.1
  57. #                    TV103 is automatically defined to use Turbo Vision 1.03
  58. #                    If not specified, Borland C++ 4.0/4.02 is assumed
  59. #
  60. #     -DTV103        Build for TV 1.03
  61. #                    If not specified, TV 2.0 is assumed (unless -DBC31 is
  62. #                    specified)
  63. #
  64. #     -DCPU286       Build demo for the 80286 and up (CPUFLAG = -2)
  65. #                    If not specified, compile for 8088 (CPUFLAG = -1- -2-)
  66. #                    NOTE:
  67. #                       If -DDOS16 (DPMI16), automatic CPUFLAG = -2
  68. #                       If -DDOS32 (DPMI32), automatic CPUFLAG = -3
  69. #
  70. #     -DOVERLAY      Build using overlayable version - TVMEDITO.LIB and
  71. #                                                      TVMEDTNO.LIB
  72. #
  73. #     -DDOS16        Build using 16-bit DPMI version - TVMED16.LIB
  74. #                    BC++ 4.02 and Power Pack required
  75. #
  76. #     -DDOS32        Build using 32-bit DPMI version - TVMED32.LIB
  77. #                    BC++ 4.02 and Power Pack required
  78. #
  79. #     -DDEBUG        Include full debug info in the demos, turn off all
  80. #                    optimizations, and enable the editor diagnostic checks.
  81. #                    Library name used depends on the above settings:
  82. #                       TVMEDITD.LIB - Real mode, non overlay
  83. #                       TVMEDOD.LIB  - Real mode, overlay
  84. #                       TVMED16D.LIB - 16-bit protected mode
  85. #                       TVMED32D.LIB - 32-bit protected mode
  86. #
  87. #     -DBCROOT=...   Specifies the path where you installed the compiler
  88. #                    (i.e. C:\BC, C:\BC4, D:\BORLANDC, etc.)
  89. #
  90. #     -DTVINC=...    Specifies the path where you installed Turbo Vision's
  91. #                    header files
  92. #                    (i.e. C:\BC\TVISION\INCLUDE, C:\AF\INCLUDE, etc.)
  93. #
  94. #     -DTVLIB=...    Specifies the path where you installed Turbo Vision's
  95. #                    library files (i.e. \BC\TVISION\LIB or \BC4\LIB)
  96. #
  97. #     -DALIGNMENT=2  Optional word (=2) or dword (=4) aligned library.  Only
  98. #     -DALIGNMENT=4  use it if you have word or dword aligned libraries!
  99. #
  100. # Examples:
  101. #     make -fdemo                    - Real mode using BC4/TV 2.0
  102. #     make -fdemo -DTV103            - Real mode using BC4/TV 1.03
  103. #     make -fdemo -DBC31             - Real mode using BC3.1/TV 1.03
  104. #
  105. #     make -fdemo -DCPU286           - Real mode, BC4/TV 2.0, compiled for 286
  106. #     make -fdemo -DOVERLAY -DCPU286 - Overlayed, BC4/TV 2.0, for 286
  107. #     make -fdemo -DDOS16            - 16 bit DPMI
  108. #     make -fdemo -DDOS32            - 32 bit DPMI
  109. #     make -fdemo -DDOS32 -DDEBUG    - 32 bit DPMI with full debug info
  110. #
  111.  
  112. .autodepend
  113. .swap
  114. .silent
  115.  
  116. # ****************** Uncomment the appropriate lines to default to a
  117. # ****************** specific build mode.
  118.  
  119. # The value assigned is not important.  It's just to get the defintion
  120. # into existence.  If all are commented out, it defaults to BC++ 4.0/4.02
  121. # with Turbo Vision 2.0.
  122.  
  123. # BC31 =
  124. # TV103 =
  125.  
  126. # Enforce TV 1.03 if BC31 is defined.
  127. !if $d(BC31) && !$d(TV103)
  128. TV103 =
  129. !endif
  130.  
  131. # ****************** Here's where to adjust file locations for TV 1.03
  132. !if $d(TV103)
  133.  
  134. !if !$d(BCROOT)
  135. !if $d(BC31)
  136. BCROOT = D:\BC
  137. !else
  138. BCROOT = D:\BC4
  139. !endif
  140. !endif
  141.  
  142. !if !$d(TVINC)
  143. !if $d(BC31)
  144. TVINCDIR = D:\BC\TVISION\INCLUDE
  145. !else
  146. TVINCDIR = D:\BC4\TVISION\INCLUDE
  147. !endif
  148. !endif
  149.  
  150. !if !$d(TVLIB)
  151. !if $d(BC31)
  152. TVLIBDIR = D:\BC\TVISION\LIB
  153. !else
  154. TVLIBDIR = D:\BC4\TVISION\LIB
  155. !endif
  156. !endif
  157.  
  158. !else
  159. # ****************** Here's where to adjust file locations for TV 2.0
  160.  
  161. !if !$d(BCROOT)
  162. BCROOT = D:\BC4
  163. !endif
  164.  
  165. !if !$d(TVINC)
  166. TVINCDIR = D:\BC4\INCLUDE\TVISION
  167. !endif
  168.  
  169. !if !$d(TVLIB)
  170. TVLIBDIR =
  171. !endif
  172.  
  173. !endif
  174.  
  175. # Set include file and library locations.
  176. INCLUDE  = $(BCROOT)\INCLUDE;$(TVINCDIR);.;.\SOURCE
  177. LIBDIR   = $(BCROOT)\LIB;$(TVLIBDIR)
  178.  
  179. # ******************* Set up for 32 bit protected mode compile
  180. !if $d(DOS32)
  181.  
  182. !if $d(DEBUG)
  183. CFGNAME = DEMO32D.CFG
  184. LIBNAME = TVMED32D.LIB
  185. OBJDIR  = OBJS32D
  186. !else
  187. CFGNAME = DEMO32.CFG
  188. LIBNAME = TVMED32.LIB
  189. OBJDIR  = OBJS32
  190. !endif
  191.  
  192. CPUFLAG    = -3
  193. TARGETFLAG = -WX
  194. LINKFLAGS  = /Tpe /ax
  195. STARTUP    = c0x32.obj
  196. USERLIBS   = $(LIBNAME) tv32.lib
  197. STDLIBS    = dpmi32.lib cw32.lib
  198.  
  199. CC      = BCC32
  200. LIB     = TLIB
  201. LINK    = TLINK32
  202.  
  203. !else   # DOS32
  204.  
  205. # ******************* Set up for 16 bit protected mode compile
  206. !if $d(DOS16)
  207.  
  208. !if $d(DEBUG)
  209. CFGNAME = DEMO16D.CFG
  210. LIBNAME = TVMED16D.LIB
  211. OBJDIR  = OBJS16D
  212. !else
  213. CFGNAME = DEMO16.CFG
  214. LIBNAME = TVMED16.LIB
  215. OBJDIR  = OBJS16
  216. !endif
  217.  
  218. CPUFLAG    = -2
  219. TARGETFLAG = -WX -ml
  220. LINKFLAGS  = /Txe
  221. STARTUP    = c0x.obj
  222. USERLIBS   = $(LIBNAME) tv.lib
  223. STDLIBS    = dpmi16.lib emux.lib mathwl.lib cwl.lib
  224.  
  225. CC      = BCC
  226. LIB     = TLIB
  227. LINK    = TLINK
  228.  
  229. !else   # DOS16
  230. # ******************* Set up for real mode compile
  231.  
  232. !if $d(DEBUG)
  233.  
  234. !if $d(OVERLAY)
  235. CFGNAME = DEMOVYD.CFG
  236. LIBNAME = TVMEDOD.LIB
  237. OBJDIR  = OBJSOD
  238. !else
  239. CFGNAME = DEMOD.CFG
  240. LIBNAME = TVMEDITD.LIB
  241. OBJDIR  = OBJSD
  242. !endif
  243.  
  244. !else
  245.  
  246. !if $d(OVERLAY)
  247. CFGNAME = DEMOVY.CFG
  248. LIBNAME = TVMEDITO.LIB
  249. NOVLLIB = TVMEDTNO.LIB
  250. OBJDIR  = OBJSO
  251. !else
  252. CFGNAME = DEMO.CFG
  253. LIBNAME = TVMEDIT.LIB
  254. OBJDIR  = OBJS
  255. !endif
  256.  
  257. !endif
  258.  
  259. # Set CPU type being compiled for in real mode.
  260. !if $d(CPU286)
  261. CPUFLAG = -2
  262. !else
  263. CPUFLAG = -1- -2-
  264. !endif
  265.  
  266. TARGETFLAG = -ml
  267. LINKFLAGS  =
  268. STARTUP    = c0l.obj
  269. USERLIBS   = $(LIBNAME) tv.lib
  270. STDLIBS    = emu.lib mathl.lib cl.lib
  271.  
  272. !if $d(OVERLAY)
  273. USERLIBS   = $(LIBNAME) tvo.lib
  274. STDLIBS    = $(NOVLLIB) tvno.lib overlay.lib emu.lib mathl.lib cl.lib
  275. !endif
  276.  
  277. CC      = BCC
  278. LIB     = TLIB
  279. LINK    = TLINK
  280.  
  281. !endif # DOS16
  282. !endif # DOS32
  283.  
  284. # ******************* Set other compiler options
  285.  
  286. LINKOVY_ON  =
  287. LINKOVY_OFF =
  288.  
  289. !if $d(OVERLAY)
  290. !if !$d(DOS16) && !$d(DOS32)
  291. !if $d(BC31)
  292. CCOVYFLAGS = -Y -Vs -Vb -B
  293. !else
  294. CCOVYFLAGS = -Y -Vs
  295. !endif
  296. LINKOVY_ON  = /o+
  297. LINKOVY_OFF = /o-
  298. !else
  299. !error There's no need to use overlays with the 16-bit or 32-bit DPMI versions.
  300. !endif
  301. !endif
  302.  
  303. !if $d(ALIGNMENT)
  304. ALIGNFLAG = -a$(ALIGNMENT)
  305. !else
  306. ALIGNFLAG =
  307. !endif
  308.  
  309. # ******************* Set debug and optimization options
  310.  
  311. CFLAGS1    =
  312. CFLAGSN32  =
  313.  
  314. !if $d(DEBUG)
  315.  
  316. CDEBUGFLAG = /v -k -N
  317. LINKFLAGS  = $(LINKFLAGS) /v
  318.  
  319. !else
  320.  
  321. CDEBUGFLAG = /v- /DNDEBUG -k- -N- -G-
  322.  
  323. # These optimization options **cannot** be used for 32-bit
  324. # protected mode due to compiler bugs.
  325. !if !$d(DOS32)
  326. CFLAGSN32 = -h -Oe -Os -O -Ob -Ol -Z
  327. !endif
  328.  
  329. !endif
  330.  
  331. # Turn off exceptions and RTTI if using BC++ 4.0/4.02
  332. !if !$d(BC31)
  333. CFLAGS1 = $(CFLAGS1) -RT- -x-
  334. !endif
  335.  
  336. # Put them all together.  Compiler options are spread across three definitions
  337. # because they can exceed 128 characters per line which causes it to fail.
  338. CFLAGS1 = $(CFLAGS1) -ff -w -w-sig -w-amp -P -n$(OBJDIR) /DINCLUDE_HEAPVIEW
  339. CFLAGS2 = $(CDEBUGFLAG) $(ALIGNFLAG) $(CCOVYFLAGS) $(CPUFLAG) $(CFLAGSN32)
  340. CFLAGS3 = -I$(INCLUDE) /DSHAREWARE
  341.  
  342. # ******************* Build dependencies
  343.  
  344. !if $d(DOS32)
  345. DEMONAME = TVEDIT32
  346. !else
  347. !if $d(DOS16)
  348. DEMONAME = TVEDIT16
  349. !else
  350. DEMONAME = TVEDIT
  351. !endif
  352. !endif
  353.  
  354. #.path.obj = $(OBJDIR)
  355.  
  356. RSCLST = BLDRSC.OBJ \
  357.          TFILENM.OBJ \
  358.          TINTEGER.OBJ
  359.  
  360. DEMOLST = TVEDIT1.OBJ \
  361.           TVEDIT2.OBJ \
  362.           TVEDIT3.OBJ \
  363.           TMACRO.OBJ \
  364.           HEAPVIEW.OBJ \
  365.           TMSGVIEW.OBJ \
  366.           TFILENM.OBJ \
  367.           MAPCOLOR.OBJ \
  368.           TINTEGER.OBJ
  369.  
  370. # Go ahead and build them.
  371.  
  372. .cpp.obj:
  373.      $(CC) -c +$(CFGNAME) {$< }
  374.  
  375. all: $(CFGNAME) dirs bldrsc.exe $(DEMONAME).rsc $(DEMONAME).exe
  376.  
  377. dirs:
  378.     echo !!
  379.     echo !! IF YOU ARE USING BC++ 3.1, RENAME TVMEDIT.BC3 TO TVMEDIT.LIB FIRST!
  380.     echo !!
  381.     echo !! IF YOU ARE USING BC++ 4.0, RENAME TVMEDIT.BC4 TO TVMEDIT.LIB FIRST!
  382.     echo !!
  383.     IF NOT EXIST $(OBJDIR) MD $(OBJDIR)
  384.  
  385. $(CFGNAME): demo.mak
  386.     ECHO $(TARGETFLAG) $(CFLAGS1) > $(CFGNAME)
  387.     ECHO $(CFLAGS2) >> $(CFGNAME)
  388.     ECHO $(CFLAGS3) >> $(CFGNAME)
  389.  
  390. bldrsc.exe: dirs $(CFGNAME) $(RSCLST)
  391.   $(LINK) @&&|
  392. $(LINKFLAGS)/L$(LIBDIR) +       # linker options
  393. $(STARTUP) +                    # startup code
  394. $(OBJDIR)\bldrsc.obj +          # object files
  395. $(OBJDIR)\tfilenm.obj +
  396. $(OBJDIR)\tinteger.obj
  397. bldrsc                          # exe name
  398. bldrsc                          # mapfile
  399. $(LINKOVY_ON) $(USERLIBS) +     # overlayable libraries
  400. $(LINKOVY_OFF) $(STDLIBS)       # non-overlayable libraries
  401. |
  402.  
  403. $(DEMONAME).rsc: bldrsc.exe
  404.     bldrsc
  405.  
  406. $(DEMONAME).exe: dirs $(CFGNAME) $(DEMOLST)
  407.   $(LINK) @&&|
  408. $(LINKFLAGS)/L$(LIBDIR) +       # linker options
  409. $(STARTUP) +                    # startup code
  410. $(OBJDIR)\tvedit1.obj +         # object files
  411. $(OBJDIR)\tvedit2.obj +
  412. $(OBJDIR)\tvedit3.obj +
  413. $(OBJDIR)\tmacro.obj +
  414. $(OBJDIR)\tmsgview.obj +
  415. $(OBJDIR)\heapview.obj +
  416. $(OBJDIR)\tfilenm.obj +
  417. $(OBJDIR)\mapcolor.obj +
  418. $(OBJDIR)\tinteger.obj
  419. $(DEMONAME)                     # exe name
  420. $(DEMONAME)                     # mapfile
  421. $(LINKOVY_ON) $(USERLIBS) +     # overlayable libraries
  422. $(LINKOVY_OFF) $(STDLIBS)       # non-overlayable libraries
  423. |
  424.  
  425. $(OBJDIR)\bldrsc.obj: $(CFGNAME) bldrsc.cpp
  426.  
  427. $(OBJDIR)\tvedit1.obj: $(CFGNAME) tvedit1.cpp
  428.  
  429. $(OBJDIR)\tvedit2.obj: $(CFGNAME) tvedit2.cpp
  430.  
  431. $(OBJDIR)\tvedit3.obj: $(CFGNAME) tvedit3.cpp
  432.  
  433. $(OBJDIR)\tmacro.obj: $(CFGNAME) tmacro.cpp
  434.  
  435. $(OBJDIR)\tmsgview.obj: $(CFGNAME) tmsgview.cpp
  436.  
  437. $(OBJDIR)\heapview.obj: $(CFGNAME) heapview.cpp
  438.  
  439. $(OBJDIR)\tfilenm.obj: $(CFGNAME) tfilenm.cpp
  440.  
  441. $(OBJDIR)\tinteger.obj: $(CFGNAME) tinteger.cpp
  442.  
  443. $(OBJDIR)\mapcolor.obj: $(CFGNAME) mapcolor.cpp
  444.  
  445. # End of TVMEditor 2.0 demo program make file
  446.