istereo2

view Makefile @ 30:900651a2f401

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