ok now it works nicely in VR
[vrtris] / Makefile
index 45e4214..6f8257b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,26 @@
+# options -------------------------------------------------
+vrbuild = true
+# ---------------------------------------------------------
+
 src = $(wildcard src/*.c)
 obj = $(src:.c=.o)
 dep = $(obj:.o=.d)
-bin = vrtris
 
+ifeq ($(vrbuild), true)
+       bin = vrtris
+       vr_ldflags = -lgoatvr
+       vr_cflags = -DBUILD_VR
+else
+       bin = gltris
+endif
 
 warn = -pedantic -Wall -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
 dbg = -g
 opt = -O0
 
-CFLAGS = $(warn) $(dbg) $(opt) `pkg-config --cflags sdl2 freetype2`
+CFLAGS = $(warn) $(dbg) $(opt) `pkg-config --cflags sdl2 freetype2` $(vr_cflags)
 LDFLAGS = $(libsys) -ldrawtext $(libgl) `pkg-config --libs sdl2 freetype2` \
-                 -lgoatvr -limago -lpng -lz -ljpeg -lpthread -lm
+                 $(vr_ldflags) -limago -lpng -lz -ljpeg -lpthread -lm
 
 sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/')
 
@@ -21,7 +31,7 @@ ifeq ($(sys), mingw)
        bin = vrtris.exe
 
        libgl = -lopengl32 -lglu32 -lglew32
-       libsys = -lmingw32 -lSDL2main -lwinmm -mwindows
+       libsys = -lmingw32 -lSDL2main -lwinmm -mconsole
 
 else ifeq ($(sys), Darwin)
        libgl = -framework OpenGL -lGLEW