symmetry

annotate Makefile @ 0:a90a71a74f0b

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 25 Feb 2014 19:53:34 +0200
parents
children 46fe847bba08
rev   line source
nuclear@0 1 src = $(wildcard src/*.cc) $(wildcard src/vr/*.cc)
nuclear@0 2 csrc = $(wildcard src/*.c) $(wildcard src/vr/*.c)
nuclear@0 3 obj = $(src:.cc=.o) $(csrc:.c=.o)
nuclear@0 4 dep = $(obj:.o=.d)
nuclear@0 5 bin = symmetry
nuclear@0 6
nuclear@0 7 CFLAGS = -pedantic -Wall -g -Isrc
nuclear@0 8 CXXFLAGS = $(CFLAGS)
nuclear@0 9 LDFLAGS = $(libgl) $(libovr) -lvmath -limago -lm
nuclear@0 10
nuclear@0 11 ifeq ($(shell uname -s), Darwin)
nuclear@0 12 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@0 13 else
nuclear@0 14 libgl = -lX11 -lGL -lGLU -lglut -lGLEW
nuclear@0 15 libovr = -lXinerama -lovr -lpthread -ludev
nuclear@0 16 endif
nuclear@0 17
nuclear@0 18 $(bin): $(obj)
nuclear@0 19 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@0 20
nuclear@0 21 -include $(dep)
nuclear@0 22
nuclear@0 23 %.d: %.c
nuclear@0 24 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 25
nuclear@0 26 %.d: %.cc
nuclear@0 27 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 28
nuclear@0 29 .PHONY: clean
nuclear@0 30 clean:
nuclear@0 31 rm -f $(obj) $(bin) $(dep)