mirror of
https://github.com/ZDoom/Raze.git
synced 2024-12-15 07:01:15 +00:00
167 lines
4.5 KiB
Text
167 lines
4.5 KiB
Text
|
# Build Makefile for Microsoft NMake
|
||
|
!ifdef OVERRIDES
|
||
|
!include $(OVERRIDES)
|
||
|
!endif
|
||
|
|
||
|
SRC=src\ #
|
||
|
!ifndef OBJ
|
||
|
OBJ=obj.msc\ #
|
||
|
!endif
|
||
|
INC=include\ #
|
||
|
!ifndef CFLAGS
|
||
|
CFLAGS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL /DDYNAMIC_OPENGL /DKSFORBUILD
|
||
|
!endif
|
||
|
|
||
|
o=obj
|
||
|
res=res
|
||
|
asm=masm
|
||
|
|
||
|
ENGINELIB=engine.lib
|
||
|
EDITORLIB=build.lib
|
||
|
|
||
|
DXROOT=c:\sdks\msc\dx7
|
||
|
FMODROOT=c:\sdks\fmodapi374win\api
|
||
|
|
||
|
# /D these to enable certain features of the port's compile process
|
||
|
# USE_A_C This uses a C version of the classic renderer code rather
|
||
|
# than the assembly version in A.ASM.
|
||
|
# If this is defined, alter the $(OBJ)a.$o in the
|
||
|
# ENGINEOBJS declaration to be $(OBJ)a-c.$o
|
||
|
# NOASM When defined, uses C instead of Microsoft inline
|
||
|
# assembly for the features in PRAGMAS.H
|
||
|
TARGETOPTS=#/DUSE_A_C #/DNOASM
|
||
|
|
||
|
!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
|
||
|
LIBS=fmodvc.lib #opengl32.lib
|
||
|
ASFLAGS=/nologo /coff
|
||
|
EXESUFFIX=.exe
|
||
|
|
||
|
ENGINEOBJS=$(OBJ)a.$o \
|
||
|
$(OBJ)baselayer.$o \
|
||
|
$(OBJ)cache1d.$o \
|
||
|
$(OBJ)compat.$o \
|
||
|
$(OBJ)crc32.$o \
|
||
|
$(OBJ)defs.$o \
|
||
|
$(OBJ)engine.$o \
|
||
|
$(OBJ)engineinfo.$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)buildstartwin.$o \
|
||
|
$(OBJ)config.$o
|
||
|
|
||
|
GAMEEXEOBJS=$(OBJ)config.$o \
|
||
|
$(OBJ)game.$o \
|
||
|
$(OBJ)gameres.$(res) \
|
||
|
$(OBJ)gamestartwin.$o \
|
||
|
$(OBJ)sound.$o \
|
||
|
$(OBJ)$(ENGINELIB)
|
||
|
|
||
|
EDITOREXEOBJS=$(OBJ)bstub.$o \
|
||
|
$(OBJ)buildres.$(res) \
|
||
|
$(OBJ)$(EDITORLIB) \
|
||
|
$(OBJ)$(ENGINELIB)
|
||
|
|
||
|
RENDERTYPE=WIN
|
||
|
LIBS=$(LIBS) user32.lib gdi32.lib shell32.lib dxguid.lib wsock32.lib
|
||
|
CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1
|
||
|
|
||
|
# RULES
|
||
|
.SUFFIXES: .masm
|
||
|
|
||
|
{$(SRC)}.masm{$(OBJ)}.$o:
|
||
|
$(AS) /c $(ASFLAGS) /Fo$@ $<
|
||
|
|
||
|
{$(SRC)tmp}.c{$(OBJ)}.$o:
|
||
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||
|
|
||
|
{$(SRC)util}.c{$(OBJ)}.$o:
|
||
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||
|
|
||
|
{$(SRC)misc}.rc{$(OBJ)}.$(res):
|
||
|
$(RC) /fo$@ /r $<
|
||
|
|
||
|
{$(SRC)}.c{$(OBJ)}.$o:
|
||
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
||
|
|
||
|
# TARGETS
|
||
|
UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2map$(EXESUFFIX) wad2map$(EXESUFFIX)
|
||
|
|
||
|
all: game$(EXESUFFIX) build$(EXESUFFIX) $(OBJ)$(ENGINELIB) $(OBJ)$(EDITORLIB) ;
|
||
|
utils: $(UTILS) ;
|
||
|
|
||
|
enginelib: $(OBJ)$(ENGINELIB) ;
|
||
|
$(OBJ)$(ENGINELIB): $(ENGINEOBJS)
|
||
|
lib /out:$@ /nologo $**
|
||
|
|
||
|
editorlib: $(OBJ)$(EDITORLIB) ;
|
||
|
$(OBJ)$(EDITORLIB): $(EDITOROBJS)
|
||
|
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
|
||
|
kextract$(EXESUFFIX): $(OBJ)kextract.$o $(OBJ)compat.$o
|
||
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
||
|
|
||
|
kgroup$(EXESUFFIX): $(OBJ)kgroup.$o $(OBJ)compat.$o
|
||
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
||
|
|
||
|
transpal$(EXESUFFIX): $(OBJ)transpal.$o $(OBJ)pragmas.$o $(OBJ)compat.$o
|
||
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
||
|
|
||
|
wad2map$(EXESUFFIX): $(OBJ)wad2map.$o $(OBJ)pragmas.$o $(OBJ)compat.$o
|
||
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
||
|
|
||
|
wad2art$(EXESUFFIX): $(OBJ)wad2art.$o $(OBJ)pragmas.$o $(OBJ)compat.$o
|
||
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
|
||
|
|
||
|
# DEPENDENCIES
|
||
|
!include Makefile.deps
|
||
|
|
||
|
$(OBJ)engineinfo.$o: writeengineinfo $(SRC)tmp\engineinfo.c
|
||
|
|
||
|
writeengineinfo:
|
||
|
echo const char _engine_cflags[] = "$(CFLAGS:\=\\)"; > $(SRC)tmp\engineinfo.c
|
||
|
echo const char _engine_libs[] = "$(LIBS)"; >> $(SRC)tmp\engineinfo.c
|
||
|
echo const char _engine_uname[] = "unknown"; >> $(SRC)tmp\engineinfo.c
|
||
|
echo const char _engine_compiler[] = "$(CC)"; >> $(SRC)tmp\engineinfo.c
|
||
|
echo const char _engine_date[] = __DATE__ " " __TIME__; >> $(SRC)tmp\engineinfo.c
|
||
|
|
||
|
# PHONIES
|
||
|
clean:
|
||
|
-del $(ENGINEOBJS) $(EDITOROBJS) $(GAMEEXEOBJS) $(EDITOREXEOBJS)
|
||
|
veryclean: clean
|
||
|
-del $(OBJ)$(ENGINELIB) $(OBJ)$(EDITORLIB) game$(EXESUFFIX) build$(EXESUFFIX) $(UTILS)
|
||
|
|