X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrtris;a=blobdiff_plain;f=Makefile;h=45e42141defa231f01391904731a1c0543992393;hp=94ecd85319ce180cb6daaa2c17d16e3a9a289121;hb=32d517e60844b73bc27ffb6ae67061d0429b7927;hpb=7e20f7693be642b006fa6c4d65f6da1b00b0621f diff --git a/Makefile b/Makefile index 94ecd85..45e4214 100644 --- a/Makefile +++ b/Makefile @@ -8,23 +8,26 @@ 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 +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 @@ -37,6 +40,9 @@ $(bin): $(obj) @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 @@ -45,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)