8 gentree = script/gentree
10 geniso = script/geniso
11 genuzip = script/genuzip
12 gencard = script/gencard
15 makefs != which makefs
16 makefs_opts ?= -t ffs -o version=2,optimization=space -b 8 -f 8
17 tunefs != which tunefs
18 mkuzip != which mkuzip
19 mkuzip_opts ?= -s 65536
20 mkisofs != which mkisofs
21 mkisofs_opts?= -quiet -D -R -no-pad -p CyberLeo
23 # Default device for burn target
28 checkroot = @if [ $(curruser) -gt 0 ]; then printf "\033[1;31mI need root\033[0m\n"; exit 1; fi
29 checkdeps = @if [ ! -x "$(mkisofs)" -o ! -x "$(mkuzip)" ]; then printf "\033[1;31mCheck depends! mkisofs: $(mkisofs) mkuzip: $(mkuzip)\033[0m\n"; exit 1; fi
32 all: $(worktree)/card.img
34 image: $(worktree)/card.img
36 firmware: $(worktree)/card.img
38 # Check that we're running as root
43 burn: $(worktree)/card.img
45 script/burn $(.ALLSRC) $(dev)
47 # Push to build target
49 script/push cyberleo@sc1425:mosi/
52 $(worktree)/card.img: $(worktree)/boot.img $(worktree)/root.img
54 ${gencard} -b $(worktree)/boot.img -r $(worktree)/root.img -c $(worktree)/conf -o $(worktree)/card.img
55 @printf " \033[1;32m*\033[0m Complete\n"
57 $(worktree)/boot.img: $(worktree)/boot
59 #${genufs} -p $(boot_pad) -l boot -o $(worktree)/boot.img $(worktree)/boot
60 ${makefs} ${makefs_opts} $(worktree)/boot.img $(worktree)/boot
61 ${tunefs} -L boot $(worktree)/boot.img
63 $(worktree)/root.img: $(worktree)/root.iso
66 ${genuzip} $(.ALLSRC) $(.TARGET)
68 $(worktree)/root.iso: $(worktree)/root
71 ${geniso} -n root $(.ALLSRC) $(.TARGET)
73 $(worktree): $(worktree)/root
75 $(worktree)/boot: $(srctree)/root
77 $(gentree) -b $(srctree) -t $(worktree)
79 $(worktree)/root: $(srctree)/root
81 $(gentree) -b $(srctree) -t $(worktree)
83 # Scrub everything clean