-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.mac
109 lines (93 loc) · 2.22 KB
/
Makefile.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
CC := gcc
CXX := g++
# # uncomment to disable OpenGL functionality
# NO_OPENGL := true
CXXFLAGS := -Idependencies/include -I/opt/local/include -Wno-deprecated-declarations
ifdef NO_OPENGL
CXXFLAGS := $(CXXFLAGS) -DNO_OPENGL
endif
CXXFLAGS_DEBUG := -Wall -g -Wno-sign-compare
CXXFLAGS_RELEASE := -Wall -O3 -Wreturn-type -fopenmp
LDFLAGS := -Ldependencies/lib -L/opt/local/lib -llapacke -lpng -lz -ltaucs -llapack -lblas -lboost_filesystem -lboost_system -ljson -lgomp -lalglib
ifndef NO_OPENGL
LDFLAGS := $(LDFLAGS) -lglut -framework OpenGL
endif
OBJ := \
auglag.o \
breaking.o \
bvh.o \
cloth.o \
collision.o \
collisionutil.o \
conf.o \
constraint.o \
dde.o \
display.o \
displayphysics.o \
displayreplay.o \
displaytesting.o \
dynamicremesh.o \
geometry.o \
handle.o \
io.o \
lbfgs.o \
localopt.o \
lsnewton.o \
magic.o \
main.o \
mesh.o \
misc.o \
morph.o \
mot_parser.o \
nearobs.o \
nlcg.o \
obstacle.o \
physics.o \
popfilter.o \
plasticity.o \
proximity.o \
proxy.o \
referenceshape.o \
remesh.o \
runphysics.o \
separate.o \
separateobs.o \
sepstrength.o \
simulation.o \
spline.o \
subset.o \
strainlimiting.o \
taucs.o \
tensormax.o \
timer.o \
transformation.o \
trustregion.o \
util.o \
vectors.o
.PHONY: all debug release tags clean
release:
all: debug release ctags
debug: bin/arcsimd ctags
release: bin/arcsim ctags
bin/arcsimd: $(addprefix build/debug/,$(OBJ))
$(CXX) $^ -o $@ $(LDFLAGS) $(LDLIBS)
bin/arcsim: $(addprefix build/release/,$(OBJ))
$(CXX) $^ -o $@ $(LDFLAGS) $(LDLIBS)
build/debug/%.o: src/%.cpp
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXFLAGS_DEBUG) $< -o $@
build/release/%.o: src/%.cpp
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXFLAGS_RELEASE) $< -o $@
# Nicked from http://www.gnu.org/software/make/manual/make.html#Automatic-Prerequisites
build/dep/%.d: src/%.cpp
@set -e; rm -f $@; \
$(CXX) -MM $(CXXFLAGS) $< -o $@.tmp; \
sed 's,\($*\)\.o[ :]*,build/debug/\1.o build/release/\1.o: ,g' < $@.tmp > $@; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $@.tmp >> $@; \
rm -f $@.tmp
-include $(addprefix build/dep/,$(OBJ:.o=.d))
ctags:
cd src; ctags -w *.?pp
cd src; etags *.?pp
clean:
rm -rf bin/* build/debug/* build/release/*