2006-12-21 12:53:11 +00:00
|
|
|
# EDuke32 Makefile for Microsoft NMake
|
2012-11-15 14:27:49 +00:00
|
|
|
CPLUSPLUS=1
|
2006-08-31 01:54:23 +00:00
|
|
|
SRC=source
|
2007-10-24 06:48:13 +00:00
|
|
|
OBJ=obj_win
|
2008-10-20 03:09:19 +00:00
|
|
|
EROOT=build
|
2006-08-31 01:54:23 +00:00
|
|
|
EINC=$(EROOT)\include
|
2007-10-24 06:48:13 +00:00
|
|
|
EOBJ=eobj_win
|
2006-04-13 20:47:06 +00:00
|
|
|
INC=$(SRC)
|
2007-09-11 02:23:08 +00:00
|
|
|
RSRC=rsrc
|
2006-04-13 20:47:06 +00:00
|
|
|
o=obj
|
|
|
|
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
WINLIB=\32
|
|
|
|
DXLIB=\x86
|
|
|
|
|
|
|
|
# When we support 64-bit targets with MSVC, if a 64-bit build is selected:
|
|
|
|
# WINLIB=\64
|
|
|
|
# DXLIB=\x64 # Presumably. Could be x86_64, amd64, etc.
|
|
|
|
# verify if anything needs to happen with vorbisfile_static.lib vorbis_static.lib ogg_static.lib
|
|
|
|
|
|
|
|
# TODO: add MSVC support for libvpx, libpng, zlib
|
|
|
|
|
2009-07-29 10:33:56 +00:00
|
|
|
JAUDIOLIBDIR=$(SRC)\jaudiolib
|
|
|
|
JAUDIOLIB=libjfaudiolib.lib
|
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
ENETDIR=$(SRC)\enet
|
|
|
|
ENETLIB=libenet.lib
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
ENGINELIB=engine.lib
|
|
|
|
EDITORLIB=build.lib
|
|
|
|
|
2010-05-25 10:56:00 +00:00
|
|
|
# the WDK allows us to link against msvcrt.dll instead of msvcrxxx.dll
|
|
|
|
# this path should match build\Makefile.msvc
|
2012-12-14 17:13:17 +00:00
|
|
|
# WDKROOT="H:\WinDDK\7600.16385.1"
|
|
|
|
DXROOT="C:\SDKs\Microsoft DirectX SDK (February 2010)"
|
|
|
|
VORBISSDK="C:\SDKs\oggvorbis-win32sdk-1.0.1"
|
2010-05-25 10:56:00 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
!ifdef DEBUG
|
|
|
|
# debugging options
|
2012-11-15 14:27:49 +00:00
|
|
|
flags_cl=/Od /Zi
|
2006-04-13 20:47:06 +00:00
|
|
|
flags_link=/DEBUG
|
|
|
|
!else
|
|
|
|
# release options
|
2012-11-15 14:27:49 +00:00
|
|
|
flags_cl=/O2 /GL /arch:SSE /MP # /I$(WDKROOT)\inc\crt /I$(WDKROOT)\inc\api
|
|
|
|
flags_link=/RELEASE /LTCG # /LIBPATH:$(WDKROOT)\lib\wxp\i386 /LIBPATH:$(WDKROOT)\lib\Crt\i386
|
2006-04-13 20:47:06 +00:00
|
|
|
!endif
|
|
|
|
|
2012-05-17 23:54:43 +00:00
|
|
|
ENGINEOPTS=/DUSE_OPENGL /DPOLYMER
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2012-11-15 14:27:49 +00:00
|
|
|
!ifdef CPLUSPLUS
|
|
|
|
ENGINEOPTS=$(ENGINEOPTS) /TP
|
|
|
|
!endif
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
CC=cl
|
|
|
|
AS=ml
|
2010-05-18 00:30:30 +00:00
|
|
|
LINK=link /nologo /opt:ref
|
2007-09-11 00:52:38 +00:00
|
|
|
MT=mt
|
2009-06-05 20:09:13 +00:00
|
|
|
CFLAGS= /MT /J /nologo $(flags_cl) \
|
2012-11-16 15:40:28 +00:00
|
|
|
/I$(INC) /I$(EINC)\msvc /I$(EINC)\ /I$(SRC)\jmact /I$(JAUDIOLIBDIR)\include /I$(ENETDIR)\include \
|
2010-05-25 10:56:00 +00:00
|
|
|
/W2 $(ENGINEOPTS) \
|
2012-12-14 17:13:17 +00:00
|
|
|
/I$(DXROOT)\include /I$(VORBISSDK)\include /DRENDERTYPEWIN=1
|
2010-05-25 10:56:00 +00:00
|
|
|
|
2010-05-02 23:27:30 +00:00
|
|
|
LIBS=user32.lib gdi32.lib shell32.lib winmm.lib ws2_32.lib dxguid.lib comctl32.lib \
|
2010-05-25 10:56:00 +00:00
|
|
|
vorbisfile_static.lib vorbis_static.lib ogg_static.lib dsound.lib advapi32.lib
|
2008-03-09 08:14:12 +00:00
|
|
|
|
2010-05-25 10:56:00 +00:00
|
|
|
LIBS=/NODEFAULTLIB:glu32.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib /NODEFAULTLIB:libcmt.lib \
|
|
|
|
/NODEFAULTLIB:libcmtd.lib $(LIBS)
|
2008-03-09 08:14:12 +00:00
|
|
|
|
2008-11-09 11:09:42 +00:00
|
|
|
ASFLAGS=/nologo /coff /c
|
2006-04-13 20:47:06 +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"
|
|
|
|
LIBS=$(LIBS) msvcrtd.lib
|
2009-06-05 20:09:13 +00:00
|
|
|
!else
|
2010-05-25 10:56:00 +00:00
|
|
|
# comment msvcrt_winxp.obj if not using the WDK
|
2012-11-15 14:27:49 +00:00
|
|
|
LIBS=$(LIBS) msvcrt.lib # msvcrt_winxp.obj
|
2008-12-28 23:27:24 +00:00
|
|
|
!endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2010-07-19 15:14:00 +00:00
|
|
|
JMACTOBJ=$(OBJ)\file_lib.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)\control.$o \
|
|
|
|
$(OBJ)\keyboard.$o \
|
|
|
|
$(OBJ)\mouse.$o \
|
2012-06-03 16:11:22 +00:00
|
|
|
$(OBJ)\joystick.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)\mathutil.$o \
|
|
|
|
$(OBJ)\scriplib.$o
|
|
|
|
|
2009-07-29 10:33:56 +00:00
|
|
|
AUDIOLIBOBJ=$(OBJ)\midi.$o $(OBJ)\music.$o $(OBJ)\mpu401.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-12-21 12:53:11 +00:00
|
|
|
GAMEOBJS=$(OBJ)\game.$o \
|
2012-11-15 14:27:49 +00:00
|
|
|
$(OBJ)\game_inline.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)\actors.$o \
|
2012-11-15 14:27:49 +00:00
|
|
|
$(OBJ)\actors_inline.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)\anim.$o \
|
2012-04-01 00:26:01 +00:00
|
|
|
$(OBJ)\common.$o \
|
2010-08-02 08:13:51 +00:00
|
|
|
$(OBJ)\demo.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)\gamedef.$o \
|
|
|
|
$(OBJ)\gameexec.$o \
|
2006-12-10 19:32:44 +00:00
|
|
|
$(OBJ)\gamevars.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)\global.$o \
|
2012-06-03 16:11:22 +00:00
|
|
|
$(OBJ)\input.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)\menus.$o \
|
|
|
|
$(OBJ)\namesdyn.$o \
|
2010-08-02 08:13:51 +00:00
|
|
|
$(OBJ)\net.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)\player.$o \
|
|
|
|
$(OBJ)\premap.$o \
|
|
|
|
$(OBJ)\savegame.$o \
|
|
|
|
$(OBJ)\sector.$o \
|
2012-11-15 14:27:49 +00:00
|
|
|
$(OBJ)\sector_inline.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)\rts.$o \
|
|
|
|
$(OBJ)\config.$o \
|
|
|
|
$(OBJ)\animlib.$o\
|
|
|
|
$(OBJ)\osdfuncs.$o \
|
|
|
|
$(OBJ)\osdcmds.$o \
|
|
|
|
$(OBJ)\grpscan.$o \
|
|
|
|
$(OBJ)\winbits.$o \
|
|
|
|
$(OBJ)\gameres.res \
|
|
|
|
$(OBJ)\startwin.game.$o \
|
2006-07-22 06:13:16 +00:00
|
|
|
$(JMACTOBJ) \
|
2007-09-11 02:23:08 +00:00
|
|
|
$(AUDIOLIBOBJ) \
|
2009-03-23 05:17:20 +00:00
|
|
|
$(OBJ)\sounds.$o \
|
2008-01-27 22:50:29 +00:00
|
|
|
!ifdef DEBUG
|
2007-09-11 02:23:08 +00:00
|
|
|
$(OBJ)\mdump.$o
|
2008-01-27 22:50:29 +00:00
|
|
|
!endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
EDITOROBJS=$(OBJ)\astub.$o \
|
2012-04-01 00:26:01 +00:00
|
|
|
$(OBJ)\common.$o \
|
2009-03-23 05:17:20 +00:00
|
|
|
$(OBJ)\mathutil.$o \
|
2009-10-07 06:47:35 +00:00
|
|
|
$(OBJ)\m32def.$o \
|
|
|
|
$(OBJ)\m32vars.$o \
|
|
|
|
$(OBJ)\m32exec.$o \
|
2009-03-23 05:17:20 +00:00
|
|
|
$(OBJ)\sounds_mapster32.$o \
|
2007-09-11 02:23:08 +00:00
|
|
|
$(OBJ)\buildres.res \
|
2009-03-23 05:17:20 +00:00
|
|
|
$(AUDIOLIB_FX) \
|
2008-01-27 22:50:29 +00:00
|
|
|
!ifdef DEBUG
|
2007-09-11 02:23:08 +00:00
|
|
|
$(OBJ)\mdump.$o
|
2008-01-27 22:50:29 +00:00
|
|
|
!endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
# RULES
|
|
|
|
.SUFFIXES: .masm
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
{$(SRC)\}.masm{$(OBJ)\}.$o:
|
2006-04-13 20:47:06 +00:00
|
|
|
$(AS) /c $(ASFLAGS) /Fo$@ $<
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
{$(SRC)\jmact}.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)\}.c{$(OBJ)\}.$o:
|
2006-04-13 20:47:06 +00:00
|
|
|
$(CC) /c $(CFLAGS) /Fo$@ $<
|
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
{$(SRC)\}.cpp{$(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:
|
2010-05-02 23:27:30 +00:00
|
|
|
$(RC) /i$(EINC)\ /i$(SRC)\ /DPOLYMER /fo$@ /r $<
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
# TARGETS
|
2009-01-31 00:02:14 +00:00
|
|
|
all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) # duke3d_w32$(EXESUFFIX);
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)\$(ENGINELIB) $(JAUDIOLIBDIR)\$(JAUDIOLIB) $(ENETDIR)\$(ENETLIB)
|
2012-12-14 17:13:17 +00:00
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib$(DXLIB) /LIBPATH:$(VORBISSDK)\lib $(flags_link) /MAP $** $(LIBS)
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
$(MT) -manifest $(RSRC)$(WINLIB)\manifest.game.xml -hashupdate -outputresource:$@ -out:$@.manifest
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-07-29 10:33:56 +00:00
|
|
|
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)\$(ENGINELIB) $(EOBJ)\$(EDITORLIB) $(JAUDIOLIBDIR)\$(JAUDIOLIB)
|
2012-12-14 17:13:17 +00:00
|
|
|
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib$(DXLIB) /LIBPATH:$(VORBISSDK)\lib $(flags_link) /MAP $** $(LIBS)
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
$(MT) -manifest $(RSRC)$(WINLIB)\manifest.build.xml -hashupdate -outputresource:$@ -out:$@.manifest
|
2008-03-09 08:14:12 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
!include Makefile.deps
|
|
|
|
|
|
|
|
enginelib editorlib: AlwaysBuild
|
2006-12-21 12:53:11 +00:00
|
|
|
-mkdir $(EOBJ)
|
2006-08-31 01:54:23 +00:00
|
|
|
echo OBJ=$(MAKEDIR)\$(EOBJ)\ > $(EOBJ)\overrides.mak
|
|
|
|
echo CFLAGS=$(ENGINEOPTS) >> $(EOBJ)\overrides.mak
|
2006-12-21 12:53:11 +00:00
|
|
|
cd $(EROOT)
|
2006-08-31 01:54:23 +00:00
|
|
|
nmake /f Makefile.msvc "OVERRIDES=$(MAKEDIR)\$(EOBJ)\overrides.mak" $@
|
2006-04-13 20:47:06 +00:00
|
|
|
cd $(MAKEDIR)
|
|
|
|
|
2009-07-29 10:33:56 +00:00
|
|
|
jaudiolib:
|
|
|
|
cd $(JAUDIOLIBDIR)
|
|
|
|
nmake /f Makefile.msvc
|
|
|
|
cd $(MAKEDIR)
|
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
enet:
|
|
|
|
cd $(ENETDIR)
|
|
|
|
nmake /f Makefile.msvc
|
|
|
|
cd $(MAKEDIR)
|
2009-07-29 10:33:56 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
AlwaysBuild: ;
|
2006-08-31 01:54:23 +00:00
|
|
|
$(EOBJ)\$(EDITORLIB): editorlib ;
|
|
|
|
$(EOBJ)\$(ENGINELIB): enginelib ;
|
2009-07-29 10:33:56 +00:00
|
|
|
$(JAUDIOLIBDIR)\$(JAUDIOLIB): jaudiolib ;
|
2009-12-05 09:22:43 +00:00
|
|
|
$(ENETDIR)\$(ENETLIB): enet ;
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
# PHONIES
|
|
|
|
clean:
|
2008-03-09 08:14:12 +00:00
|
|
|
-del /Q $(OBJ)\* eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX) \
|
2006-12-21 12:53:11 +00:00
|
|
|
*.pdb *.map *.manifest
|
2009-07-29 10:33:56 +00:00
|
|
|
cd $(JAUDIOLIBDIR)
|
|
|
|
nmake /f Makefile.msvc clean
|
2009-12-05 09:22:43 +00:00
|
|
|
cd $(MAKEDIR)\$(ENETDIR)
|
|
|
|
nmake /f Makefile.msvc clean
|
2009-07-29 10:33:56 +00:00
|
|
|
cd $(MAKEDIR)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
veryclean: clean
|
2006-12-21 12:53:11 +00:00
|
|
|
-del /Q $(EOBJ)\*
|