]> CyberLeo.Net >> Repos - CDN/Mosi.git/blob - Makefile
patch/boot.config: Set boot block serial speed to 115200
[CDN/Mosi.git] / Makefile
1 # mkisofs meanings
2 # -v Verbose
3 # -quiet quiet?
4 # -o output to root.iso
5 # -D No deep directory relocation (and no RR_MOVED)
6 # -no-pad Don't pad to 150 sectors
7 # -p preparer
8 # -V volume label
9
10 # Settables
11 worktree    ?= tree
12 boot_pad    ?= 1280
13 image_sect  ?= 1000944
14
15 # Generation scripts
16 gentree      = script/gentree
17 genufs       = script/genufs
18 geniso       = script/geniso
19 genuzip      = script/genuzip
20 gencard      = script/gencard
21
22 # Image utilities
23 mkuzip      != which mkuzip
24 mkuzip_opts ?= -s 65536
25 mkisofs     != which mkisofs
26 mkisofs_opts?= -quiet -D -R -no-pad -p CyberLeo
27
28 # Default device for burn target
29 dev         ?= null
30
31 # Check current user
32 curruser    != id -u
33 checkroot    = @if [ $(curruser) -gt 0 ]; then printf "\033[1;31mI need root\033[0m\n"; exit 1; fi
34 checkdeps    = @if [ ! -x "$(mkisofs)" -o ! -x "$(mkuzip)" ]; then printf "\033[1;31mCheck depends! mkisofs: $(mkisofs) mkuzip: $(mkuzip)\033[0m\n"; exit 1; fi
35
36 all: card.img
37
38 image: card.img
39
40 firmware: card.img
41
42 checkroot:
43         $(checkroot)
44
45 burn: card.img
46         $(checkroot)
47         script/burn $(.ALLSRC) $(dev)
48
49 card.img: boot.img root.img
50         $(checkroot)
51         ${gencard} -c $(worktree)/conf
52
53 boot.img: $(worktree)/boot
54         $(checkroot)
55         ${genufs} -p $(boot_pad) $(worktree)/boot
56
57 root.img: root.iso
58         $(checkroot)
59         $(checkdeps)
60         ${genuzip} $(.ALLSRC) $(.TARGET)
61
62 root.iso: $(worktree)/root
63         $(checkroot)
64         $(checkdeps)
65         ${geniso} -n root $(.ALLSRC) $(.TARGET)
66
67 $(worktree): root
68         $(checkroot)
69         $(gentree) -t $(worktree) -r $(.ALLSRC)
70
71 $(worktree)/boot: root
72         $(checkroot)
73         $(gentree) -t $(worktree) -r $(.ALLSRC)
74
75 $(worktree)/root: root
76         $(checkroot)
77         $(gentree) -t $(worktree) -r $(.ALLSRC)
78
79 clean:
80         $(checkroot)
81         rm -Rf card.img boot.img root.img root.iso $(worktree)