Skip to content

Commit

Permalink
Converted workspace, projects, makefile to VC++6
Browse files Browse the repository at this point in the history
updated Makefile to compile with VC++ 6, link/generate the DLLs with link.exe 6, but link Diablo.exe with link 5.10
  • Loading branch information
seritools committed Jul 15, 2018
1 parent b53382a commit 6f5f573
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 35 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Generated by VC++ 6 builds
/vc60.idb

# ELF object file.
*.o

Expand Down
11 changes: 6 additions & 5 deletions 3rdParty/Storm/Source/Storm.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 33 additions & 5 deletions Diablo.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Diablo.dsw
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Microsoft Developer Studio Workspace File, Format Version 5.00
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!

###############################################################################

Project: "Diablo"=.\Diablo.dsp - Package Owner=<4>
Project: "Diablo"=".\Diablo.dsp" - Package Owner=<4>

Package=<5>
{{{
Expand All @@ -21,7 +21,7 @@ Package=<4>

###############################################################################

Project: "DiabloUI"=.\DiabloUI\DiabloUI.dsp - Package Owner=<4>
Project: "DiabloUI"=".\DiabloUI\DiabloUI.dsp" - Package Owner=<4>

Package=<5>
{{{
Expand All @@ -33,7 +33,7 @@ Package=<4>

###############################################################################

Project: "Storm"=.\3rdParty\Storm\Source\Storm.dsp - Package Owner=<4>
Project: "Storm"=".\3rdParty\Storm\Source\Storm.dsp" - Package Owner=<4>

Package=<5>
{{{
Expand Down
14 changes: 7 additions & 7 deletions DiabloUI/DiabloUI.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 24 additions & 14 deletions MakefileVC
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
VC_DIR ?= $(HOME)/DevStudio/VC
VC_BIN_DIR = $(VC_DIR)/bin
VC_INC_DIR = $(VC_DIR)/include
VC_LIB_DIR = $(VC_DIR)/lib
IDE_DIR ?= $(HOME)/DevStudio/SharedIDE
VC5_DIR ?= $(HOME)/DevTools/VC
VC6_DIR ?= $(HOME)/VS6/VC98

VC6_BIN_DIR = $(VC6_DIR)/Bin
VC6_INC_DIR = $(VC6_DIR)/Include
VC6_LIB_DIR = $(VC6_DIR)/Lib

VC5_LIB_DIR = $(VC5_DIR)/lib

IDE_DIR ?= $(HOME)/VS6/Common/MSDev98
IDE_BIN_DIR = $(IDE_DIR)/bin
ifeq ($(OS),Windows_NT)
CL = $(VC_BIN_DIR)/CL.EXE
CL = $(VC6_BIN_DIR)/CL.EXE
RC = $(IDE_BIN_DIR)/RC.EXE
VC5_LINK = $(VC5_DIR)/bin/link.exe
else
CL = wine $(VC_BIN_DIR)/CL.EXE
CL = wine $(VC6_BIN_DIR)/CL.EXE
RC = wine $(IDE_BIN_DIR)/RC.EXE
VC5_LINK = wine $(VC5_DIR)/bin/link.exe
endif

all: devilution.exe
CFLAGS=/nologo /c /GX /W3 /O1 /I $(VC6_INC_DIR) /FD /MT /D "NDEBUG" /D "WIN32" /D "_WINDOWS"
LINK5FLAGS=/nologo /subsystem:windows /machine:I386 /incremental:no /LIBPATH:$(VC5_LIB_DIR)

all: Diablo.exe

DIABLO_SRC=$(sort $(wildcard Source/*.cpp))
OBJS=$(DIABLO_SRC:.cpp=.obj)
Expand All @@ -26,20 +36,20 @@ STORM_OBJS=$(STORM_SRC:.cpp=.obj)
DIABLOUI_SRC=$(sort $(wildcard DiabloUI/*.cpp))
DIABLOUI_OBJS=$(DIABLOUI_SRC:.cpp=.obj)

devilution.exe: $(OBJS) $(PKWARE_OBJS) diablo.res DiabloUI/diabloui.lib 3rdParty/Storm/Source/storm.lib
$(CL) /nologo /Fe$@ $(OBJS) $(PKWARE_OBJS) diablo.res /link /LIBPATH:$(VC_LIB_DIR) advapi32.lib gdi32.lib shell32.lib user32.lib version.lib DiabloUI/diabloui.lib 3rdParty/Storm/Source/storm.lib
Diablo.exe: $(OBJS) $(PKWARE_OBJS) diablo.res DiabloUI/diabloui.lib 3rdParty/Storm/Source/storm.lib
$(VC5_LINK) /OUT:$@ $(LINK5FLAGS) $(OBJS) $(PKWARE_OBJS) diablo.res advapi32.lib gdi32.lib shell32.lib user32.lib version.lib DiabloUI/diabloui.lib 3rdParty/Storm/Source/storm.lib

DiabloUI/diabloui.lib: $(DIABLOUI_OBJS)
$(CL) $^ /link /nologo /dll /subsystem:windows /machine:I386 /LIBPATH:$(VC_LIB_DIR) /def:"DiabloUI/diabloui.def" /out:DiabloUI/diabloui.dll
$(CL) $^ /link /LINK50COMPAT /nologo /dll /subsystem:windows /machine:I386 /LIBPATH:$(VC6_LIB_DIR) /def:"DiabloUI/diabloui.def" /out:DiabloUI/diabloui.dll

3rdParty/Storm/Source/storm.lib: $(STORM_OBJS)
$(CL) $^ /link /nologo /dll /subsystem:windows /machine:I386 /LIBPATH:$(VC_LIB_DIR) /def:"3rdParty/Storm/Source/storm.def" /out:3rdParty/Storm/Source/storm.dll
$(CL) $^ /link /LINK50COMPAT /nologo /dll /subsystem:windows /machine:I386 /LIBPATH:$(VC6_LIB_DIR) /def:"3rdParty/Storm/Source/storm.def" /out:3rdParty/Storm/Source/storm.dll

%.obj: %.cpp
$(CL) /nologo /c /O1 /W3 /MT /I $(VC_INC_DIR) /Fo$@ $<
$(CL) $(CFLAGS) /Fo$@ $<

diablo.res: Diablo.rc
$(RC) /i $(VC_INC_DIR) /i $(VC_DIR)/mfc/include /l 0x409 /fo $@ $<
$(RC) /i $(VC6_INC_DIR) /i $(VC6_DIR)/MFC/Include /l 0x409 /fo $@ $<

clean:
@$(RM) -v $(OBJS) $(PKWARE_OBJS) $(STORM_OBJS) $(DIABLOUI_OBJS) DiabloUI/diabloui.{exp,lib,dll} 3rdParty/Storm/Source/storm.{exp,lib,dll}
Expand Down

0 comments on commit 6f5f573

Please sign in to comment.