-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (42 loc) · 1.11 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
SHELL := /bin/bash
SRC := $(wildcard *.tex)
PDF := $(SRC:.tex=.pdf)
FIGURES := $(filter-out *-crop.pdf, $(shell find figures -name "*.pdf" -type f))
DTMS := $(wildcard data/DTEEC*.IMG)
.PHONY: all $(DTMS) dijkstra
all:
-mkdir .build
-rm $(PDF)
for t in $(SRC) ; do \
pdflatex -shell-escape -output-directory=.build $$t ; \
done
make links
crop:
for fig in $(FIGURES) ; do \
pdfcrop $$fig ; \
mv `echo $$fig | sed "s/.pdf/-crop.pdf/g"` $$fig ; \
done
clean:
-rm $(PDF)
-rm -rf .build/*
links:
-rm $(PDF)
ln -s .build/*.pdf .
# Download all the DTM currently tracked in this repo
wget:
cd data && wget -i datasets.txt
# Download the Golang dependencies
goget:
go get "github.com/siravan/fits"
# Build the Golang program
dijkstra:
cd dijkstra && go build
# Compute the traversability map for a DTM
$(DTMS):
$(eval FITS := $(subst .IMG,.fits,$@))
$(eval BIN := $(subst data,outputs,$(subst .IMG,.bin,$@)))
test -e $(FITS) || ./img2fits.py "$@"
if [ ! -e $(BIN) ] ; then \
make dijkstra && dijkstra/dijkstra $(FITS) ; \
fi
cd outputs ; matlab -nodesktop -nosplash -r "load_and_plot('$(FITS)');exit"