X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=Makefile;h=45e42141defa231f01391904731a1c0543992393;hb=ce8a093ece30d3ab608a52b0247ad7a195cc0cc8;hp=3b1335dbc42d2dac1ca00ecc3fba45567a6ba568;hpb=49fdb2457dbb7705501264d519e840dd3ca60919;p=vrtris diff --git a/Makefile b/Makefile index 3b1335d..45e4214 100644 --- a/Makefile +++ b/Makefile @@ -4,23 +4,30 @@ dep = $(obj:.o=.d) bin = vrtris -CFLAGS = -pedantic -Wall -g `pkg-config --cflags sdl2` -LDFLAGS = $(libsys) $(libgl) `pkg-config --libs sdl2` -ldrawtext -lgoatvr \ - -limago -lm +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 @@ -29,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 @@ -37,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)