EDuke32 now compiles okay with the Microsoft compiler using NMake.

git-svn-id: https://svn.eduke32.com/eduke32@434 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
Plagman 2006-12-21 12:53:11 +00:00
parent 8d6eef5b0f
commit 87556300bf
15 changed files with 57 additions and 43 deletions

View file

@ -19,8 +19,9 @@ asm=masm
ENGINELIB=engine.lib
EDITORLIB=build.lib
DXROOT=c:\sdks\directx\dx7
FMODROOT=c:\sdks\fmodapi374win\api
DXROOT=c:\sdks\dx6
MSSDKROOT="C:\Program Files\Microsoft Visual Studio 8\VC
PLATFORMSDK="C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
# /D these to enable certain features of the port's compile process
# NOASM When defined, uses C instead of assembly code
@ -28,12 +29,12 @@ TARGETOPTS=#/DNOASM
!ifdef DEBUG
# debugging options
flags_cl=/G6 /Ot /Z7
flags_cl=/Ot /Zi
flags_link=/DEBUG
!else
# release options
#flags_cl=/G6Fy /Ox
flags_cl=/G6 /O2
#flags_cl=/Ox
flags_cl= /O2 /Ox
flags_link=/RELEASE
!endif
@ -41,8 +42,7 @@ 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
CFLAGS=$(CFLAGS) /nologo /MD /J $(flags_cl) $(TARGETOPTS) /I$(INC) /I$(DXROOT)\include /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include"
ASFLAGS=/nologo /coff
EXESUFFIX=.exe
@ -63,7 +63,8 @@ ENGINEOBJS=$(OBJ)\a.$o \
$(OBJ)\osd.$o \
$(OBJ)\pragmas.$o \
$(OBJ)\scriptfile.$o \
$(OBJ)\winlayer.$o
$(OBJ)\winlayer.$o \
$(OBJ)\polymer.$o
EDITOROBJS=$(OBJ)\build.$o \
$(OBJ)\startwin.editor.$o \
@ -71,7 +72,7 @@ EDITOROBJS=$(OBJ)\build.$o \
RENDERTYPE=WIN
LIBS=$(LIBS) user32.lib gdi32.lib shell32.lib dxguid.lib wsock32.lib comctl32.lib
CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1
CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1 /D "_CRT_SECURE_NO_DEPRECATE" /W0
# RULES
.SUFFIXES: .masm
@ -95,9 +96,9 @@ CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1
$(CC) /c $(CFLAGS) /Fo$@ $<
# TARGETS
UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2map$(EXESUFFIX) wad2map$(EXESUFFIX)
UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2art$(EXESUFFIX) wad2map$(EXESUFFIX)
all: ;
all: $(OBJ)/$(ENGINELIB) $(OBJ)/$(EDITORLIB);
utils: $(UTILS) ;
enginelib: $(OBJ)\$(ENGINELIB) ;
@ -110,26 +111,26 @@ $(OBJ)\$(EDITORLIB): $(EDITOROBJS)
# the tools
kextract$(EXESUFFIX): $(OBJ)\kextract.$o $(OBJ)\compat.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib
kgroup$(EXESUFFIX): $(OBJ)\kgroup.$o $(OBJ)\compat.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib
transpal$(EXESUFFIX): $(OBJ)\transpal.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib
wad2map$(EXESUFFIX): $(OBJ)\wad2map.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib
wad2art$(EXESUFFIX): $(OBJ)\wad2art.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE $(flags_link) /MAP $** msvcrt.lib
$(LINK) /OUT:$@ /SUBSYSTEM:CONSOLE /LIBPATH:$(DXROOT)\lib /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib
# DEPENDENCIES
!include Makefile.deps
# PHONIES
clean:
-del $(ENGINEOBJS) $(EDITOROBJS)
-del $(ENGINEOBJS) $(EDITOROBJS) $(OBJ)\kextract.$o $(OBJ)\kgroup.$o $(OBJ)\transpal.$o $(OBJ)\wad2map.$o $(OBJ)\wad2art.$o
veryclean: clean
-del $(OBJ)\$(ENGINELIB) $(OBJ)\$(EDITORLIB) $(UTILS)
-del /Q $(OBJ)\$(ENGINELIB) $(OBJ)\$(EDITORLIB) $(UTILS) *.map *.manifest *.pdb

View file

@ -69,7 +69,7 @@ void initprintf(const char *, ...);
void debugprintf(const char *,...);
int handleevents(void);
inline void idle(void);
extern inline void idle(void);
typedef void (*KeyPressCallback)(long,long);
typedef void (*MousePressCallback)(long,long);

View file

@ -66,7 +66,7 @@
# define int64 __int64
# define uint64 unsigned __int64
# define longlong(x) x##i64
#elif defined(_MSC_VER)
#elif defined(_MSC_VER)
# define inline __inline
# define int64 __int64
# define uint64 unsigned __int64

View file

@ -1,3 +1,4 @@
#include "compat.h"
#include "glbuild.h"
#include "baselayer.h"
#include <stdlib.h>

View file

@ -42,6 +42,7 @@ static long GetTickCount(void)
#endif
#ifdef KSFORBUILD
# include "compat.h"
# include "baselayer.h"
# define printf initprintf
#endif

View file

@ -5,6 +5,7 @@
* See the included license file "BUILDLIC.TXT" for license info.
*/
#include "compat.h"
#include "scriptfile.h"
#include "baselayer.h"
#include "compat.h"

View file

@ -2,10 +2,10 @@
#error Only for Windows
#endif
#include "compat.h"
#include "build.h"
#include "editor.h"
#include "winlayer.h"
#include "compat.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

View file

@ -1,4 +1,4 @@
# EDuke32 Makefile for Watcom Make
# EDuke32 Makefile for Microsoft NMake
SRC=source
OBJ=obj
@ -13,16 +13,18 @@ EDITORLIB=build.lib
!ifdef DEBUG
# debugging options
flags_cl=/G6 /Ot /Z7
flags_cl= /Ot /Zi
flags_link=/DEBUG
!else
# release options
flags_cl=/G6Fy /Ox #/Ob1gity
flags_cl=/O2 /Ox #/Ob1gity
flags_link=/RELEASE
!endif
DXROOT=c:\sdks\msc\dx7
DXROOT=c:\sdks\dx6
MSSDKROOT="C:\Program Files\Microsoft Visual Studio 8\VC
PLATFORMSDK="C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
ENGINEOPTS=/DSUPERBUILD /DPOLYMOST /DUSE_OPENGL
@ -30,13 +32,13 @@ CC=cl
AS=ml
LINK=link /opt:nowin98 /nologo /opt:ref
CFLAGS= /MD /J /nologo $(flags_cl) \
/I$(INC) /I$(EINC)\ /I$(SRC)\jmact /I$(SRC)\jaudiolib /I..\jfaud\inc \
/DNOCOPYPROTECT $(ENGINEOPTS) \
/I$(INC) /I$(EINC)\ /I$(SRC)\jmact /I$(SRC)\jaudiolib /I..\jfaud\inc /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" \
/DNOCOPYPROTECT /D "_CRT_SECURE_NO_DEPRECATE" -W0 $(ENGINEOPTS) \
/I$(DXROOT)\include /DRENDERTYPEWIN=1
LIBS=user32.lib gdi32.lib shell32.lib dxguid.lib winmm.lib wsock32.lib comctl32.lib \
..\jfaud\jfaud.lib /NODEFAULTLIB:libFLAC.lib \
#opengl32.lib
ASFLAGS=/nologo /coff
/NODEFAULTLIB:libFLAC.lib glu32.lib
ASFLAGS=/nologo /coff
ASFLAGS=/nologo /coff
EXESUFFIX=.exe
@ -63,10 +65,10 @@ AUDIOLIB_FX=$(OBJ)\mv_mix.$o \
AUDIOLIB_MUSIC=$(OBJ)\midi.$o \
$(OBJ)\mpu401.$o \
$(OBJ)\music.$o
#AUDIOLIBOBJ=$(AUDIOLIB_MUSIC) $(AUDIOLIB_FX) $(OBJ)\sounds.$o
AUDIOLIBOBJ=$(AUDIOLIB_JFAUD)
AUDIOLIBOBJ=$(AUDIOLIB_MUSIC) $(AUDIOLIB_FX) $(OBJ)\sounds.$o
#AUDIOLIBOBJ=$(AUDIOLIB_JFAUD)
GAMEOBJS=$(OBJ)\game.$o \
GAMEOBJS=$(OBJ)\game.$o \
$(OBJ)\actors.$o \
$(OBJ)\anim.$o \
$(OBJ)\gamedef.$o \
@ -121,25 +123,28 @@ EDITOROBJS=$(OBJ)\astub.$o \
$(CC) /c $(CFLAGS) /Fo$@ $<
{$(SRC)\misc}.rc{$(OBJ)\}.res:
$(RC) /i$(EINC)\ /i$(SRC)\ /fo$@ /r $<
$(RC) /i$(EINC)\ /i$(SRC)\ /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" /fo$@ /r $<
# TARGETS
all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) ;
all: eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX);
eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)\$(ENGINELIB)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib $(flags_link) /MAP $** $(LIBS) msvcrt.lib
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib
mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)\$(ENGINELIB) $(EOBJ)\$(EDITORLIB)
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib $(flags_link) /MAP $** $(LIBS) msvcrt.lib
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib
duke3d_w32$(EXESUFFIX): $(OBJ)/wrapper.$o
$(LINK) /OUT:$@ /SUBSYSTEM:WINDOWS /LIBPATH:$(DXROOT)\lib /LIBPATH:$(PLATFORMSDK)\lib" /LIBPATH:$(MSSDKROOT)\lib" $(flags_link) /MAP $** $(LIBS) msvcrt.lib
!include Makefile.deps
enginelib editorlib: AlwaysBuild
-mkdir $(EOBJ)\
-mkdir $(EOBJ)
echo OBJ=$(MAKEDIR)\$(EOBJ)\ > $(EOBJ)\overrides.mak
echo CFLAGS=$(ENGINEOPTS) >> $(EOBJ)\overrides.mak
cd $(EROOT)\
cd $(EROOT)
nmake /f Makefile.msvc "OVERRIDES=$(MAKEDIR)\$(EOBJ)\overrides.mak" $@
cd $(MAKEDIR)
@ -149,7 +154,8 @@ $(EOBJ)\$(ENGINELIB): enginelib ;
# PHONIES
clean:
-del $(OBJ)\* eduke32$(EXESUFFIX) mapster32$(EXESUFFIX)
-del /Q $(OBJ)\* eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) duke3d_w32$(EXESUFFIX) \
*.pdb *.map *.manifest
veryclean: clean
-del $(EOBJ)\*
-del /Q $(EOBJ)\*

View file

@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <string.h>
#include "dsound.h"
#include "compat.h"
#include "winlayer.h"
#if defined(__WATCOMC__) || defined(_MSC_VER)

View file

@ -6,6 +6,7 @@
*
*/
#include "compat.h"
#include "types.h"
#include "keyboard.h"
#include "mouse.h"
@ -14,7 +15,6 @@
#include "util_lib.h"
#include "baselayer.h"
#include "compat.h"
#include "pragmas.h"

View file

@ -37,10 +37,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
#include <fcntl.h>
#include <errno.h>
#include "compat.h"
#include "types.h"
#include "file_lib.h"
#include "util_lib.h"
#include "compat.h"
#include "cache1d.h"
#ifndef O_BINARY

View file

@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//-------------------------------------------------------------------------
#include "compat.h"
#include "types.h"
#include "mouse.h"
#include "baselayer.h"

View file

@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//-------------------------------------------------------------------------
#include "compat.h"
#include "osdcmds.h"
#include "osd.h"
#include "baselayer.h"

View file

@ -26,6 +26,7 @@ Windows-specific hooks for JonoF's Duke3D port.
#ifdef RENDERTYPEWIN
#define WIN32_LEAN_AND_MEAN
#include "compat.h"
#include <windows.h>
#include <stdarg.h>
#include <stdlib.h>

Binary file not shown.