graphene
diff Makefile @ 1:f85a59195206
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 24 Jul 2015 01:28:00 +0300 |
parents | |
children | fb032d88839f |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Makefile Fri Jul 24 01:28:00 2015 +0300 1.3 @@ -0,0 +1,62 @@ 1.4 +ccsrc = $(wildcard src/*.cc) \ 1.5 + $(wildcard gmath/*.cc) 1.6 +csrc = $(wildcard src/*.c) \ 1.7 + $(wildcard gmath/*.c) 1.8 +obj = $(ccsrc:.cc=.o) $(csrc:.c=.o) 1.9 +dep = $(obj:.o=.d) 1.10 + 1.11 +name = graphene3d 1.12 +somajor = 0 1.13 +sominor = 1 1.14 + 1.15 +sys = $(shell uname -s) 1.16 + 1.17 +ifeq ($(sys), Darwin) 1.18 + libgl = -framework OpenGL -lGLEW 1.19 + 1.20 + shared = -dynamiclib 1.21 + solib = lib$(name).dylib 1.22 +else 1.23 + libgl = -lGL -lGLU -lGLEW 1.24 + 1.25 + ldname = lib$(name).so 1.26 + soname = $(ldname).$(somajor) 1.27 + solib = $(soname).$(sominor) 1.28 + 1.29 + shared = -shared -Wl,-soname=$(soname) 1.30 + pic = -fPIC 1.31 +endif 1.32 + 1.33 +inc = -Ilib 1.34 +opt = 1.35 +dbg = -g 1.36 + 1.37 +CFLAGS = -pedantic -Wall $(opt) $(dbg) $(pic) $(inc) 1.38 +CXXFLAGS = $(CFLAGS) 1.39 +LDFLAGS = $(libgl) 1.40 + 1.41 +.PHONY: shared 1.42 +shared: $(solib) 1.43 + 1.44 +$(solib): $(obj) 1.45 + $(CXX) -o $@ $(shared) $(obj) $(LDFLAGS) 1.46 + [ -n "$(soname)" ] && \ 1.47 + rm -f $(soname) $(ldname) && \ 1.48 + ln -s $(solib) $(soname) && \ 1.49 + ln -s $(soname) $(ldname) || true 1.50 + 1.51 +-include $(dep) 1.52 + 1.53 +%.d: %.c 1.54 + @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ 1.55 + 1.56 +%.d: %.cc 1.57 + @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ 1.58 + 1.59 +.PHONY: clean 1.60 +clean: 1.61 + rm -f $(obj) $(solib) 1.62 + 1.63 +.PHONY: cleandep 1.64 +cleandep: 1.65 + rm -f $(dep)