env file for cross-compiling and accompanying makefile improvements
authorJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 23 Jan 2018 11:24:03 +0000 (13:24 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 23 Jan 2018 11:24:03 +0000 (13:24 +0200)
Makefile
setup_cross_env [new file with mode: 0644]

index b7e244b..2c38091 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ LDFLAGS = $(libpath) -ldrawtext $(libgl_$(sys)) $(libal_$(sys)) -lm -lgmath -lvm
                  -limago -lresman -lpthread -lassimp -ltreestore -lgoatvr \
                  `pkg-config --libs sdl2 freetype2` -lpng -ljpeg -lz -lvorbisfile -lgomp
 
-sys = $(shell uname -s | sed 's/MINGW.*/mingw/')
+sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/')
 libgl_Linux = -lGL -lGLU -lGLEW
 libgl_Darwin = -framework OpenGL -lGLEW
 libgl_mingw = -lopengl32 -lglu32 -lglew32
diff --git a/setup_cross_env b/setup_cross_env
new file mode 100644 (file)
index 0000000..b16d810
--- /dev/null
@@ -0,0 +1,4 @@
+# source this
+export sys=mingw
+export CC=i686-w64-mingw32-gcc
+export CXX=i686-w64-mingw32-g++