-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (63 loc) · 2.11 KB
/
Makefile
File metadata and controls
80 lines (63 loc) · 2.11 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
PROJECT=wbrt
IMAGE=$(PROJECT)
DOCKER=docker run -t --rm \
-v `pwd`:/home/ubuntu/$(PROJECT) \
-w /home/ubuntu/$(PROJECT) \
-u $$(id -u):$$(id -g) \
$(IMAGE)
LIBWDI_REPO=https://github.com/pbatard/libwdi
LIBWDI_COMMIT_SHA=30df0c0e051b0132c4b9ebed8c054bc8eb3aaaec
GIT_VERSION=$(shell git describe --tags --always)
FLASHTOOL_VERSION=v0.1.7
FLASHTOOL_URL=https://github.com/unknown321/mediatek_flash_tool/releases/download/$(FLASHTOOL_VERSION)/flash_tool.exe
DA_URL=https://github.com/bkerler/mtkclient/raw/refs/tags/1.9/mtkclient/Loader/MTK_AllInOne_DA_5.2136.bin
prepare:
cat Dockerfile | docker build -t $(IMAGE) -
deps: deps/wdk deps/flash_tool.exe deps/DA.bin
deps/wdfcoinstaller.msi:
wget -O $(@) https://go.microsoft.com/fwlink/p/?LinkID=253170
deps/wdk: deps/wdfcoinstaller.msi
msiextract deps/wdfcoinstaller.msi -C deps/wdk
mv "deps/wdk/Program Files/Windows Kits/8.0" deps/wdk/8.0
libwdi:
git clone $(LIBWDI_REPO) $(@)
cd $(@) && git checkout $(LIBWDI_COMMIT_SHA)
libwdi/examples/wdi-simple.exe: libwdi deps/wdk
mkdir -p libwdi/build
cd libwdi && \
bash -c "./autogen.sh --prefix=/home/ubuntu/$(PROJECT)/libwdi/build \
--host=x86_64-w64-mingw32 \
--enable-32bit=no \
--disable-32bit \
--enable-debug=no \
--with-libusb0= \
--with-libusbk= \
--with-userdir= \
--with-wdkdir=\"/home/ubuntu/$(PROJECT)/deps/wdk/8.0\" \
" && \
echo '#define COINSTALLER_DIR "wdf"' >> config.h && \
echo '#define X64_DIR "x64"' >> config.h && \
make && \
cd examples && make wdi-simple.exe
deps/flash_tool.exe:
wget -O deps/flash_tool.exe $(FLASHTOOL_URL)
deps/DA.bin:
wget -O deps/DA.bin $(DA_URL)
nsis:
-rm walkman-backup-restore-tool.$(GIT_VERSION).exe
$(MAKE) run
walkman-backup-restore-tool.$(GIT_VERSION).exe: deps libwdi/examples/wdi-simple.exe
makensis installer.nsi
run:
$(DOCKER) make walkman-backup-restore-tool.$(GIT_VERSION).exe
clean:
-rm -rf \
deps/*.msi \
deps/DA.bin \
deps/flash_tool.exe \
deps/wdk \
libwdi \
*.exe
release: walkman-backup-restore-tool.$(GIT_VERSION).exe
.DEFAULT_GOAL = run
.PHONY: deps nsis run release clean prepare