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
Wrap
Makefile
|
1995-11-14
|
5KB
|
204 lines
##########################################################################
#
# File: Makefile
#
# Abstract : Makefile for Building a RenderWare application with
# the Watcom C compiler version 9.5 or 10.0
#
##########################################################################
#
# This file is a product of Criterion Software Ltd.
#
# This file is provided as is with no warranties of any kind and is
# provided without any obligation on Criterion Software Ltd. or
# Canon Inc. to assist in its use or modification.
#
# Criterion Software Ltd. will not, under any
# circumstances, be liable for any lost revenue or other damages arising
# from the use of this file.
#
# Copyright (c) 1995 Criterion Software Ltd.
# All Rights Reserved.
#
# RenderWare is a trademark of Canon Inc.
#
###########################################################################
# Build flags
CDEBUG = 0 # 1 = enable C debugging information
# 0 = disable C debugging information
RWDEBUG = 0 # 1 = Link with debugging RenderWare library
# 0 = Link with production RenderWare library
RWFIXED = 1 # 1 = Link with fixed point RenderWare library
# 0 = Link with floating point RenderWare library
RWDLL = 0 # 1 = Link with DLL binding libraries
# 0 = Link with static linked libraries
RWDOS = 0 # 1 = Build a DOS executable
# 0 = Build a Windows executable
# Define the location of the RenderWare library and include files
!ifeq RWDOS 1
RWDIR = \rwdos
!else
RWDIR = \rwwin
!endif
RWINCDIR = $(RWDIR)\include
RWLIBDIR = $(RWDIR)\lib
# Define the location of the shared sources
COMMONDIR = ..\..\common
# Determine the build flags based on the options selected above
!ifeq CDEBUG 1
CDB_CFLAGS = -d2
CDB_LFLAGS = debug all
!else
CDB_CFLAGS = -oneatx
CDB_LFLAGS =
!endif
!ifeq RWFIXED 1
FX_CFLAGS = -DRWFIXED -fpc
!else
FX_CFLAGS = -DRWFLOAT -7
!endif
!ifeq RWDOS 1
DOS_CFLAGS =
DOS_LFLAGS =
!else
DOS_CFLAGS = -zw
DOS_LFLAGS = system win386
!endif
# Determine which library to link against based on the options above
!ifeq RWDOS 1
!ifeq RWFIXED 1
!ifeq RWDEBUG 1
RWLIB = $(RWLIBDIR)\rwdrxd.lib
!else # RWDEBUG
RWLIB = $(RWLIBDIR)\rwdrxp.lib
!endif # RWDEBUG
!else # RWFIXED
!ifeq RWDEBUG 1
RWLIB = $(RWLIBDIR)\rwdrld.lib
!else # RWDEBUG
RWLIB = $(RWLIBDIR)\rwdrlp.lib
!endif # RWDEBUG
!endif # RWFIXED
!else # RWDOS
!ifeq RWFIXED 1
!ifeq RWDLL 1
RWLIB = $(RWLIBDIR)\rwrxw.lib
!else # RWDLL
!ifeq RWDEBUG 1
RWLIB = $(RWLIBDIR)\rwwrxd.lib
!else # RWDEBUG
RWLIB = $(RWLIBDIR)\rwwrxp.lib
!endif # RWDEBUG
!endif # RWDLL
!else # RWFIXED
!ifeq RWDLL 1
RWLIB = $(RWLIBDIR)\rwrlw.lib
!else # RWDLL
!ifeq RWDEBUG 1
RWLIB = $(RWLIBDIR)\rwwrld.lib
!else # RWDEBUG
RWLIB = $(RWLIBDIR)\rwwrlp.lib
!endif # RWDEBUG
!endif # RWDLL
!endif # RWFIXED
!endif # RWDOS
# C Compiler options
CC = *wcc386p
CFLAGS = $(FX_CFLAGS) $(DB_CFLAGS) $(CDB_CFLAGS) $(DOS_CFLAGS) -I$(RWINCDIR) -I$(COMMONDIR) -w4 -j -zq -ei -s -5r
COUT = -fo
# Linker options
LINK = wlink
CLFLAGS = $(DOS_LFLAGS) op q op st=32768 $(CDB_LFLAGS)
BIND = wbind
# Rules
.c.obj:
$(CC) $(CFLAGS) $(COUT)$*.obj $?
.c: $(COMMONDIR)
.c.obj:
$(CC) $(CFLAGS) $(COUT)$*.obj $?
# Define the name for the executable
BASENAME = rwcyber
# Define the object files that make up this program
!ifeq RWDOS 1
OSOBJ = dossound.obj osdos.obj
!else
OSOBJ = oswin.obj winsound.obj wmwatcom.obj $(COMMONDIR)\common.obj
# To use the sound support, include these 2 object files also
# winsound.obj wmwatcom.obj
!endif
OBJLIB = $(OSOBJ) rwcyber.obj gunbit.obj man.obj ratrophy.obj animate.obj object.obj $(COMMONDIR)\palette.obj $(RWLIB)
# Build the executable. We use an intermediate link file to simplify this
# procedure and to allow arbitrary length link lines
!ifeq RWDOS 1
all: $(BASENAME).exe .SYMBOLIC
$(BASENAME).exe: $(BASENAME).lnk $(OBJLIB)
$(LINK) @$*
del $(BASENAME).lnk
!else
all: $(BASENAME).rex $(BASENAME).exe .SYMBOLIC
# Bind the resources to the executable
$(BASENAME).exe: $(OBJLIB) $(BASENAME).rc
$(BIND) $(BASENAME).rex -R -i=$(COMMONDIR) $(BASENAME).rc
$(BASENAME).rex: $(BASENAME).lnk $(OBJLIB)
$(LINK) @$*
del $(BASENAME).lnk
!endif
$(BASENAME).lnk:
@%create $^@
@%append $^@ $(CLFLAGS)
@%append $^@ NAME $^&
@for %i in ($(OBJLIB)) do @%append $^@ FILE %i
# Clean the source up ready for distribution
dist-clean: .SYMBOLIC
%make clean
del $(BASENAME).exe
# Clean up any intermediate build files leaving the executable
clean: .SYMBOLIC
del $(BASENAME).lnk
del $(BASENAME).rex
del *.res
del *.err
del *.obj
del $(COMMONDIR)\*.obj