istereo2
annotate 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 |
rev | line source |
---|---|
nuclear@9 | 1 src = $(wildcard src/*.c) $(wildcard src/glut/*.c) |
nuclear@9 | 2 ccsrc = $(wildcard src/*.cc) |
nuclear@9 | 3 |
nuclear@9 | 4 obj = $(src:.c=.o) $(ccsrc:.cc=.o) |
nuclear@9 | 5 dep = $(obj:.o=.d) |
nuclear@9 | 6 bin = test |
nuclear@9 | 7 |
nuclear@9 | 8 incdir = -Isrc |
nuclear@9 | 9 def = -DNO_FREETYPE |
nuclear@9 | 10 |
nuclear@9 | 11 CFLAGS = -pedantic -Wall -g $(def) $(incdir) |
nuclear@9 | 12 CXXFLAGS = $(CFLAGS) |
nuclear@10 | 13 LDFLAGS = $(libgl) -lm -ldl |
nuclear@9 | 14 |
nuclear@9 | 15 include libs/Makefile |
nuclear@9 | 16 |
nuclear@10 | 17 sys := $(shell uname -s) |
nuclear@10 | 18 ifeq ($(sys), Darwin) |
nuclear@10 | 19 libgl = -framework OpenGL -framework GLUT -lGLEW |
nuclear@10 | 20 else |
nuclear@10 | 21 libgl = -lGL -lGLU -lglut -lGLEW |
nuclear@10 | 22 endif |
nuclear@10 | 23 |
nuclear@9 | 24 $(bin): $(obj) |
nuclear@9 | 25 $(CXX) -o $@ $(obj) $(LDFLAGS) |
nuclear@9 | 26 |
nuclear@9 | 27 -include $(dep) |
nuclear@9 | 28 |
nuclear@9 | 29 %.d: %.c |
nuclear@9 | 30 @$(CPP) $(CFLAGS) -MM -MT $(@:.d=.o) $< >$@ |
nuclear@9 | 31 |
nuclear@9 | 32 %.d: %.cc |
nuclear@9 | 33 @$(CPP) $(CXXFLAGS) -MM -MT $(@:.d=.o) $< >$@ |
nuclear@9 | 34 |
nuclear@9 | 35 .PHONY: clean |
nuclear@9 | 36 clean: |
nuclear@9 | 37 rm -f $(obj) $(bin) |
nuclear@9 | 38 |
nuclear@9 | 39 .PHONY: cleandep |
nuclear@9 | 40 cleandep: |
nuclear@9 | 41 rm -f $(dep) |