vrmodel
annotate Makefile @ 2:be91b72ce3f9
foobar
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 30 Aug 2014 21:46:37 +0300 |
parents | 76e75cbcb758 |
children | a32b151fb3c6 |
rev | line source |
---|---|
nuclear@1 | 1 src = $(wildcard src/*.cc) |
nuclear@1 | 2 obj = $(src:.cc=.o) |
nuclear@1 | 3 dep = $(obj:.o=.d) |
nuclear@1 | 4 bin = vrmodel |
nuclear@1 | 5 |
nuclear@2 | 6 inc = -Iinclude |
nuclear@2 | 7 |
nuclear@2 | 8 CFLAGS = -pedantic -Wall -g $(inc) `pkg-config --cflags sdl2` |
nuclear@2 | 9 CXXFLAGS = $(CFLAGS) |
nuclear@1 | 10 LDFLAGS = $(libgl) `pkg-config --libs sdl2` |
nuclear@1 | 11 |
nuclear@1 | 12 ifeq ($(shell uname -s), Darwin) |
nuclear@1 | 13 libgl = -framework OpenGL -lGLEW |
nuclear@1 | 14 else |
nuclear@1 | 15 libgl = -lGL -lGLU -lGLEW |
nuclear@1 | 16 endif |
nuclear@1 | 17 |
nuclear@1 | 18 $(bin): $(obj) |
nuclear@2 | 19 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@1 | 20 |
nuclear@1 | 21 -include $(dep) |
nuclear@1 | 22 |
nuclear@2 | 23 %.d: %.c |
nuclear@2 | 24 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@2 | 25 |
nuclear@1 | 26 %.d: %.cc |
nuclear@2 | 27 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@1 | 28 |
nuclear@1 | 29 .PHONY: clean |
nuclear@1 | 30 clean: |
nuclear@1 | 31 rm -f $(obj) $(bin) |