# Build Makefile for Microsoft NMake !ifdef OVERRIDES !include $(OVERRIDES) !endif !ifndef RENDERTYPE RENDERTYPE=WIN !endif ENGINE_SRC=src !ifndef ENGINE_OBJ ENGINE_OBJ=obj.msc !endif ENGINE_INC=include\ # !ifndef CFLAGS CFLAGS=/DUSE_OPENGL /DPOLYMER /DUSE_LIBPNG !endif o=obj res=res asm=masm !ifndef WINBITS WINBITS=32 !endif !if ($(WINBITS)==64) NOASM=1 !endif ENGINELIB=engine.lib EDITORLIB=build.lib # this path should match eduke32\Makefile.msvc # WDKROOT="H:\WinDDK\7600.16385.1" # /D these to enable certain features of the port's compile process # NOASM When defined, uses C instead of assembly code !ifdef NOASM TARGETOPTS=/DNOASM !endif !ifdef DEBUG # debugging options flags_cl=/Od /Zi flags_link=/DEBUG flags_lib= !else # release options flags_cl=/O2 /GL /MP # /I$(WDKROOT)\inc\crt !if ($(WINBITS)!=64) flags_cl=$(flags_cl) /arch:SSE !endif flags_link=/RELEASE /LTCG # /LIBPATH:$(WDKROOT)\lib\Crt\i386 /LIBPATH:$(WDKROOT)\lib\wxp\i386 flags_lib=/LTCG !endif CC=cl AS=ml RC=rc LINK=link /opt:ref /nologo CFLAGS=$(CFLAGS) /nologo /MT /J $(flags_cl) $(TARGETOPTS) /I$(ENGINE_INC) ASFLAGS=/nologo /coff /c EXESUFFIX=.exe !ifdef DEBUG CFLAGS=$(CFLAGS) /DDEBUGGINGAIDS /D "_CRT_SECURE_NO_DEPRECATE" !endif ENGINEOBJS= \ !ifdef NOASM $(ENGINE_OBJ)\a-c.$o \ !else $(ENGINE_OBJ)\a.$o \ !endif $(ENGINE_OBJ)\baselayer.$o \ $(ENGINE_OBJ)\cache1d.$o \ $(ENGINE_OBJ)\compat.$o \ $(ENGINE_OBJ)\crc32.$o \ $(ENGINE_OBJ)\defs.$o \ $(ENGINE_OBJ)\engine.$o \ $(ENGINE_OBJ)\polymost.$o \ $(ENGINE_OBJ)\texcache.$o \ $(ENGINE_OBJ)\dxtfilter.$o \ $(ENGINE_OBJ)\hightile.$o \ $(ENGINE_OBJ)\mdsprite.$o \ $(ENGINE_OBJ)\textfont.$o \ $(ENGINE_OBJ)\smalltextfont.$o \ $(ENGINE_OBJ)\glbuild.$o \ $(ENGINE_OBJ)\kplib.$o \ $(ENGINE_OBJ)\lz4.$o \ $(ENGINE_OBJ)\lzwnew.$o \ $(ENGINE_OBJ)\osd.$o \ $(ENGINE_OBJ)\pragmas.$o \ $(ENGINE_OBJ)\scriptfile.$o \ $(ENGINE_OBJ)\polymer.$o \ $(ENGINE_OBJ)\mutex.$o \ $(ENGINE_OBJ)\winbits.$o \ $(ENGINE_OBJ)\xxhash.$o EDITOROBJS=$(ENGINE_OBJ)\build.$o \ $(ENGINE_OBJ)\startwin.editor.$o \ $(ENGINE_OBJ)\config.$o !if ("$(RENDERTYPE)"=="WIN") ENGINEOBJS=$(ENGINEOBJS) $(ENGINE_OBJ)\winlayer.$o $(ENGINE_OBJ)\rawinput.$o !endif !if ("$(RENDERTYPE)"=="SDL") ENGINEOBJS=$(ENGINEOBJS) $(ENGINE_OBJ)\sdlayer.$o !endif LIBS=$(LIBS) user32.lib gdi32.lib shell32.lib wsock32.lib comctl32.lib dxguid.lib CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1 /DSDL_FRAMEWORK /DSDL_TARGET=2 /W2 # RULES .SUFFIXES: .masm {$(ENGINE_SRC)}.masm{$(ENGINE_OBJ)}.$o: $(AS) /c $(ASFLAGS) /Fo$@ $< {$(ENGINE_SRC)\util}.c{$(ENGINE_OBJ)}.$o: $(CC) /c $(CFLAGS) /Fo$@ $< {$(ENGINE_SRC)\misc}.rc{$(ENGINE_OBJ)}.$(res): $(RC) /i$(ENGINE_INC)\ /fo$@ /r $< {$(ENGINE_SRC)}.c{$(ENGINE_OBJ)}.$o: $(CC) /c $(CFLAGS) /Fo$@ $< {$(ENGINE_SRC)}.cc{$(ENGINE_OBJ)}.$o: $(CC) /c $(CFLAGS) /Fo$@ $< {$(ENGINE_SRC)}.cpp{$(ENGINE_OBJ)}.$o: $(CC) /c $(CFLAGS) /Fo$@ $< {$(ENGINE_SRC)}.cxx{$(ENGINE_OBJ)}.$o: $(CC) /c $(CFLAGS) /Fo$@ $< # TARGETS 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) all: $(ENGINE_OBJ)\$(ENGINELIB) $(ENGINE_OBJ)\$(EDITORLIB); utils: $(UTILS) ; enginelib: $(ENGINE_OBJ)\$(ENGINELIB) ; $(ENGINE_OBJ)\$(ENGINELIB): $(ENGINEOBJS) lib $(flags_lib) /out:$@ /nologo $** editorlib: $(ENGINE_OBJ)\$(EDITORLIB) ; $(ENGINE_OBJ)\$(EDITORLIB): $(EDITOROBJS) lib $(flags_lib) /out:$@ /nologo $** # the tools kextract$(EXESUFFIX): $(ENGINE_OBJ)\kextract.$o $(ENGINE_OBJ)\compat.$o $(ENGINE_OBJ)\compat_tools.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ kgroup$(EXESUFFIX): $(ENGINE_OBJ)\kgroup.$o $(ENGINE_OBJ)\compat.$o $(ENGINE_OBJ)\compat_tools.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ transpal$(EXESUFFIX): $(ENGINE_OBJ)\transpal.$o $(ENGINE_OBJ)\pragmas.$o $(ENGINE_OBJ)\compat.$o $(ENGINE_OBJ)\compat_tools.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ wad2map$(EXESUFFIX): $(ENGINE_OBJ)\wad2map.$o $(ENGINE_OBJ)\pragmas.$o $(ENGINE_OBJ)\compat.$o $(ENGINE_OBJ)\compat_tools.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ wad2art$(EXESUFFIX): $(ENGINE_OBJ)\wad2art.$o $(ENGINE_OBJ)\pragmas.$o $(ENGINE_OBJ)\compat.$o $(ENGINE_OBJ)\compat_tools.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ kmd2tool$(EXESUFFIX): $(ENGINE_OBJ)\kmd2tool.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ md2tool$(EXESUFFIX): $(ENGINE_OBJ)\md2tool.$o $(ENGINE_OBJ)\compat.$o $(ENGINE_OBJ)\compat_tools.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ generateicon$(EXESUFFIX): $(ENGINE_OBJ)\generateicon.$o $(ENGINE_OBJ)\compat.$o $(ENGINE_OBJ)\pragmas.$o $(ENGINE_OBJ)\kplib.$o $(ENGINE_OBJ)\cache1d.$o $(ENGINE_OBJ)\compat_tools.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ cacheinfo$(EXESUFFIX): $(ENGINE_OBJ)\cacheinfo.$o $(ENGINE_OBJ)\compat.$o $(ENGINE_OBJ)\compat_tools.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ arttool$(EXESUFFIX): $(ENGINE_OBJ)\arttool.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ givedepth$(EXESUFFIX): $(ENGINE_OBJ)\givedepth.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ mkpalette$(EXESUFFIX): $(ENGINE_OBJ)\mkpalette.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ unpackssi$(EXESUFFIX): $(ENGINE_OBJ)\unpackssi.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ bsuite$(EXESUFFIX): $(ENGINE_OBJ)\bsuite.$o $(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** $(LIBS) $(MT) -manifest $@.manifest -outputresource:$@ # DEPENDENCIES !include Makefile.deps # PHONIES clean: -del /Q $(ENGINEOBJS) $(EDITOROBJS) $(ENGINE_OBJ)\kextract.$o $(ENGINE_OBJ)\kgroup.$o $(ENGINE_OBJ)\transpal.$o $(ENGINE_OBJ)\wad2art.$o $(ENGINE_OBJ)\wad2map.$o $(ENGINE_OBJ)\kmd2tool.$o $(ENGINE_OBJ)\md2tool.$o $(ENGINE_OBJ)\generateicon.$o $(ENGINE_OBJ)\cacheinfo.$o $(ENGINE_OBJ)\arttool.$o $(ENGINE_OBJ)\givedepth.$o $(ENGINE_OBJ)\mkpalette.$o $(ENGINE_OBJ)\unpackssi.$o $(ENGINE_OBJ)\bsuite.$o $(ENGINE_OBJ)\compat.$o $(ENGINE_OBJ)\compat_tools.$o $(ENGINE_OBJ)\pragmas.$o $(ENGINE_OBJ)\kplib.$o $(ENGINE_OBJ)\cache1d.$o veryclean: clean -del /Q $(ENGINE_OBJ)\$(ENGINELIB) $(ENGINE_OBJ)\$(EDITORLIB) $(UTILS) *.map *.manifest *.pdb