mesh loading
[vrtris] / Makefile
index 3b1335d..94ecd85 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,11 @@ dep = $(obj:.o=.d)
 bin = vrtris
 
 
-CFLAGS = -pedantic -Wall -g `pkg-config --cflags sdl2`
+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`
 LDFLAGS = $(libsys) $(libgl) `pkg-config --libs sdl2` -ldrawtext -lgoatvr \
                  -limago -lm
 
@@ -29,6 +33,10 @@ $(bin): $(obj)
 
 -include $(dep)
 
+%.d: %.c
+       @echo depfile $@
+       @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
+
 .PHONY: cross
 cross:
        $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw