-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (54 loc) · 2.17 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
58
59
60
61
62
63
64
65
66
67
all: convert scale clean
# Download tools to manipulate PLY files
tmp/plytools.tar.gz:
@mkdir -p $(@D)
@echo "Downloading PLY Tools"
@wget -O $@ http://www.cc.gatech.edu/projects/large_models/files/ply.tar.gz -q
bin/boundply: tmp/plytools.tar.gz src/boundply.c.patch
@mkdir -p $(@D)
@mkdir -p tmp/plytools
@tar -xzf tmp/plytools.tar.gz -C tmp/plytools --strip-components 1 ply/makefile ply/boundply.c ply/ply.h ply/ply.c
@patch tmp/plytools/boundply.c src/boundply.c.patch
@$(MAKE) -C tmp/plytools boundply
@mv tmp/plytools/boundply $@
bin/xformply: tmp/plytools.tar.gz src/xformply.c.patch
@mkdir -p $(@D)
@mkdir -p tmp/plytools
@tar -xzf tmp/plytools.tar.gz -C tmp/plytools --strip-components 1 ply/makefile ply/xformply.c ply/ply.h ply/ply.c
@patch tmp/plytools/xformply.c src/xformply.c.patch
@$(MAKE) -C tmp/plytools xformply
@mv tmp/plytools/xformply $@
bin/normalsply: tmp/plytools.tar.gz src/normalsply.c.patch
@mkdir -p $(@D)
@mkdir -p tmp/plytools
@tar -xzf tmp/plytools.tar.gz -C tmp/plytools --strip-components 1 ply/makefile ply/normalsply.c ply/ply.h ply/ply.c
@patch tmp/plytools/normalsply.c src/normalsply.c.patch
@$(MAKE) -C tmp/plytools normalsply
@mv tmp/plytools/normalsply $@
# Download the Princeton Shape Benchmark
tmp/benchmark.zip:
@mkdir -p $(@D)
@echo "Downloading the Princeton Shape Benchmark"
@wget -O $@ http://shape.cs.princeton.edu/benchmark/download/psb_v1.zip -q
# Extract models from the benchmark
models/off: tmp/benchmark.zip
@mkdir -p $@
@unzip -j $< *.off -d $@
# Convert models from .off format to .ply, translate and scale to known bounding box
# TODO: Create the list of file from zip index.
sources = $(wildcard models/off/*.off)
targets = $(addprefix models/ply/,$(addsuffix .ply,$(basename $(notdir $(sources)))))
models/ply/m%.ply: models/off/m%.off bin/off2ply bin/boundply bin/xformply bin/normalsply
@mkdir -p $(@D)
@bin/convert < $< > $@
convert: $(targets) models/off
@echo "Converting and scaling models. This may take a while..."
# Build objectrenderer
objectrenderer:
@ mkdir -p .build
@ (cd .build && cmake .. && make)
# Build scene for rendering.
# Make renderer work!
clean:
-rm -rf .build
-rm objectrenderer