2006-10-15 18:59:45 +00:00
|
|
|
# Build Makefile for Microsoft NMake
|
|
|
|
!ifdef OVERRIDES
|
|
|
|
!include $(OVERRIDES)
|
|
|
|
!endif
|
|
|
|
|
|
|
|
SRC=src
|
|
|
|
!ifndef OBJ
|
|
|
|
OBJ=obj.msc
|
|
|
|
!endif
|
|
|
|
INC=include\ #
|
|
|
|
!ifndef CFLAGS
|
2011-03-04 08:50:58 +00:00
|
|
|
CFLAGS=/DUSE_OPENGL /DPOLYMER # /DNEDMALLOC
|
2006-10-15 18:59:45 +00:00
|
|
|
!endif
|
|
|
|
|
|
|
|
o=obj
|
|
|
|
res=res
|
|
|
|
asm=masm
|
|
|
|
|
|
|
|
ENGINELIB=engine.lib
|
|
|
|
EDITORLIB=build.lib
|
|
|
|
|
2010-05-25 10:56:00 +00:00
|
|
|
# this path should match eduke32\Makefile.msvc
|
2011-04-07 01:16:29 +00:00
|
|
|
WDKROOT="H:\WinDDK\7600.16385.1"
|
2006-10-15 18:59:45 +00:00
|
|
|
|
|
|
|
# /D these to enable certain features of the port's compile process
|
2009-04-12 21:52:49 +00:00
|
|
|
# NOASM When defined, uses C instead of assembly code
|
2007-03-01 18:19:11 +00:00
|
|
|
!ifdef NOASM
|
2009-04-12 21:52:49 +00:00
|
|
|
TARGETOPTS=/DNOASM
|
2007-03-01 18:19:11 +00:00
|
|
|
!endif
|
2006-10-15 18:59:45 +00:00
|
|
|
|
|
|
|
!ifdef DEBUG
|
|
|
|
# debugging options
|
2009-06-05 20:09:13 +00:00
|
|
|
flags_cl=/Od /Zi
|
2006-10-15 18:59:45 +00:00
|
|
|
flags_link=/DEBUG
|
2009-07-09 02:29:48 +00:00
|
|
|
flags_lib=
|
2006-10-15 18:59:45 +00:00
|
|
|
!else
|
|
|
|
# release options
|
2010-05-25 10:56:00 +00:00
|
|
|
flags_cl=/O2 /GL /arch:SSE /MP /I$(WDKROOT)\inc\crt
|
|
|
|
flags_link=/RELEASE /LTCG /LIBPATH:$(WDKROOT)\lib\Crt\i386 /LIBPATH:$(WDKROOT)\lib\wxp\i386
|
2009-07-09 02:29:48 +00:00
|
|
|
flags_lib=/LTCG
|
2006-10-15 18:59:45 +00:00
|
|
|
!endif
|
|
|
|
|
|
|
|
CC=cl
|
|
|
|
AS=ml
|
|
|
|
RC=rc
|
2012-03-14 06:26:29 +00:00
|
|
|
LINK=link /opt:ref /nologo
|
2010-05-25 10:56:00 +00:00
|
|
|
CFLAGS=$(CFLAGS) /nologo /MT /J $(flags_cl) $(TARGETOPTS) /I$(INC)
|
2008-11-09 11:09:42 +00:00
|
|
|
ASFLAGS=/nologo /coff /c
|
2006-10-15 18:59:45 +00:00
|
|
|
EXESUFFIX=.exe
|
2008-12-28 23:27:24 +00:00
|
|
|
!ifdef DEBUG
|
2010-05-25 10:56:00 +00:00
|
|
|
CFLAGS=$(CFLAGS) /DDEBUGGINGAIDS /D "_CRT_SECURE_NO_DEPRECATE"
|
2008-12-28 23:27:24 +00:00
|
|
|
!endif
|
2006-10-15 18:59:45 +00:00
|
|
|
|
2009-04-12 21:52:49 +00:00
|
|
|
ENGINEOBJS= \
|
|
|
|
!ifdef NOASM
|
|
|
|
$(OBJ)\a-c.$o \
|
|
|
|
!else
|
|
|
|
$(OBJ)\a.$o \
|
2007-03-01 18:19:11 +00:00
|
|
|
!endif
|
2006-10-15 18:59:45 +00:00
|
|
|
$(OBJ)\baselayer.$o \
|
|
|
|
$(OBJ)\cache1d.$o \
|
|
|
|
$(OBJ)\compat.$o \
|
|
|
|
$(OBJ)\crc32.$o \
|
|
|
|
$(OBJ)\defs.$o \
|
|
|
|
$(OBJ)\engine.$o \
|
2008-12-02 10:44:39 +00:00
|
|
|
$(OBJ)\polymost.$o \
|
|
|
|
$(OBJ)\hightile.$o \
|
|
|
|
$(OBJ)\mdsprite.$o \
|
|
|
|
$(OBJ)\textfont.$o \
|
|
|
|
$(OBJ)\smalltextfont.$o \
|
2006-10-15 18:59:45 +00:00
|
|
|
$(OBJ)\glbuild.$o \
|
|
|
|
$(OBJ)\kplib.$o \
|
2009-12-05 09:22:43 +00:00
|
|
|
$(OBJ)\quicklz.$o \
|
2006-10-15 18:59:45 +00:00
|
|
|
$(OBJ)\lzwnew.$o \
|
|
|
|
$(OBJ)\md4.$o \
|
|
|
|
$(OBJ)\osd.$o \
|
|
|
|
$(OBJ)\pragmas.$o \
|
|
|
|
$(OBJ)\scriptfile.$o \
|
2007-09-11 02:23:08 +00:00
|
|
|
$(OBJ)\winlayer.$o \
|
2010-05-18 00:30:30 +00:00
|
|
|
$(OBJ)\polymer.$o \
|
|
|
|
$(OBJ)\mutex.$o \
|
2010-05-25 10:56:00 +00:00
|
|
|
$(OBJ)\rawinput.$o
|
2006-10-15 18:59:45 +00:00
|
|
|
|
|
|
|
EDITOROBJS=$(OBJ)\build.$o \
|
|
|
|
$(OBJ)\startwin.editor.$o \
|
|
|
|
$(OBJ)\config.$o
|
|
|
|
|
|
|
|
RENDERTYPE=WIN
|
2010-05-02 23:27:30 +00:00
|
|
|
LIBS=$(LIBS) user32.lib gdi32.lib shell32.lib wsock32.lib comctl32.lib dxguid.lib
|
2010-05-25 10:56:00 +00:00
|
|
|
CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1 /W2
|
2006-10-15 18:59:45 +00:00
|
|
|
|
|
|
|
# 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):
|
2006-11-16 03:00:03 +00:00
|
|
|
$(RC) /i$(INC)\ /fo$@ /r $<
|
2006-10-15 18:59:45 +00:00
|
|
|
|
|
|
|
{$(SRC)}.c{$(OBJ)}.$o:
|
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
2012-03-14 06:26:29 +00:00
|
|
|
{$(SRC)}.cc{$(OBJ)}.$o:
|
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
2006-10-15 18:59:45 +00:00
|
|
|
{$(SRC)}.cpp{$(OBJ)}.$o:
|
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
2012-03-14 06:26:29 +00:00
|
|
|
{$(SRC)}.cxx{$(OBJ)}.$o:
|
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
2006-10-15 18:59:45 +00:00
|
|
|
# TARGETS
|
2012-03-23 20:23:46 +00:00
|
|
|
UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2art$(EXESUFFIX) wad2map$(EXESUFFIX) kmd2tool$(EXESUFFIX) md2tool$(EXESUFFIX) generateicon$(EXESUFFIX) cacheinfo$(EXESUFFIX) arttool$(EXESUFFIX) givedepth$(EXESUFFIX) mkpalette$(EXESUFFIX) unpackssi$(EXESUFFIX) bsuite$(EXESUFFIX)
|
2012-03-14 06:26:29 +00:00
|
|
|
|
|
|
|
all: $(OBJ)\$(ENGINELIB) $(OBJ)\$(EDITORLIB);
|
2006-10-15 18:59:45 +00:00
|
|
|
utils: $(UTILS) ;
|
|
|
|
|
|
|
|
enginelib: $(OBJ)\$(ENGINELIB) ;
|
|
|
|
$(OBJ)\$(ENGINELIB): $(ENGINEOBJS)
|
2009-07-09 02:29:48 +00:00
|
|
|
lib $(flags_lib) /out:$@ /nologo $**
|
2006-10-15 18:59:45 +00:00
|
|
|
|
|
|
|
editorlib: $(OBJ)\$(EDITORLIB) ;
|
|
|
|
$(OBJ)\$(EDITORLIB): $(EDITOROBJS)
|
2009-07-09 02:29:48 +00:00
|
|
|
lib $(flags_lib) /out:$@ /nologo $**
|
2006-10-15 18:59:45 +00:00
|
|
|
|
|
|
|
# the tools
|
2012-03-14 06:26:29 +00:00
|
|
|
kextract$(EXESUFFIX): $(OBJ)\kextract.$o $(OBJ)\compat.$o $(OBJ)\compat_tools.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
2007-09-11 00:52:38 +00:00
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
2012-03-14 06:26:29 +00:00
|
|
|
kgroup$(EXESUFFIX): $(OBJ)\kgroup.$o $(OBJ)\compat.$o $(OBJ)\compat_tools.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
|
|
|
transpal$(EXESUFFIX): $(OBJ)\transpal.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o $(OBJ)\compat_tools.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
|
|
|
wad2map$(EXESUFFIX): $(OBJ)\wad2map.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o $(OBJ)\compat_tools.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
|
|
|
wad2art$(EXESUFFIX): $(OBJ)\wad2art.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o $(OBJ)\compat_tools.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
2012-03-23 20:23:46 +00:00
|
|
|
kmd2tool$(EXESUFFIX): $(OBJ)\kmd2tool.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
2012-03-14 06:26:29 +00:00
|
|
|
md2tool$(EXESUFFIX): $(OBJ)\md2tool.$o $(OBJ)\compat.$o $(OBJ)\compat_tools.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
|
|
|
generateicon$(EXESUFFIX): $(OBJ)\generateicon.$o $(OBJ)\compat.$o $(OBJ)\pragmas.$o $(OBJ)\kplib.$o $(OBJ)\cache1d.$o $(OBJ)\compat_tools.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
|
|
|
cacheinfo$(EXESUFFIX): $(OBJ)\cacheinfo.$o $(OBJ)\compat.$o $(OBJ)\compat_tools.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
2007-09-11 00:52:38 +00:00
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
2006-10-15 18:59:45 +00:00
|
|
|
|
2012-03-14 06:26:29 +00:00
|
|
|
arttool$(EXESUFFIX): $(OBJ)\arttool.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
2007-09-11 00:52:38 +00:00
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
2006-10-15 18:59:45 +00:00
|
|
|
|
2012-03-14 06:26:29 +00:00
|
|
|
givedepth$(EXESUFFIX): $(OBJ)\givedepth.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
2007-09-11 00:52:38 +00:00
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
2006-10-15 18:59:45 +00:00
|
|
|
|
2012-03-14 06:26:29 +00:00
|
|
|
mkpalette$(EXESUFFIX): $(OBJ)\mkpalette.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
2007-09-11 00:52:38 +00:00
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
2006-10-15 18:59:45 +00:00
|
|
|
|
2012-03-18 08:48:32 +00:00
|
|
|
unpackssi$(EXESUFFIX): $(OBJ)\unpackssi.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
|
|
|
bsuite$(EXESUFFIX): $(OBJ)\bsuite.$o $(OBJ)\nedmalloc.$o
|
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS)
|
|
|
|
$(MT) -manifest $@.manifest -outputresource:$@
|
|
|
|
|
2006-10-15 18:59:45 +00:00
|
|
|
# DEPENDENCIES
|
|
|
|
!include Makefile.deps
|
|
|
|
|
2012-03-14 06:26:29 +00:00
|
|
|
# PHONIES
|
2006-10-15 18:59:45 +00:00
|
|
|
clean:
|
2012-03-23 20:23:46 +00:00
|
|
|
-del /Q $(ENGINEOBJS) $(EDITOROBJS) $(OBJ)\kextract.$o $(OBJ)\kgroup.$o $(OBJ)\transpal.$o $(OBJ)\wad2art.$o $(OBJ)\wad2map.$o $(OBJ)\kmd2tool.$o $(OBJ)\md2tool.$o $(OBJ)\generateicon.$o $(OBJ)\cacheinfo.$o $(OBJ)\arttool.$o $(OBJ)\givedepth.$o $(OBJ)\mkpalette.$o $(OBJ)\unpackssi.$o $(OBJ)\bsuite.$o $(OBJ)\compat.$o $(OBJ)\compat_tools.$o $(OBJ)\pragmas.$o $(OBJ)\kplib.$o $(OBJ)\cache1d.$o $(OBJ)\nedmalloc.$o
|
2006-10-15 18:59:45 +00:00
|
|
|
veryclean: clean
|
2006-12-21 12:53:11 +00:00
|
|
|
-del /Q $(OBJ)\$(ENGINELIB) $(OBJ)\$(EDITORLIB) $(UTILS) *.map *.manifest *.pdb
|
2006-10-15 18:59:45 +00:00
|
|
|
|