From a16a1a6cb3d831842f75e13653934360db617097 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Fri, 1 Sep 2017 03:07:35 +0300 Subject: [PATCH] makefile rules for cross-compiling with mingw-w64 --- Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 431e362..959c10f 100644 --- a/Makefile +++ b/Makefile @@ -17,13 +17,26 @@ CXXFLAGS = -std=c++11 $(warn) $(opt) $(dbg) $(incpath) LDFLAGS = $(libpath) $(libgl_$(sys)) -lm -lgmath -lvmath -limago -lresman \ -lpthread -lassimp -ltreestore -ldrawtext -loptcfg -lgoatvr `pkg-config --libs sdl2` -sys = $(shell uname -s) +sys = $(shell uname -s | sed 's/MINGW.*/mingw/') libgl_Linux = -lGL -lGLU -lGLEW libgl_Darwin = -framework OpenGL -lGLEW +libgl_mingw = -lopengl32 -lglu32 -lglew32 + +ifeq ($(sys), mingw) + bin = demo.exe +endif $(bin): .clang_complete $(obj) $(CXX) -o $@ $(obj) $(LDFLAGS) +.PHONY: cross +cross: + $(MAKE) CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ + +.PHONY: instalien +instalien: demo.exe + cp $< /alien/demo/$< + .clang_complete: Makefile rm -f $@ for i in $(CXXFLAGS); do echo $$i >>$@; done -- 1.7.10.4