home *** CD-ROM | disk | FTP | other *** search
/ Learn 3D Graphics Programming on the PC / Learn_3D_Graphics_Programming_on_the_PC_Ferraro.iso / rwwin / makefile.5_ / makefile.bin
Makefile  |  1995-11-14  |  5KB  |  204 lines

  1. ##########################################################################
  2. #
  3. #  File:      Makefile
  4. #
  5. #  Abstract : Makefile for Building a RenderWare application with
  6. #             the Watcom C compiler version 9.5 or 10.0
  7. #
  8. ##########################################################################
  9. #
  10. # This file is a product of Criterion Software Ltd.
  11. #
  12. # This file is provided as is with no warranties of any kind and is
  13. # provided without any obligation on Criterion Software Ltd. or
  14. # Canon Inc. to assist in its use or modification.
  15. #
  16. # Criterion Software Ltd. will not, under any
  17. # circumstances, be liable for any lost revenue or other damages arising
  18. # from the use of this file.
  19. #
  20. # Copyright (c) 1995 Criterion Software Ltd.
  21. # All Rights Reserved.
  22. #
  23. # RenderWare is a trademark of Canon Inc.
  24. #
  25. ###########################################################################
  26.  
  27. # Build flags
  28.  
  29. CDEBUG   = 0                # 1 = enable C debugging information
  30.                             # 0 = disable C debugging information
  31.  
  32. RWDEBUG  = 0                # 1 = Link with debugging RenderWare library
  33.                             # 0 = Link with production RenderWare library
  34.  
  35. RWFIXED  = 1                # 1 = Link with fixed point RenderWare library
  36.                             # 0 = Link with floating point RenderWare library
  37.  
  38. RWDLL    = 0                # 1 = Link with DLL binding libraries
  39.                             # 0 = Link with static linked libraries
  40.  
  41. RWDOS    = 0                # 1 = Build a DOS executable
  42.                             # 0 = Build a Windows executable
  43.  
  44. # Define the location of the RenderWare library and include files
  45.  
  46. !ifeq RWDOS 1
  47. RWDIR = \rwdos
  48. !else
  49. RWDIR = \rwwin
  50. !endif
  51.  
  52. RWINCDIR = $(RWDIR)\include
  53. RWLIBDIR = $(RWDIR)\lib
  54.  
  55. # Define the location of the shared sources
  56.  
  57. COMMONDIR = ..\..\common
  58.  
  59. # Determine the build flags based on the options selected above 
  60.  
  61. !ifeq CDEBUG 1
  62. CDB_CFLAGS = -d2
  63. CDB_LFLAGS = debug all
  64. !else
  65. CDB_CFLAGS = -oneatx
  66. CDB_LFLAGS = 
  67. !endif
  68.  
  69. !ifeq RWFIXED 1
  70. FX_CFLAGS = -DRWFIXED -fpc
  71. !else
  72. FX_CFLAGS = -DRWFLOAT -7
  73. !endif
  74.  
  75. !ifeq RWDOS 1
  76. DOS_CFLAGS = 
  77. DOS_LFLAGS = 
  78. !else
  79. DOS_CFLAGS = -zw
  80. DOS_LFLAGS = system win386
  81. !endif
  82.  
  83. # Determine which library to link against based on the options above 
  84.  
  85. !ifeq RWDOS 1
  86. !ifeq RWFIXED 1
  87. !ifeq RWDEBUG 1
  88. RWLIB = $(RWLIBDIR)\rwdrxd.lib
  89. !else # RWDEBUG
  90. RWLIB = $(RWLIBDIR)\rwdrxp.lib
  91. !endif # RWDEBUG
  92. !else # RWFIXED
  93. !ifeq RWDEBUG 1
  94. RWLIB = $(RWLIBDIR)\rwdrld.lib
  95. !else # RWDEBUG
  96. RWLIB = $(RWLIBDIR)\rwdrlp.lib
  97. !endif # RWDEBUG
  98. !endif # RWFIXED
  99.  
  100. !else # RWDOS
  101.  
  102. !ifeq RWFIXED 1
  103. !ifeq RWDLL 1
  104. RWLIB = $(RWLIBDIR)\rwrxw.lib
  105. !else # RWDLL
  106. !ifeq RWDEBUG 1
  107. RWLIB = $(RWLIBDIR)\rwwrxd.lib
  108. !else # RWDEBUG
  109. RWLIB = $(RWLIBDIR)\rwwrxp.lib
  110. !endif # RWDEBUG
  111. !endif # RWDLL
  112. !else # RWFIXED
  113. !ifeq RWDLL 1
  114. RWLIB = $(RWLIBDIR)\rwrlw.lib
  115. !else # RWDLL
  116. !ifeq RWDEBUG 1
  117. RWLIB = $(RWLIBDIR)\rwwrld.lib
  118. !else # RWDEBUG
  119. RWLIB = $(RWLIBDIR)\rwwrlp.lib
  120. !endif # RWDEBUG
  121. !endif # RWDLL
  122. !endif # RWFIXED
  123.  
  124. !endif # RWDOS
  125.  
  126. # C Compiler options
  127.  
  128. CC      = *wcc386p
  129. CFLAGS    = $(FX_CFLAGS) $(DB_CFLAGS) $(CDB_CFLAGS) $(DOS_CFLAGS) -I$(RWINCDIR) -I$(COMMONDIR) -w4 -j -zq -ei -s -5r
  130. COUT      = -fo
  131.  
  132. # Linker options
  133.  
  134. LINK      = wlink
  135. CLFLAGS   = $(DOS_LFLAGS) op q op st=32768 $(CDB_LFLAGS)
  136. BIND      = wbind 
  137.  
  138. # Rules
  139.  
  140. .c.obj:     
  141.     $(CC) $(CFLAGS) $(COUT)$*.obj $?
  142. .c: $(COMMONDIR)
  143. .c.obj:     
  144.     $(CC) $(CFLAGS) $(COUT)$*.obj $?
  145.  
  146. # Define the name for the executable 
  147.  
  148. BASENAME = rwcyber
  149.  
  150. # Define the object files that make up this program
  151.  
  152. !ifeq RWDOS 1
  153. OSOBJ = dossound.obj osdos.obj
  154. !else
  155. OSOBJ = oswin.obj winsound.obj wmwatcom.obj $(COMMONDIR)\common.obj
  156. # To use the sound support, include these 2 object files also
  157. # winsound.obj wmwatcom.obj 
  158. !endif
  159.  
  160. OBJLIB = $(OSOBJ) rwcyber.obj gunbit.obj man.obj ratrophy.obj animate.obj object.obj $(COMMONDIR)\palette.obj $(RWLIB)
  161.  
  162.  
  163. # Build the executable. We use an intermediate link file to simplify this
  164. # procedure and to allow arbitrary length link lines 
  165.  
  166. !ifeq RWDOS 1
  167. all:    $(BASENAME).exe .SYMBOLIC
  168.  
  169. $(BASENAME).exe: $(BASENAME).lnk $(OBJLIB)
  170.     $(LINK) @$*
  171.         del $(BASENAME).lnk
  172. !else
  173. all:    $(BASENAME).rex $(BASENAME).exe .SYMBOLIC
  174.  
  175. # Bind the resources to the executable 
  176. $(BASENAME).exe: $(OBJLIB) $(BASENAME).rc
  177.         $(BIND) $(BASENAME).rex -R -i=$(COMMONDIR) $(BASENAME).rc
  178.  
  179. $(BASENAME).rex: $(BASENAME).lnk $(OBJLIB)
  180.     $(LINK) @$*
  181.         del $(BASENAME).lnk
  182. !endif
  183.  
  184. $(BASENAME).lnk:
  185.           @%create $^@
  186.           @%append $^@ $(CLFLAGS)
  187.           @%append $^@ NAME $^&
  188.           @for %i in ($(OBJLIB)) do @%append $^@ FILE %i
  189.  
  190. # Clean the source up ready for distribution
  191. dist-clean:  .SYMBOLIC
  192.         %make clean
  193.     del $(BASENAME).exe
  194.  
  195. # Clean up any intermediate build files leaving the executable
  196. clean:  .SYMBOLIC
  197.         del $(BASENAME).lnk
  198.         del $(BASENAME).rex
  199.         del *.res
  200.     del *.err
  201.     del *.obj
  202.         del $(COMMONDIR)\*.obj
  203.  
  204.