-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
57 lines (48 loc) · 2.06 KB
/
Makefile
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
CC = g++
CCFLAGS = -g -Wall -c -pedantic -O11 -DNO_EXCEPTIONS
LIBS = -L /usr/X11/lib -L /usr/local/lib
INCLUDES = -I /usr/local/include -I.
LDFLAGS =
MYOBJECTS = psalm.o v3ctor.o mesh.o face.o vertex.o edge.o directed_edge.o
LIBOBJECTS = libpsalm.o v3ctor.o mesh.o face.o vertex.o edge.o directed_edge.o hole.o
BIN = psalm
# Path to "meshlabserver" binary, which is used for creating test data.
MLS = /home/bastian/tmp/meshlab-snapshot-svn3524/meshlab/src/meshlabserver/meshlabserver
$(BIN): $(MYOBJECTS) Makefile
$(CC) $(MYOBJECTS) $(LIBS) $(LDFLAGS) -o $(BIN)
.cpp.o:
$(CC) $(INCLUDES) $(CCFLAGS) $<
# Create libpsalm
libpsalm:
@mkdir build; cd build; cmake ../.; make psalm; cp libpsalm.a ../
# Test for libpsalm
libpsalm_test: libpsalm_test.o Makefile
$(CC) libpsalm_test.o -L. -lpsalm -o libpsalm_test
clean:
rm -f *.o *.core *.html $(BIN)
rm -rf Doxygen
echo "Removing test data..."
rm -f Meshes/ICO_CC_*.*
rm -f Meshes/ICO_DS_*.*
# Create subdivided test data using "meshlab"
test: $(BIN)
echo "Catmull-Clark Subdivision..."
./$(BIN) -a cc -n 1 -o Meshes/ICO_CC_01.ply Meshes/Icosahedron.ply
./$(BIN) -a cc -n 2 -o Meshes/ICO_CC_02.ply Meshes/Icosahedron.ply
./$(BIN) -a cc -n 3 -o Meshes/ICO_CC_03.ply Meshes/Icosahedron.ply
echo "Doo-Sabin Subdivision..."
./$(BIN) -a ds -n 1 -o Meshes/ICO_DS_01.ply Meshes/Icosahedron.ply
./$(BIN) -a ds -n 2 -o Meshes/ICO_DS_02.ply Meshes/Icosahedron.ply
./$(BIN) -a ds -n 3 -o Meshes/ICO_DS_03.ply Meshes/Icosahedron.ply
echo "Converting..."
$(MLS) -i Meshes/ICO_CC_01.ply -o Meshes/ICO_CC_01.stl
$(MLS) -i Meshes/ICO_CC_02.ply -o Meshes/ICO_CC_02.stl
$(MLS) -i Meshes/ICO_CC_03.ply -o Meshes/ICO_CC_03.stl
$(MLS) -i Meshes/ICO_DS_01.ply -o Meshes/ICO_DS_01.stl
$(MLS) -i Meshes/ICO_DS_02.ply -o Meshes/ICO_DS_02.stl
$(MLS) -i Meshes/ICO_DS_03.ply -o Meshes/ICO_DS_03.stl
echo "Done."
# Valgrind test run for memory leaks
memcheck:
valgrind --suppressions=psalm.supp --leak-check=full --show-reachable=yes --track-origins=yes ./psalm -n 2 Tetrahedron.ply
rm Tetrahedron_subdivided.ply