OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / vendors / Arcturus / uCdimm+mtd / Makefile
1 #
2 #       Makefile -- Build instructions for Arcturus/uCdimm
3 #
4
5 ROMFSIMG = $(IMAGEDIR)/romfs.img
6 IMAGE    = $(IMAGEDIR)/image.bin
7
8 DIRS = 
9
10 ROMFS_DIRS = bin dev dev/flash etc home lib mnt proc usr var \
11              home/httpd home/httpd/cgi-bin
12
13 DEVICES = \
14         tty,c,5,0      console,c,5,1      cua0,c,5,64      cua1,c,5,65  \
15         mem,c,1,1      kmem,c,1,2         null,c,1,3       ram0,b,1,0 \
16         \
17         ram1,b,1,1 \
18         \
19         ptyp0,c,2,0    ptyp1,c,2,1        ptyp2,c,2,2      ptyp3,c,2,3 \
20         ptyp4,c,2,4    ptyp5,c,2,5        ptyp6,c,2,6      ptyp7,c,2,7 \
21         ptyp8,c,2,8    ptyp9,c,2,9        ptypa,c,2,10     ptypb,c,2,11 \
22         ptypc,c,2,12   ptypd,c,2,13       ptype,c,2,14     ptypf,c,2,15 \
23         \
24         tty0,c,4,0     tty1,c,4,1         tty2,c,4,2       tty3,c,4,3 \
25         ttyS0,c,4,64   ttyS1,c,4,65 \
26         \
27         ttyp0,c,3,0    ttyp1,c,3,1        ttyp2,c,3,2      ttyp3,c,3,3 \
28         ttyp4,c,3,4    ttyp5,c,3,5        ttyp6,c,3,6      ttyp7,c,3,7 \
29         ttyp8,c,3,8    ttyp9,c,3,9        ttypa,c,3,10     ttypb,c,3,11 \
30         ttypc,c,3,12   ttypd,c,3,13       ttype,c,3,14     ttypf,c,3,15 \
31         \
32         zero,c,1,5     random,c,1,8       urandom,c,1,9 \
33         \
34         ipsec,c,36,10 \
35         ledman,c,126,0
36
37 ifdef CONFIG_BLK_DEV_BLKMEM
38
39         DEVICES += \
40                 rom0,b,31,0    rom1,b,31,1        rom2,b,31,2      rom3,b,31,3 \
41                 rom4,b,31,4    rom5,b,31,5        rom6,b,31,6      rom7,b,31,7 \
42                 rom8,b,31,8    rom9,b,31,9
43
44 else
45         DEVICES += \
46                 mtd0,c,90,0             mtdr0,c,90,1    mtdblock0,b,31,0 \
47                 mtd1,c,90,2             mtdr1,c,90,3    mtdblock1,b,31,1 \
48                 mtd2,c,90,4             mtdr2,c,90,5    mtdblock2,b,31,2 \
49                 mtd3,c,90,6             mtdr3,c,90,7    mtdblock3,b,31,3 \
50                 mtd4,c,90,8             mtdr4,c,90,9    mtdblock4,b,31,4 \
51                 mtd5,c,90,10    mtdr5,c,90,11   mtdblock5,b,31,5 \
52                 mtd6,c,90,12    mtdr6,c,90,13   mtdblock6,b,31,6 \
53
54         FLASH_DEVICES = \
55                 boot,c,90,0 \
56                 image,c,90,2 \
57                 spare,b,31,2 \
58                 all,c,90,6
59 endif
60
61
62 all:
63         dirs=$(DIRS) ; \
64         for i in $$dirs ; do  make -C $$i || exit $? ; done
65
66 clean:
67         -dirs=$(DIRS) ; \
68         for i in $$dirs; do [ ! -d $$i ] || make -C $$i clean; done
69
70 romfs:
71         [ -d $(ROMFSDIR)/$$i ] || mkdir -p $(ROMFSDIR)
72         for i in $(ROMFS_DIRS); do \
73                 [ -d $(ROMFSDIR)/$$i ] || mkdir -p $(ROMFSDIR)/$$i; \
74         done
75         for i in $(DEVICES); do \
76                 touch $(ROMFSDIR)/dev/@$$i; \
77         done
78         # these permissions are needed for openpty and family to work
79         # on non-ptmx ptys
80         chmod 620 $(ROMFSDIR)/dev/@[pt]ty[pqrsPQRS][0-9a-f],*
81 ifdef FLASH_DEVICES
82         for i in $(FLASH_DEVICES); do \
83                 touch $(ROMFSDIR)/dev/flash/@$$i; \
84         done
85 endif
86         dirs=$(DIRS) ; for i in $$dirs; do  make -C $$i romfs || exit $? ; done
87         $(ROMFSINST) -s /var/tmp /tmp
88         $(ROMFSINST) -s /bin /sbin
89         $(ROMFSINST) /etc/rc
90         $(ROMFSINST) /etc/inittab
91         $(ROMFSINST) ../../Generic/romfs/etc/services /etc/services
92         $(ROMFSINST) /etc/motd
93         if [ -f passwd.$(LIBCDIR) ]; then \
94                 $(ROMFSINST) passwd.$(LIBCDIR) /etc/passwd; \
95         else \
96                 $(ROMFSINST) /etc/passwd; \
97         fi
98         $(ROMFSINST) ../../Generic/httpd /home/httpd
99         # better to be running from RAM when hanging it
100         $(CROSS)flthdr -r $(ROMFSDIR)/bin/netflash
101         $(CROSS)flthdr -r $(ROMFSDIR)/bin/flashw
102         echo "$(VERSIONSTR) -- " `date` > $(ROMFSDIR)/etc/version
103
104 image:
105         [ -d $(IMAGEDIR) ] || mkdir -p $(IMAGEDIR)
106         genromfs -v -V "ROMdisk" -f $(ROMFSIMG) -d $(ROMFSDIR)
107         $(CROSS_COMPILE)objcopy -O binary --remove-section=.romvec \
108                         --remove-section=.text --remove-section=.ramvec \
109                         --remove-section=.bss --remove-section=.eram \
110                         $(ROOTDIR)/$(LINUXDIR)/linux $(IMAGEDIR)/linux.data
111         $(CROSS_COMPILE)objcopy -O binary --remove-section=.ramvec \
112                         --remove-section=.bss --remove-section=.data \
113                         --remove-section=.eram \
114                         --set-section-flags=.romvec=CONTENTS,ALLOC,LOAD,READONLY,CODE \
115                         $(ROOTDIR)/$(LINUXDIR)/linux $(IMAGEDIR)/linux.text
116         cat $(IMAGEDIR)/linux.text $(IMAGEDIR)/linux.data $(ROMFSIMG) > $(IMAGE)
117         [ -n "$(NO_BUILD_INTO_TFTPBOOT)" ] || cp $(IMAGE) /tftpboot
118