forked from ooni/probe-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (42 loc) · 1.65 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
PHONIES += check download-and-verify help unpack unpack-clean
.PHONY: $(PHONIES)
GPG2 = gpg2
WGET = wget
REPO = measurement-kit/measurement-kit
BASEURL = https://github.com/$(REPO)/releases/download
PACKAGE = org/openobservatory/measurement_kit
SRCDIR = app/src/main
TAG = -4
VERSION = v0.4.0-beta.4
INPUT = measurement_kit_android-$(VERSION)$(TAG).tar.bz2
help:
@printf "Targets:\n"
@for TARGET in `grep ^PHONIES Makefile|sed 's/^PHONIES += //'`; do \
if echo $$TARGET|grep -qv ^_; then \
printf " - $$TARGET\n"; \
fi; \
done
unpack: unpack-clean download-and-verify
@echo "Unpack $(INPUT) inside $(SRCDIR)"
@tar -C $(SRCDIR) -xf $(INPUT)
unpack-clean:
@echo "Clean inside $(SRCDIR)"
@rm -rf $(SRCDIR)/jniLibs/*
@rm -rf $(SRCDIR)/java/$(PACKAGE)/jni/
download-and-verify: check $(INPUT) $(INPUT).asc
$(GPG2) --verify $(INPUT).asc
$(INPUT):
$(WGET) $(BASEURL)/$(VERSION)/$(INPUT)
$(INPUT).asc:
$(WGET) $(BASEURL)/$(VERSION)/$(INPUT).asc
check:
@if [ -z "$$(which $(GPG2))" ]; then \
echo "FATAL: install $(GPG2) or make sure it's in PATH" 1>&2; \
exit 1; \
fi
@echo "Using $(GPG2): $$(which $(GPG2))"
@if [ -z "$$(which $(WGET))" ]; then \
echo "FATAL: install $(WGET) or make sure it's in PATH" 1>&2; \
exit 1; \
fi
@echo "Using $(WGET): $$(which $(WGET))"