summaryrefslogtreecommitdiffstats
path: root/images/add_adb_root/Makefile
blob: 7724ab81b1be7e6cd8bf4b389643709335d00984 (plain)
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
# For the tests
CURL ?= curl
MIRROR ?= https://ftp.osuosl.org/pub/replicant/images/replicant-6.0/0004-rc4/images

# For make install
DESTDIR ?= /usr/local/bin
INSTALL ?= install

PROGNAME := add_adb_root.py
.PHONY: all help check install test-recovery-i9100 test-recovery-i9300

all: help

help:
	@echo "Available commands:"
	@echo -e "\tmake help\tPrints the help"
	@echo -e "\tmake check\tRun tests"
	@echo -e "\tmake install\tInstall $(PROGNAME)"

tests/recovery-i9100.img:
	mkdir -p tests
	$(CURL) $(MIRROR)/i9100/recovery-i9100.img -o $@

tests/recovery-i9300.img:
	mkdir -p tests
	$(CURL) $(MIRROR)/i9300/recovery-i9300.img -o $@

# TODO: test-recovery-i9300 always fails as the resulting image is different
# at each test
check: test-recovery-i9100

test-recovery-i9100: tests/recovery-i9100.img
	@./$(PROGNAME) tests/recovery-i9100.img tests/recovery-i9100-with-root.img
	@sha512sum -c tests/recovery-i9100-with-root.img.sha512
	@echo "[ OK ] GT-I9100 image"

test-recovery-i9300: tests/recovery-i9300.img
	@./$(PROGNAME) tests/recovery-i9300.img tests/recovery-i9300-with-root.img
	@sha512sum -c tests/recovery-i9300-with-root.img.sha512
	@echo "[ OK ] GT-I9300 image"

install:
	$(INSTALL) -m 755 $(PROGNAME) -t $(DESTDIR)