-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (23 loc) · 845 Bytes
/
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
all: setup
setup: dirs
MASKED_GPS_DIR:=data/masked-gps
dirs:
-@mkdir data
-@mkdir data/masked-gps
-@mkdir data/runsessions
data/runsessions/%:
cat Sport-sessions/$(@F) | \
sed 's/"latitude":[0-9.]*/"latitude":-1/g'| \
sed 's/"longitude":[0-9.]*/"longitude":-1/g' > data/runsessions/$(@F)
data/masked-gps/%:
cat Sport-sessions/GPS-data/$(@F) | \
sed 's/"latitude":[0-9.]*/"latitude":-1/g'| \
sed 's/"longitude":[0-9.]*/"longitude":-1/g' > data/masked-gps/$(@F)
clean:
rm -rf data
gps-target:=$(shell find Sport-sessions/GPS-data/*.json)
gps-data: $(patsubst %,data/masked-gps/%,$(gps-target))
runsessions-target:=$(shell find Sport-sessions/*.json)
runsessions-data: $(patsubst %,data/runsessions/%,$(runsessions-target))
all-data: gps-data runsessions-data
.PHONY: all clean setup gps-data runsessions-data all-data