summaryrefslogtreecommitdiff
path: root/utils/nwztools/scripts/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'utils/nwztools/scripts/Makefile')
-rw-r--r--utils/nwztools/scripts/Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/utils/nwztools/scripts/Makefile b/utils/nwztools/scripts/Makefile
new file mode 100644
index 0000000000..ed6e725291
--- /dev/null
+++ b/utils/nwztools/scripts/Makefile
@@ -0,0 +1,40 @@
1upgtool:="../upgtools/upgtool"
2scsitool:="../scsitools/scsitool"
3
4.SUFFIXES: # disable old suffix rules
5
6all:
7 @echo "Please select an action:"
8 @echo "- update: uses script update.sh"
9 @echo "- dump_rootfs: dumps the root filesystem to rootfs.tgz"
10 @echo "- my_update: craft an arbitrary upgrade script found in my_update.sh"
11 @echo "- do_fw_upgrade: send a firmware upgrade to the device in NWZ_DEV"
12 @echo "- list_targets: produce of list of available targets"
13
14my_update: my_update.upg
15dump_rootfs: dump_rootfs.upg
16
17%.upg: %.sh
18ifndef NWZ_TARGET
19 @echo "Please set NWZ_TARGET to your target. For example:"
20 @echo "make $@ NWZ_TARGET=nwz-e463"
21 @echo "Run 'make list_targets' to get a list of all targets"
22else
23 @echo "Target: $(NWZ_TARGET)"
24 $(upgtool) -c -m $(NWZ_TARGET) $@ $^
25endif
26
27clean:
28 rm -rf *.UPG
29
30list_targets:
31 $(upgtool) -m ?; true # upgtool returns an error in this case, ignore it
32
33do_fw_upgrade:
34ifdef NWZ_DEV
35 @echo "Device: $(NWZ_DEV)"
36 $(scsitool) $(NWZ_DEV) do_fw_upgrade
37else
38 @echo "Please set NWZ_DEV to your dev. For example:"
39 @echo "make do_fw_upgrade NWZ_DEV=/dev/sdx"
40endif