istereo2

view Makefile @ 12:57188f7d9304

merged changes from macosx
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Sep 2015 06:53:31 +0300
parents 64e15874f3bd
children 018f997dc646
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 $(CXX) -o $@ $(obj) $(LDFLAGS)
27 -include $(dep)
29 %.d: %.c
30 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@
32 %.d: %.cc
33 @$(CPP) $(CXXFLAGS) -MM -MT $(@:.d=.o) $< >$@
35 .PHONY: clean
36 clean:
37 rm -f $(obj) $(bin)
39 .PHONY: cleandep
40 cleandep:
41 rm -f $(dep)