8 gentree = script/gentree
10 geniso = script/geniso
11 genuzip = script/genuzip
12 gencard = script/gencard
15 mkuzip != which mkuzip
16 mkuzip_opts ?= -s 65536
17 mkisofs != which mkisofs
18 mkisofs_opts?= -quiet -D -R -no-pad -p CyberLeo
20 # Default device for burn target
25 checkroot = @if [ $(curruser) -gt 0 ]; then printf "\033[1;31mI need root\033[0m\n"; exit 1; fi
26 checkdeps = @if [ ! -x "$(mkisofs)" -o ! -x "$(mkuzip)" ]; then printf "\033[1;31mCheck depends! mkisofs: $(mkisofs) mkuzip: $(mkuzip)\033[0m\n"; exit 1; fi
29 all: $(worktree)/card.img
31 image: $(worktree)/card.img
33 firmware: $(worktree)/card.img
35 # Check that we're running as root
40 burn: $(worktree)/card.img
42 script/burn $(.ALLSRC) $(dev)
44 # Push to build target
46 script/push cyberleo@sc1425:mosi/
49 $(worktree)/card.img: $(worktree)/boot.img $(worktree)/root.img
51 ${gencard} -b $(worktree)/boot.img -r $(worktree)/root.img -c $(worktree)/conf -o $(worktree)/card.img
52 @printf " \033[1;32m*\033[0m Complete\n"
54 $(worktree)/boot.img: $(worktree)/boot
56 ${genufs} -p $(boot_pad) -l boot -o $(worktree)/boot.img $(worktree)/boot
58 $(worktree)/root.img: $(worktree)/root.iso
61 ${genuzip} $(.ALLSRC) $(.TARGET)
63 $(worktree)/root.iso: $(worktree)/root
66 ${geniso} -n root $(.ALLSRC) $(.TARGET)
68 $(worktree): $(worktree)/root
70 $(worktree)/boot: $(srctree)/root
72 $(gentree) -b $(srctree) -t $(worktree)
74 $(worktree)/root: $(srctree)/root
76 $(gentree) -b $(srctree) -t $(worktree)
78 # Scrub everything clean