-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
75 lines (66 loc) · 2.35 KB
/
Makefile
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
#
# Makefile -- Build instructions for Apple/iPod
#
ROMFSIMG = $(IMAGEDIR)/romfs.img
IMAGE = $(IMAGEDIR)/image.bin
ELFIMAGE = $(IMAGEDIR)/image.elf
ROMFS_DIRS = bin dev etc home lib mnt proc usr var
DEVICES = \
tty,c,5,0 console,c,5,1 cua0,c,5,64 cua1,c,5,65 \
\
mem,c,1,1 kmem,c,1,2 null,c,1,3 ram0,b,1,0 \
ram1,b,1,1 \
\
ptyp0,c,2,0 ptyp1,c,2,1 ptyp2,c,2,2 ptyp3,c,2,3 \
ptyp4,c,2,4 ptyp5,c,2,5 ptyp6,c,2,6 ptyp7,c,2,7 \
ptyp8,c,2,8 ptyp9,c,2,9 ptypa,c,2,10 ptypb,c,2,11 \
ptypc,c,2,12 ptypd,c,2,13 ptype,c,2,14 ptypf,c,2,15 \
\
tty0,c,4,0 tty1,c,4,1 tty2,c,4,2 tty3,c,4,3 \
ttyS0,c,4,64 ttyS1,c,4,65 \
\
ttyp0,c,3,0 ttyp1,c,3,1 ttyp2,c,3,2 ttyp3,c,3,3 \
ttyp4,c,3,4 ttyp5,c,3,5 ttyp6,c,3,6 ttyp7,c,3,7 \
ttyp8,c,3,8 ttyp9,c,3,9 ttypa,c,3,10 ttypb,c,3,11 \
ttypc,c,3,12 ttypd,c,3,13 ttype,c,3,14 ttypf,c,3,15 \
\
zero,c,1,5 random,c,1,8 urandom,c,1,9 \
\
dsp,c,14,3 mixer,c,14,0 \
\
fb0,c,29,0
clean:
romfs:
[ -d $(ROMFSDIR)/$$i ] || mkdir -p $(ROMFSDIR)
for i in $(ROMFS_DIRS); do \
[ -d $(ROMFSDIR)/$$i ] || mkdir -p $(ROMFSDIR)/$$i; \
done
for i in $(DEVICES); do \
touch $(ROMFSDIR)/dev/@$$i; \
done
$(ROMFSINST) -s /var/tmp /tmp
$(ROMFSINST) -s /bin /sbin
$(ROMFSINST) /etc/rc
$(ROMFSINST) /etc/inittab
$(ROMFSINST) ../../Generic/romfs/etc/services /etc/services
case "$(LINUXDIR)" in \
*2.4.*) ;; \
*) echo "ttyS0:linux:/bin/sh" >> $(ROMFSDIR)/etc/inittab ;; \
esac
$(ROMFSINST) /etc/motd
$(ROMFSINST) /etc/passwd
echo "$(VERSIONSTR) -- " `date` > $(ROMFSDIR)/etc/version
image:
[ -d $(IMAGEDIR) ] || mkdir -p $(IMAGEDIR)
genromfs -v -V "ROMdisk" -f $(ROMFSIMG) -d $(ROMFSDIR)
$(CROSS_COMPILE)objcopy -O binary --remove-section=.romvec \
--remove-section=.text --remove-section=.ramvec \
--remove-section=.init \
--remove-section=.bss --remove-section=.eram \
$(ROOTDIR)/$(LINUXDIR)/linux $(IMAGEDIR)/linux.data
$(CROSS_COMPILE)objcopy -O binary --remove-section=.ramvec \
--remove-section=.bss --remove-section=.data \
--remove-section=.eram \
--set-section-flags=.romvec=CONTENTS,ALLOC,LOAD,READONLY,CODE \
$(ROOTDIR)/$(LINUXDIR)/linux $(IMAGEDIR)/linux.text
cat $(IMAGEDIR)/linux.text $(IMAGEDIR)/linux.data $(ROMFSIMG) > $(IMAGE)