vrmodel

diff Makefile @ 1:76e75cbcb758

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 29 Aug 2014 23:07:59 +0300
parents
children be91b72ce3f9
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Fri Aug 29 23:07:59 2014 +0300
     1.3 @@ -0,0 +1,25 @@
     1.4 +src = $(wildcard src/*.cc)
     1.5 +obj = $(src:.cc=.o)
     1.6 +dep = $(obj:.o=.d)
     1.7 +bin = vrmodel
     1.8 +
     1.9 +CFLAGS = -pedantic -Wall -g `pkg-config --cflags sdl2`
    1.10 +LDFLAGS = $(libgl) `pkg-config --libs sdl2`
    1.11 +
    1.12 +ifeq ($(shell uname -s), Darwin)
    1.13 +	libgl = -framework OpenGL -lGLEW
    1.14 +else
    1.15 +	libgl = -lGL -lGLU -lGLEW
    1.16 +endif
    1.17 +
    1.18 +$(bin): $(obj)
    1.19 +	$(CC) -o $@ $(obj) $(LDFLAGS)
    1.20 +
    1.21 +-include $(dep)
    1.22 +
    1.23 +%.d: %.cc
    1.24 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.25 +
    1.26 +.PHONY: clean
    1.27 +clean:
    1.28 +	rm -f $(obj) $(bin)