1
0
Fork 0
mirror of https://github.com/galaxyhaxz/devilution synced 2024-11-25 00:53:44 +00:00
devilution/2020_03_31/Makefile

59 lines
1.6 KiB
Makefile
Raw Permalink Normal View History

2020-11-29 00:24:54 +00:00
# mingw32 and mingw64 have different executables
ifdef MINGW32
CC=mingw32-gcc
CXX=mingw32-g++
DLLTOOL=dlltool
WINDRES=windres
else
CC=i686-w64-mingw32-gcc
CXX=i686-w64-mingw32-g++
DLLTOOL=i686-w64-mingw32-dlltool
WINDRES=i686-w64-mingw32-windres
endif
# Clang doesn't understand permissive compilation, we need to "fix" invalid
# casts from a pointer type there using
# static_cast<NEW_TYPE>(reinterpret_cast<uintptr_t>(ptr))
# instead of
# (NEW_TYPE)(ptr)
CFLAGS=
CXXFLAGS=-fpermissive -Wno-write-strings
CPPFLAGS=-MMD -MF $*.d
LDLIBS=-lgdi32 -lversion -ldiabloui -lstorm
LDFLAGS=-L./ -static-libgcc -mwindows
all: devilution.exe
debug: CXXFLAGS += -D_DEBUG
debug: CPPFLAGS += -D_DEBUG
debug: devilution.exe
DIABLO_SRC=$(sort $(filter-out Source/_asm.cpp Source/_render.cpp, $(wildcard Source/*.cpp)))
OBJS=$(DIABLO_SRC:.cpp=.o)
PKWARE_SRC=$(wildcard 3rdParty/Pkware/Source/*.c)
PKWARE_OBJS=$(PKWARE_SRC:.c=.o)
devilution.exe: $(OBJS) $(PKWARE_OBJS) diabres.o diabloui.lib storm.lib
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
diabres.o: Diablo.rc
$(WINDRES) $< $@
diabloui.lib: diabloui.dll DiabloUI/diabloui_gcc.def
$(DLLTOOL) -d DiabloUI/diabloui_gcc.def -D $< -l $@
diabloui.dll:
# $(error Please copy diabloui.dll (version 1.09[b]) here)
storm.lib: storm.dll 3rdParty/Storm/Source/storm_gcc.def
$(DLLTOOL) -d 3rdParty/Storm/Source/storm_gcc.def -D $< -l $@
storm.dll:
# $(error Please copy storm.dll (version 1.09[b]) here)
clean:
@$(RM) -v $(OBJS) $(OBJS:.o=.d) $(PKWARE_OBJS) $(PKWARE_OBJS:.o=d) diabres.o storm.lib diabloui.lib devilution.exe
.PHONY: clean all