X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=Makefile;h=45e42141defa231f01391904731a1c0543992393;hb=32d517e60844b73bc27ffb6ae67061d0429b7927;hp=a773a6e7ea5475195dba7f60fdcc5f373fbd8633;hpb=2077648d589ede39a1e47d331ba4a8b57dc25970;p=vrtris diff --git a/Makefile b/Makefile index a773a6e..45e4214 100644 --- a/Makefile +++ b/Makefile @@ -4,22 +4,30 @@ dep = $(obj:.o=.d) bin = vrtris -CFLAGS = -pedantic -Wall -g `pkg-config --cflags sdl2` -LDFLAGS = $(libsys) $(libgl) `pkg-config --libs sdl2` -ldrawtext +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` +LDFLAGS = $(libsys) -ldrawtext $(libgl) `pkg-config --libs sdl2 freetype2` \ + -lgoatvr -limago -lpng -lz -ljpeg -lpthread -lm sys ?= $(shell uname -s | sed 's/MINGW.*/mingw/') ifeq ($(sys), mingw) + obj = $(src:.c=.w32.o) + dep = $(obj:.o=.d) + bin = vrtris.exe - libgl = -lopengl32 -lglew32 - libsys = -lmingw32 -lwinmm -mwindows + libgl = -lopengl32 -lglu32 -lglew32 + libsys = -lmingw32 -lSDL2main -lwinmm -mwindows else ifeq ($(sys), Darwin) libgl = -framework OpenGL -lGLEW else - libgl = -lGL -lGLEW + libgl = -lGL -lGLU -lGLEW endif @@ -28,6 +36,13 @@ $(bin): $(obj) -include $(dep) +%.d: %.c + @echo depfile $@ + @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ + +%.w32.o: %.c + $(CC) -o $@ $(CFLAGS) -c $< + .PHONY: cross cross: $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw @@ -36,6 +51,11 @@ cross: cross-clean: $(MAKE) CC=i686-w64-mingw32-gcc sys=mingw clean +.PHONY: instalien +instalien: vrtris.exe + cp $< /alien/vrtris/$< + for i in `tools/dlldepends | grep -v '++'`; do echo $$i; rsync $$i /alien/vrtris; done + .PHONY: clean clean: rm -f $(obj) $(bin)