intravenous
diff Makefile @ 0:2b30f261f641
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 21 Apr 2012 06:56:33 +0300 |
parents | |
children | 2723dc026c4f |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Makefile Sat Apr 21 06:56:33 2012 +0300 1.3 @@ -0,0 +1,32 @@ 1.4 +csrc = $(wildcard src/*.c) 1.5 +ccsrc = $(wildcard src/*.cc) 1.6 +obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) 1.7 +dep = $(obj:.o=.d) 1.8 +bin = intrav 1.9 + 1.10 +CFLAGS = -pedantic -Wall -g -I/usr/local/include $(add_inc) 1.11 +CXXFLAGS = -std=c++0x $(CFLAGS) 1.12 +LDFLAGS = -L/usr/local/lib $(add_lib) $(libgl) $(libal) -lm -lvmath -limago 1.13 + 1.14 +ifeq ($(shell uname -s), Darwin) 1.15 + libgl = -framework OpenGL -framework GLUT -lGLEW 1.16 + add_inc += -I/opt/local/include 1.17 + add_lib += -L/opt/local/lib 1.18 +else 1.19 + libgl = -lGL -lGLU -lglut -lGLEW 1.20 +endif 1.21 + 1.22 +$(bin): $(obj) 1.23 + $(CXX) -o $@ $(obj) $(LDFLAGS) 1.24 + 1.25 +-include $(dep) 1.26 + 1.27 +%.d: %.c 1.28 + @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ 1.29 + 1.30 +%.d: %.cc 1.31 + @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ 1.32 + 1.33 +.PHONY: clean 1.34 +clean: 1.35 + rm -f $(obj) $(bin) $(dep)