1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-15 17:54:48 +00:00
hyperrogue/Makefile.mgw
Arthur O'Dwyer db3e5d1009 Minor fixes for Mac and MinGW.
Eliminate a format-string warning by using less template magic:
https://stackoverflow.com/questions/12573968/how-to-use-gccs-printf-format-attribute-with-c11-variadic-templates

Fix one `%Ld` in `rogueviz.cpp` that should have been `%lld`.

Rename `savepng.c` into `savepng.cpp` so that we don't have to care about
the system's C compiler; it builds fine using the same C++ options as
HyperRogue itself.

Figure out how to get `-DCAP_PNG` and `-DCAP_ROGUEVIZ` working on Mac,
and document them.
Assume that roughly the same things should also work on MinGW.

Consistency on `STDSIZE`, even though it doesn't suffice for C++17 conformance.
It *almost* suffices; the one place where Clang still complains even with
`-std=c++17 -DSTDSIZE -Wno-sign-compare` is here:

    ./fieldpattern.cpp:757:51: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'int' in initializer list
          [-Wc++11-narrowing]
          ex.primes.emplace_back(primeinfo{nextprime, size(fp.matrices) / S7, (bool) fp.wsquare});
                                                      ^~~~~~~~~~~~~~~~~~~~~~

So, we fix that up too, in this patch.
2018-06-16 23:20:50 -07:00

50 lines
1.2 KiB
Makefile

# This Makefile works for MSYS2 and MinGW-w64.
#
# You might need to run commands such as "pacman -S mingw-w64-x86_64-SDL"
# to install SDL and other required libraries.
#
# Run "make -f Makefile.mgw" to build HyperRogue as ./hyper.exe.
CXXFLAGS += -std=c++11 -mwindows -DWINDOWS
CXXFLAGS += -D_A_VOLID=8
CXXFLAGS += ${EXTRA_CXXFLAGS}
OBJS = hyper.obj
ifeq (a,b)
# Enable PNG screenshots. Requires libpng.
CXXFLAGS += -DCAP_PNG
LDFLAGS += -lpng
OBJS += savepng.obj
else
CXXFLAGS += -DCAP_PNG=0
endif
ifeq (a,b)
# Enable RogueViz.
CXXFLAGS += -DCAP_ROGUEVIZ
endif
hyper.exe: $(OBJS) hyper.res
$(CXX) $(CXXFLAGS) $(OBJS) hyper.res -lSDL -lSDL_mixer -lopengl32 -lSDL_ttf -lSDL_gfx -lglew32 -o hyper.exe
hyper.obj: *.cpp language-data.cpp hyper.res
$(CXX) $(CXXFLAGS) -O2 -c hyper.cpp -o hyper.obj
hyper.res: hyper.rc hr-icon.ico
windres hyper.rc -O coff -o hyper.res
langen.exe: langen.cpp language-??.cpp language-ptbr.cpp
$(CXX) $(CXXFLAGS) -O0 -Wno-embedded-directive langen.cpp -o langen
language-data.cpp: langen.exe
./langen.exe > language-data.cpp
savepng.obj: savepng.cpp
$(CXX) $(CXXFLAGS) -O2 -c savepng.cpp -o savepng.obj
.PHONY: clean
clean:
rm -f hyper.exe hyper.obj hyper.res langen.exe language-data.cpp savepng.obj