1
0
Fork 0
pull/50/merge
galaxyhaxz 2018-06-22 13:49:21 +00:00 committed by GitHub
commit 6e0db789b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 123 deletions

View File

@ -1,4 +0,0 @@
PKWARE_OBJS=3rdParty/PKWare/explode.o \
3rdParty/PKWare/implode.o
-include *.d

View File

@ -1,46 +1,49 @@
# For 32-bit build systems, the executable is just mingw32 # mingw32 and mingw64 have different executables
MINGW32 ?= i686-w64-mingw32 ifdef MINGW32
# Used s.t. we can try to use clang to compile code CXX=mingw32-g++
_CXX ?= g++ DLLTOOL=dlltool
else
CXX=$(MINGW32)-$(_CXX) CXX=i686-w64-mingw32-g++
ifeq ($(MINGW32), "mingw32") DLLTOOL=i686-w64-mingw32-dlltool
DLLTOOL=dlltool endif
else
DLLTOOL=$(MINGW32)-dlltool # Clang doesn't understand permissive compilation, we need to "fix" invalid
endif # casts from a pointer type there using
# static_cast<NEW_TYPE>(reinterpret_cast<uintptr_t>(ptr))
# Clang doesn't understand permissive compilation, we need to "fix" invalid # instead of
# casts from a pointer type there using # (NEW_TYPE)(ptr)
# static_cast<NEW_TYPE>(reinterpret_cast<uintptr_t>(ptr)) CXXFLAGS=-fpermissive -Wno-write-strings
# instead of CPPFLAGS=-MMD -MF $*.d
# (NEW_TYPE)(ptr) LDLIBS=-lgdi32 -lversion -ldiabloui -lstorm
CXXFLAGS=-std=c++98 -fpermissive -Wno-write-strings LDFLAGS=-L./ -static-libgcc -mwindows
CPPFLAGS=-MMD -MF $*.d
LDLIBS=-lgdi32 -lversion -ldiabloui -lstorm all: devilution.exe
LDFLAGS=-L./
DIABLO_SRC=$(wildcard Source/*.cpp)
all: devilution.exe OBJS=$(DIABLO_SRC:.cpp=.o)
include 3rdParty/PKWare/objs.mak PKWARE_SRC=$(wildcard 3rdParty/PKWare/*.cpp)
include Source/objs.mak PKWARE_OBJS=$(PKWARE_SRC:.cpp=.o)
devilution.exe: $(OBJS) $(PKWARE_OBJS) diabloui.lib storm.lib devilution.exe: $(OBJS) $(PKWARE_OBJS) diabres.o diabloui.lib storm.lib
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
diabloui.lib: diabloui.dll DiabloUI/diabloui_gcc.def diabres.o: Diablo.rc
$(DLLTOOL) -d DiabloUI/diabloui_gcc.def -D $< -l $@ windres $< $@
diabloui.dll: diabloui.lib: diabloui.dll DiabloUI/diabloui_gcc.def
$(error Please copy diabloui.dll (version 1.09b) here) $(DLLTOOL) -d DiabloUI/diabloui_gcc.def -D $< -l $@
storm.lib: storm.dll 3rdParty/Storm/Source/storm_gcc.def diabloui.dll:
$(DLLTOOL) -d 3rdParty/Storm/Source/storm_gcc.def -D $< -l $@ # $(error Please copy diabloui.dll (version 1.09[b]) here)
storm.dll: storm.lib: storm.dll 3rdParty/Storm/Source/storm_gcc.def
$(error Please copy storm.dll (version 1.09b) here) $(DLLTOOL) -d 3rdParty/Storm/Source/storm_gcc.def -D $< -l $@
clean: storm.dll:
@$(RM) -v $(OBJS) $(OBJS:.o=.d) $(PKWARE_OBJS) $(PKWARE_OBJS:.o=d) storm.lib diabloui.lib # $(error Please copy storm.dll (version 1.09[b]) here)
.PHONY: clean all clean:
@$(RM) -v $(OBJS) $(OBJS:.o=.d) $(PKWARE_OBJS) $(PKWARE_OBJS:.o=d) diabres.o storm.lib diabloui.lib
.PHONY: clean all

View File

@ -29,8 +29,8 @@ Building with Visual C++ 5.10
- Open the project workspace `Diablo.dsw` and select `Build Diablo.exe`. This will build all dependencies and only takes a few seconds. - Open the project workspace `Diablo.dsw` and select `Build Diablo.exe`. This will build all dependencies and only takes a few seconds.
Building with MinGW(32/64) Building with MinGW(32/64)
- Ensure that the MinGW binary paths have been added to the command line. - Ensure that the MinGW binary paths have been added to the command line. On Windows, you would usually type: `set PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin`
- For MinGW32, navigate to the project root and execute `make MINGW32=mingw32`. The process will take longer than Visual Studio. - For MinGW32, navigate to the project root and execute `make MINGW32=1`. The process will take longer than Visual Studio.
- For MinGW64, refer to the respective documentation: [Linux](Support/INSTALL_linux.md) | [Windows](Support/INSTALL_windows.md) | [Mac](Support/INSTALL_mac.md). Note that only x86 systems may be targeted for the time being. - For MinGW64, refer to the respective documentation: [Linux](Support/INSTALL_linux.md) | [Windows](Support/INSTALL_windows.md) | [Mac](Support/INSTALL_mac.md). Note that only x86 systems may be targeted for the time being.
Compiling Definitions Compiling Definitions

View File

@ -1,70 +0,0 @@
OBJS=Source/path.o \
Source/monster.o \
Source/engine.o \
Source/world.o \
Source/help.o \
Source/interfac.o \
Source/effects.o \
Source/towners.o \
Source/gendung.o \
Source/sound.o \
Source/sha.o \
Source/dead.o \
Source/multi.o \
Source/items.o \
Source/drlg_l2.o \
Source/codec.o \
Source/pfile.o \
Source/drlg_l4.o \
Source/gamemenu.o \
Source/appfat.o \
Source/error.o \
Source/restrict.o \
Source/player.o \
Source/capture.o \
Source/mpqapi.o \
Source/nthread.o \
Source/setmaps.o \
Source/trigs.o \
Source/diablo.o \
Source/dx.o \
Source/portal.o \
Source/msgcmd.o \
Source/plrmsg.o \
Source/themes.o \
Source/control.o \
Source/doom.o \
Source/init.o \
Source/cursor.o \
Source/debug.o \
Source/pack.o \
Source/stores.o \
Source/msg.o \
Source/loadsave.o \
Source/objects.o \
Source/palette.o \
Source/quests.o \
Source/wave.o \
Source/tmsg.o \
Source/minitext.o \
Source/scrollrt.o \
Source/sync.o \
Source/missiles.o \
Source/gmenu.o \
Source/town.o \
Source/dthread.o \
Source/logging.o \
Source/textdat.o \
Source/lighting.o \
Source/automap.o \
Source/inv.o \
Source/drlg_l1.o \
Source/spells.o \
Source/encrypt.o \
Source/fault.o \
Source/track.o \
Source/movie.o \
Source/drlg_l3.o \
Source/mainmenu.o
-include *.d

View File

@ -15,6 +15,12 @@
#include <process.h> #include <process.h>
#include <shlobj.h> #include <shlobj.h>
#ifdef __GNUC__
#include <ctype.h>
#endif
// tell Visual C++ to shut the hell up
#ifdef _MSC_VER
#pragma warning (disable : 4309) // truncation of constant value #pragma warning (disable : 4309) // truncation of constant value
#pragma warning (disable : 4305) // truncation of int #pragma warning (disable : 4305) // truncation of int
#pragma warning (disable : 4018) // signed/unsigned mismatch #pragma warning (disable : 4018) // signed/unsigned mismatch
@ -24,6 +30,7 @@
#pragma warning (disable : 4244) // conversion loss #pragma warning (disable : 4244) // conversion loss
#pragma warning (disable : 4800) // bool perf #pragma warning (disable : 4800) // bool perf
#pragma warning (disable : 4146) // negative unsigned #pragma warning (disable : 4146) // negative unsigned
#endif
#include "enums.h" #include "enums.h"
#include "structs.h" #include "structs.h"
@ -38,7 +45,7 @@
// If defined, use copy protection [Default -> Defined] // If defined, use copy protection [Default -> Defined]
//#define COPYPROT //#define COPYPROT
// If defined, don't reload for debuggers [Default -> Undefined] // If defined, don't reload for debuggers [Default -> Undefined]
#define DEBUGGER //#define DEBUGGER
// If defined, don't fry the CPU [Default -> Undefined] // If defined, don't fry the CPU [Default -> Undefined]
#define SLEEP #define SLEEP