istereo2

annotate Makefile @ 35:643f4ab609a4

added readme and license
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 31 Oct 2015 05:45:35 +0200
parents 018f997dc646
children
rev   line source
nuclear@24 1 root = .
nuclear@9 2 src = $(wildcard src/*.c) $(wildcard src/glut/*.c)
nuclear@9 3 ccsrc = $(wildcard src/*.cc)
nuclear@9 4
nuclear@9 5 obj = $(src:.c=.o) $(ccsrc:.cc=.o)
nuclear@9 6 dep = $(obj:.o=.d)
nuclear@9 7 bin = test
nuclear@9 8
nuclear@9 9 incdir = -Isrc
nuclear@9 10 def = -DNO_FREETYPE
nuclear@9 11
nuclear@9 12 CFLAGS = -pedantic -Wall -g $(def) $(incdir)
nuclear@9 13 CXXFLAGS = $(CFLAGS)
nuclear@10 14 LDFLAGS = $(libgl) -lm -ldl
nuclear@9 15
nuclear@9 16 include libs/Makefile
nuclear@9 17
nuclear@10 18 sys := $(shell uname -s)
nuclear@10 19 ifeq ($(sys), Darwin)
nuclear@10 20 libgl = -framework OpenGL -framework GLUT -lGLEW
nuclear@10 21 else
nuclear@10 22 libgl = -lGL -lGLU -lglut -lGLEW
nuclear@10 23 endif
nuclear@10 24
nuclear@9 25 $(bin): $(obj)
nuclear@14 26 @echo "Linking $(bin) ..."
nuclear@14 27 @$(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@9 28
nuclear@9 29 -include $(dep)
nuclear@9 30
nuclear@9 31 %.d: %.c
nuclear@9 32 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
nuclear@9 33
nuclear@9 34 %.d: %.cc
nuclear@9 35 @$(CPP) $(CXXFLAGS) -MM -MT $(@:.d=.o) $< >$@
nuclear@9 36
nuclear@9 37 .PHONY: clean
nuclear@9 38 clean:
nuclear@9 39 rm -f $(obj) $(bin)
nuclear@9 40
nuclear@9 41 .PHONY: cleandep
nuclear@9 42 cleandep:
nuclear@9 43 rm -f $(dep)