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.7_ / makefile.bin
Makefile  |  1995-11-14  |  4KB  |  154 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.  
  42. # Define the location of the RenderWare library and include files
  43.  
  44. RWDIR = \rwwin
  45. RWINCDIR = $(RWDIR)\include
  46. RWLIBDIR = $(RWDIR)\lib
  47.  
  48. # Define the location of the shared sources
  49.  
  50. COMMONDIR = ..\..\common
  51.  
  52. # Determine the build flags based on the options selected above 
  53.  
  54. !ifeq CDEBUG 1
  55. CDB_CFLAGS = -d2
  56. CDB_LFLAGS = debug all
  57. !else
  58. CDB_CFLAGS = -oneatx
  59. CDB_LFLAGS = 
  60. !endif
  61.  
  62. !ifeq RWFIXED 1
  63. FX_CFLAGS = -DRWFIXED -fpc
  64. !else
  65. FX_CFLAGS = -DRWFLOAT -7
  66. !endif
  67.  
  68. # Determine which library to link against based on the options above 
  69.  
  70. !ifeq RWFIXED 1
  71. !ifeq RWDLL 1
  72. RWLIB = $(RWLIBDIR)\rwrxw.lib
  73. !else # RWDLL
  74. !ifeq RWDEBUG 1
  75. RWLIB = $(RWLIBDIR)\rwwrxd.lib
  76. !else # RWDEBUG
  77. RWLIB = $(RWLIBDIR)\rwwrxp.lib
  78. !endif # RWDEBUG
  79. !endif # RWDLL
  80. !else # RWFIXED
  81. !ifeq RWDLL 1
  82. RWLIB = $(RWLIBDIR)\rwrlw.lib
  83. !else # RWDLL
  84. !ifeq RWDEBUG 1
  85. RWLIB = $(RWLIBDIR)\rwwrld.lib
  86. !else # RWDEBUG
  87. RWLIB = $(RWLIBDIR)\rwwrlp.lib
  88. !endif # RWDEBUG
  89. !endif # RWDLL
  90. !endif # RWFIXED
  91.  
  92. # C Compiler options
  93.  
  94. CC      = *wcc386p
  95. CFLAGS    = $(FX_CFLAGS) $(DB_CFLAGS) $(CDB_CFLAGS) -I$(RWINCDIR) -I$(COMMONDIR) -zw -w4 -j -zq -ei -s -5r
  96. COUT      = -fo
  97.  
  98. # Linker options
  99.  
  100. LINK      = wlink
  101. CLFLAGS   = system win386 op q op st=32768 $(CDB_LFLAGS)
  102. BIND      = wbind 
  103.  
  104. # Rules
  105.  
  106. .c.obj:     
  107.     $(CC) $(CFLAGS) $(COUT)$*.obj $?
  108. .c: $(COMMONDIR)
  109. .c.obj:     
  110.     $(CC) $(CFLAGS) $(COUT)$*.obj $?
  111.  
  112. # Define the name for the executable 
  113.  
  114. BASENAME = rwmaze
  115.  
  116. # Define the object files that make up this program
  117.  
  118. OBJLIB = rwmaze.obj $(COMMONDIR)\common.obj $(COMMONDIR)\palette.obj $(RWLIB)
  119.  
  120. all:    $(BASENAME).rex $(BASENAME).exe .SYMBOLIC
  121.  
  122. # Bind the resources to the executable 
  123. $(BASENAME).exe: $(OBJLIB) $(BASENAME).rc
  124.         $(BIND) $(BASENAME).rex -R -i=$(COMMONDIR) $(BASENAME).rc
  125.  
  126. # Build the executable. We use an intermediate link file to simplify this
  127. # procedure and to allow arbitrary length link lines 
  128.  
  129. $(BASENAME).rex: $(BASENAME).lnk $(OBJLIB)
  130.     $(LINK) @$*
  131.         del $(BASENAME).lnk
  132.  
  133. $(BASENAME).lnk:
  134.           @%create $^@
  135.           @%append $^@ $(CLFLAGS)
  136.           @%append $^@ NAME $^&
  137.           @for %i in ($(OBJLIB)) do @%append $^@ FILE %i
  138.  
  139. # Clean the source up ready for distribution
  140. dist-clean:  .SYMBOLIC
  141.         %make clean
  142.     del $(BASENAME).exe
  143.  
  144. # Clean up any intermediate build files leaving the executable
  145. clean:  .SYMBOLIC
  146.         del $(BASENAME).lnk
  147.         del $(BASENAME).rex
  148.         del *.res
  149.     del *.err
  150.     del *.obj
  151.         del $(COMMONDIR)\*.obj
  152.  
  153.  
  154.