conworlds
annotate Makefile @ 5:8b7da5ab814e
vr wrapper in progress
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 20 Aug 2014 16:34:43 +0300 |
parents | cd7755e4663a |
children | 3c36bc28c6c2 |
rev | line source |
---|---|
nuclear@4 | 1 csrc = $(wildcard src/*.c) $(wildcard src/vr/*.c) |
nuclear@1 | 2 ccsrc = $(wildcard src/*.cc) |
nuclear@1 | 3 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) |
nuclear@1 | 4 dep = $(obj:.o=.d) |
nuclear@1 | 5 bin = vrchess |
nuclear@1 | 6 |
nuclear@1 | 7 CFLAGS = -pedantic -Wall -g |
nuclear@1 | 8 CXXFLAGS = -std=c++11 $(CFLAGS) |
nuclear@1 | 9 LDFLAGS = $(libgl_$(sys)) -lm -lvmath -limago |
nuclear@1 | 10 |
nuclear@1 | 11 libgl_unix = -lGL -lGLU -lglut -lGLEW |
nuclear@1 | 12 libgl_mac = -framework OpenGL -framework GLUT -lGLEW |
nuclear@1 | 13 libgl_win = -lopengl32 -lglu32 -lglut32 -lglew32 |
nuclear@1 | 14 |
nuclear@1 | 15 $(bin): $(obj) |
nuclear@1 | 16 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@1 | 17 |
nuclear@1 | 18 -include $(dep) |
nuclear@1 | 19 |
nuclear@1 | 20 %.d: %.c |
nuclear@1 | 21 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@1 | 22 |
nuclear@1 | 23 %.d: %.cc |
nuclear@1 | 24 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ |
nuclear@1 | 25 |
nuclear@1 | 26 .PHONY: clean |
nuclear@1 | 27 clean: |
nuclear@1 | 28 rm -f $(obj) $(bin) |
nuclear@1 | 29 |
nuclear@1 | 30 # os detection |
nuclear@1 | 31 uname = $(shell uname -s) |
nuclear@1 | 32 ifeq ($(sys), Darwin) |
nuclear@1 | 33 sys = mac |
nuclear@1 | 34 else ifeq ($(findstring MINGW, $(sys)), MINGW) |
nuclear@1 | 35 sys = win |
nuclear@1 | 36 else |
nuclear@1 | 37 sys = unix |
nuclear@1 | 38 endif |