2006-04-13 20:47:06 +00:00
|
|
|
# Build Makefile for Microsoft NMake
|
|
|
|
!ifdef OVERRIDES
|
|
|
|
!include $(OVERRIDES)
|
|
|
|
!endif
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
SRC=src
|
|
|
|
GAME=game
|
2006-04-13 20:47:06 +00:00
|
|
|
!ifndef OBJ
|
2006-08-31 01:54:23 +00:00
|
|
|
OBJ=obj.msc
|
2006-04-13 20:47:06 +00:00
|
|
|
!endif
|
|
|
|
INC=include\ #
|
|
|
|
!ifndef CFLAGS
|
2006-05-12 21:55:05 +00:00
|
|
|
CFLAGS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DKSFORBUILD
|
2006-04-13 20:47:06 +00:00
|
|
|
!endif
|
|
|
|
|
|
|
|
o=obj
|
|
|
|
res=res
|
|
|
|
asm=masm
|
|
|
|
|
|
|
|
ENGINELIB=engine.lib
|
|
|
|
EDITORLIB=build.lib
|
|
|
|
|
2006-04-15 03:12:08 +00:00
|
|
|
DXROOT=c:\sdks\directx\dx7
|
2006-04-13 20:47:06 +00:00
|
|
|
FMODROOT=c:\sdks\fmodapi374win\api
|
|
|
|
|
|
|
|
# /D these to enable certain features of the port's compile process
|
2006-09-10 17:40:34 +00:00
|
|
|
# NOASM When defined, uses C instead of assembly code
|
|
|
|
TARGETOPTS=#/DNOASM
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
!ifdef DEBUG
|
|
|
|
# debugging options
|
|
|
|
flags_cl=/G6 /Ot /Z7
|
|
|
|
flags_link=/DEBUG
|
|
|
|
!else
|
|
|
|
# release options
|
|
|
|
#flags_cl=/G6Fy /Ox
|
|
|
|
flags_cl=/G6 /O2
|
|
|
|
flags_link=/RELEASE
|
|
|
|
!endif
|
|
|
|
|
|
|
|
CC=cl
|
|
|
|
AS=ml
|
|
|
|
RC=rc
|
|
|
|
LINK=link /opt:nowin98 /opt:ref /nologo
|
|
|
|
CFLAGS=$(CFLAGS) /nologo /MD /J $(flags_cl) $(TARGETOPTS) /I$(INC) /I$(DXROOT)\include /I$(FMODROOT)\inc
|
2006-07-02 17:33:49 +00:00
|
|
|
GAMECFLAGS=/I$(GAME)
|
2006-04-13 20:47:06 +00:00
|
|
|
LIBS=fmodvc.lib #opengl32.lib
|
|
|
|
ASFLAGS=/nologo /coff
|
|
|
|
EXESUFFIX=.exe
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
ENGINEOBJS=$(OBJ)\a.$o \
|
|
|
|
$(OBJ)\baselayer.$o \
|
|
|
|
$(OBJ)\cache1d.$o \
|
|
|
|
$(OBJ)\compat.$o \
|
|
|
|
$(OBJ)\crc32.$o \
|
|
|
|
$(OBJ)\defs.$o \
|
|
|
|
$(OBJ)\engine.$o \
|
|
|
|
$(OBJ)\glbuild.$o \
|
|
|
|
$(OBJ)\kplib.$o \
|
|
|
|
$(OBJ)\lzf_c.$o \
|
|
|
|
$(OBJ)\lzf_d.$o \
|
|
|
|
$(OBJ)\lzwnew.$o \
|
|
|
|
$(OBJ)\md4.$o \
|
|
|
|
$(OBJ)\mmulti.$o \
|
|
|
|
$(OBJ)\osd.$o \
|
|
|
|
$(OBJ)\pragmas.$o \
|
|
|
|
$(OBJ)\scriptfile.$o \
|
|
|
|
$(OBJ)\winlayer.$o
|
|
|
|
|
|
|
|
EDITOROBJS=$(OBJ)\build.$o \
|
|
|
|
$(OBJ)\startwin.editor.$o \
|
|
|
|
$(OBJ)\config.$o
|
|
|
|
|
|
|
|
GAMEEXEOBJS=$(OBJ)\config.$o \
|
|
|
|
$(OBJ)\game.$o \
|
|
|
|
$(OBJ)\gameres.$(res) \
|
|
|
|
$(OBJ)\startwin.game.$o \
|
|
|
|
$(OBJ)\sound.$o \
|
|
|
|
$(OBJ)\$(ENGINELIB)
|
|
|
|
|
|
|
|
EDITOREXEOBJS=$(OBJ)\bstub.$o \
|
|
|
|
$(OBJ)\buildres.$(res) \
|
|
|
|
$(OBJ)\$(EDITORLIB) \
|
|
|
|
$(OBJ)\$(ENGINELIB)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
RENDERTYPE=WIN
|
2006-07-02 17:33:49 +00:00
|
|
|
LIBS=$(LIBS) user32.lib gdi32.lib shell32.lib dxguid.lib wsock32.lib comctl32.lib
|
2006-04-13 20:47:06 +00:00
|
|
|
CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1
|
|
|
|
|
|
|
|
# RULES
|
|
|
|
.SUFFIXES: .masm
|
|
|
|
|
|
|
|
{$(SRC)}.masm{$(OBJ)}.$o:
|
|
|
|
$(AS) /c $(ASFLAGS) /Fo$@ $<
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
{$(SRC)\tmp}.c{$(OBJ)}.$o:
|
2006-04-13 20:47:06 +00:00
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
{$(SRC)\util}.c{$(OBJ)}.$o:
|
2006-04-13 20:47:06 +00:00
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
{$(SRC)\misc}.rc{$(OBJ)}.$(res):
|
|
|
|
$(RC) /i$(INC)\ /i$(GAME)\ /fo$@ /r $<
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
{$(SRC)}.c{$(OBJ)}.$o:
|
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
2006-07-02 17:33:49 +00:00
|
|
|
{$(SRC)}.cpp{$(OBJ)}.$o:
|
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
|
|
|
{$(GAME)}.c{$(OBJ)}.$o:
|
|
|
|
$(CC) /c $(CFLAGS) $(GAMECFLAGS) /Fo$@ $<
|
|
|
|
|
|
|
|
{$(GAME)}.cpp{$(OBJ)}.$o:
|
|
|
|
$(CC) /c $(CFLAGS) $(GAMECFLAGS) /Fo$@ $<
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
# TARGETS
|
|
|
|
UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2map$(EXESUFFIX) wad2map$(EXESUFFIX)
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
all: game$(EXESUFFIX) build$(EXESUFFIX) ;
|
2006-04-13 20:47:06 +00:00
|
|
|
utils: $(UTILS) ;
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
enginelib: $(OBJ)\$(ENGINELIB) ;
|
|
|
|
$(OBJ)\$(ENGINELIB): $(ENGINEOBJS)
|
2006-04-13 20:47:06 +00:00
|
|
|
lib /out:$@ /nologo $**
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
editorlib: $(OBJ)\$(EDITORLIB) ;
|
|
|
|
$(OBJ)\$(EDITORLIB): $(EDITOROBJS)
|
2006-04-13 20:47:06 +00:00
|
|
|
lib /out:$@ /nologo $**
|
|
|
|
|
|
|
|
|
|
|
|
game$(EXESUFFIX): $(GAMEEXEOBJS)
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib /LIBPATH:$(FMODROOT)\lib $(flags_link) /MAP $** $(LIBS) msvcrt.lib
|
|
|
|
|
|
|
|
build$(EXESUFFIX): $(EDITOREXEOBJS)
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib /LIBPATH:$(FMODROOT)\lib $(flags_link) /MAP $** $(LIBS) msvcrt.lib
|
|
|
|
|
|
|
|
# the tools
|
2006-08-31 01:54:23 +00:00
|
|
|
kextract$(EXESUFFIX): $(OBJ)\kextract.$o $(OBJ)\compat.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
kgroup$(EXESUFFIX): $(OBJ)\kgroup.$o $(OBJ)\compat.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
transpal$(EXESUFFIX): $(OBJ)\transpal.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
wad2map$(EXESUFFIX): $(OBJ)\wad2map.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
wad2art$(EXESUFFIX): $(OBJ)\wad2art.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
|
|
|
|
|
|
|
# DEPENDENCIES
|
|
|
|
!include Makefile.deps
|
|
|
|
|
|
|
|
# PHONIES
|
|
|
|
clean:
|
|
|
|
-del $(ENGINEOBJS) $(EDITOROBJS) $(GAMEEXEOBJS) $(EDITOREXEOBJS)
|
|
|
|
veryclean: clean
|
2006-08-31 01:54:23 +00:00
|
|
|
-del $(OBJ)\$(ENGINELIB) $(OBJ)\$(EDITORLIB) game$(EXESUFFIX) build$(EXESUFFIX) $(UTILS)
|
2006-04-13 20:47:06 +00:00
|
|
|
|