istereo2
view Makefile @ 22:c6971ff4795e
screenshot helper code
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 02 Oct 2015 07:10:19 +0300 |
parents | 2a0ef5efb8e2 |
children | 9d53a4938ce8 |
line source
1 src = $(wildcard src/*.c) $(wildcard src/glut/*.c)
2 ccsrc = $(wildcard src/*.cc)
4 obj = $(src:.c=.o) $(ccsrc:.cc=.o)
5 dep = $(obj:.o=.d)
6 bin = test
8 incdir = -Isrc
9 def = -DNO_FREETYPE
11 CFLAGS = -pedantic -Wall -g $(def) $(incdir)
12 CXXFLAGS = $(CFLAGS)
13 LDFLAGS = $(libgl) -lm -ldl
15 include libs/Makefile
17 sys := $(shell uname -s)
18 ifeq ($(sys), Darwin)
19 libgl = -framework OpenGL -framework GLUT -lGLEW
20 else
21 libgl = -lGL -lGLU -lglut -lGLEW
22 endif
24 $(bin): $(obj)
25 @echo "Linking $(bin) ..."
26 @$(CXX) -o $@ $(obj) $(LDFLAGS)
28 -include $(dep)
30 %.d: %.c
31 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
33 %.d: %.cc
34 @$(CPP) $(CXXFLAGS) -MM -MT $(@:.d=.o) $< >$@
36 .PHONY: clean
37 clean:
38 rm -f $(obj) $(bin)
40 .PHONY: cleandep
41 cleandep:
42 rm -f $(dep)