6 # Debug mode (spam/verbose)
12 # command used to get root (needed for tarball creation)
15 # We use fixed addresses to avoid overlap when relocating
16 # and other trouble with initrd
18 # Load the bootstrap at 2Mb
20 # Malloc block at 3Mb -> 4Mb
23 # Load kernel at 20Mb and ramdisk just after
24 KERNELADDR = 0x01400000
26 # Set this to the prefix of your cross-compiler, if you have one.
27 # Else leave it empty.
31 # The flags for the yaboot binary.
33 YBCFLAGS = -Os $(CFLAGS) -nostdinc -Wall -isystem `gcc -print-file-name=include` -fsigned-char
34 YBCFLAGS += -DVERSION=\"${VERSION}\" #"
35 YBCFLAGS += -DTEXTADDR=$(TEXTADDR) -DDEBUG=$(DEBUG)
36 YBCFLAGS += -DMALLOCADDR=$(MALLOCADDR) -DMALLOCSIZE=$(MALLOCSIZE)
37 YBCFLAGS += -DKERNELADDR=$(KERNELADDR)
38 YBCFLAGS += -I ./include
40 ifeq ($(CONFIG_COLOR_TEXT),y)
41 YBCFLAGS += -DCONFIG_COLOR_TEXT
44 ifeq ($(CONFIG_SET_COLORMAP),y)
45 YBCFLAGS += -DCONFIG_SET_COLORMAP
48 ifeq ($(USE_MD5_PASSWORDS),y)
49 YBCFLAGS += -DUSE_MD5_PASSWORDS
52 ifeq ($(CONFIG_FS_XFS),y)
53 YBCFLAGS += -DCONFIG_FS_XFS
56 ifeq ($(CONFIG_FS_REISERFS),y)
57 YBCFLAGS += -DCONFIG_FS_REISERFS
62 LFLAGS = -Ttext $(TEXTADDR) -Bstatic
66 LLIBS = lib/libext2fs.a
68 # For compiling userland utils
70 UCFLAGS = -Os $(CFLAGS) -Wall -I/usr/include
72 # For compiling build-tools that run on the host.
75 HOSTCFLAGS = -O2 $(CFLAGS) -Wall -I/usr/include
77 ## End of configuration section
79 OBJS = second/crt0.o second/yaboot.o second/cache.o second/prom.o second/file.o \
80 second/partition.o second/fs.o second/cfg.o second/setjmp.o second/cmdline.o \
81 second/fs_of.o second/fs_ext2.o second/fs_iso.o second/iso_util.o \
82 lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o
84 ifeq ($(USE_MD5_PASSWORDS),y)
88 ifeq ($(CONFIG_FS_XFS),y)
89 OBJS += second/fs_xfs.o
92 ifeq ($(CONFIG_FS_REISERFS),y)
93 OBJS += second/fs_reiserfs.o
99 OBJCOPY = $(CROSS)objcopy
101 lgcc = `$(CC) -print-libgcc-file-name`
103 all: yaboot addnote mkofboot
106 $(LD) $(LFLAGS) $(OBJS) $(LLIBS) $(lgcc) -o second/$@
107 chmod -x second/yaboot
110 $(CC) $(UCFLAGS) -o util/addnote util/addnote.c
113 $(HOSTCC) $(HOSTCFLAGS) -o util/elfextract util/elfextract.c
116 ln -sf ybin ybin/mkofboot
119 $(CC) $(YBCFLAGS) -c -o $@ $<
122 $(CC) $(YBCFLAGS) -D__ASSEMBLY__ -c -o $@ $<
125 makedepend -Iinclude *.c lib/*.c util/*.c gui/*.c
128 mkdir ../yaboot-binary-${VERSION}
129 ${GETROOT} make ROOT=../yaboot-binary-${VERSION} install
130 mkdir -p -m 755 ../yaboot-binary-${VERSION}/usr/local/share/doc/yaboot
131 cp -a COPYING ../yaboot-binary-${VERSION}/usr/local/share/doc/yaboot/COPYING
132 cp -a README ../yaboot-binary-${VERSION}/usr/local/share/doc/yaboot/README
133 mv ../yaboot-binary-${VERSION}/etc/yaboot.conf ../yaboot-binary-${VERSION}/usr/local/share/doc/
134 rmdir ../yaboot-binary-${VERSION}/etc
135 ${GETROOT} tar -C ../yaboot-binary-${VERSION} -zcvpf ../yaboot-binary-${VERSION}.tar.gz .
136 rm -rf ../yaboot-binary-${VERSION}
139 rm -f second/yaboot util/addnote util/elfextract $(OBJS)
140 find . -name '#*' | xargs rm -f
141 find . -name '.#*' | xargs rm -f
142 find . -name '*~' | xargs rm -f
145 chmod 755 ybin/ybin ybin/ofpath ybin/yabootconfig
146 chmod -R u+rwX,go=rX .
151 strip --remove-section=.comment second/yaboot
153 strip --remove-section=.comment --remove-section=.note util/addnote
156 install -d -o root -g root -m 0755 ${ROOT}/etc/
157 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/sbin/
158 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/lib
159 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/lib/yaboot
160 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man5/
161 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man8/
162 install -o root -g root -m 0644 second/yaboot ${ROOT}/$(PREFIX)/lib/yaboot
163 install -o root -g root -m 0755 util/addnote ${ROOT}/${PREFIX}/lib/yaboot/addnote
164 install -o root -g root -m 0644 first/ofboot ${ROOT}/${PREFIX}/lib/yaboot/ofboot
165 install -o root -g root -m 0755 ybin/ofpath ${ROOT}/${PREFIX}/sbin/ofpath
166 install -o root -g root -m 0755 ybin/ybin ${ROOT}/${PREFIX}/sbin/ybin
167 install -o root -g root -m 0755 ybin/yabootconfig ${ROOT}/${PREFIX}/sbin/yabootconfig
168 rm -f ${ROOT}/${PREFIX}/sbin/mkofboot
169 ln -s ybin ${ROOT}/${PREFIX}/sbin/mkofboot
171 install -o root -g root -m 0644 man/bootstrap.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/bootstrap.8.gz
172 install -o root -g root -m 0644 man/mkofboot.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/mkofboot.8.gz
173 install -o root -g root -m 0644 man/ofpath.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/ofpath.8.gz
174 install -o root -g root -m 0644 man/yaboot.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/yaboot.8.gz
175 install -o root -g root -m 0644 man/yabootconfig.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/yabootconfig.8.gz
176 install -o root -g root -m 0644 man/ybin.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/ybin.8.gz
177 install -o root -g root -m 0644 man/yaboot.conf.5.gz ${ROOT}/${PREFIX}/${MANDIR}/man5/yaboot.conf.5.gz
179 @if [ ! -e ${ROOT}/etc/yaboot.conf ] ; then \
180 echo "install -o root -g root -m 0644 etc/yaboot.conf ${ROOT}/etc/yaboot.conf"; \
181 install -o root -g root -m 0644 etc/yaboot.conf ${ROOT}/etc/yaboot.conf; \
183 echo "/etc/yaboot.conf already exists, leaving it alone"; \
186 @echo "Installation successful."
188 @echo "An example /etc/yaboot.conf has been installed (unless /etc/yaboot.conf already existed"
189 @echo "You may either alter that file to match your system, or alternatively run yabootconfig"
190 @echo "yabootconfig will generate a simple and valid /etc/yaboot.conf for your system"
194 rm -f ${ROOT}/${PREFIX}/sbin/ofpath
195 rm -f ${ROOT}/${PREFIX}/sbin/ybin
196 rm -f ${ROOT}/${PREFIX}/sbin/yabootconfig
197 rm -f ${ROOT}/${PREFIX}/sbin/mkofboot
198 rm -f ${ROOT}/${PREFIX}/lib/yaboot/yaboot
199 rm -f ${ROOT}/${PREFIX}/lib/yaboot/ofboot
200 rm -f ${ROOT}/${PREFIX}/lib/yaboot/addnote
201 @rmdir ${ROOT}/${PREFIX}/lib/yaboot || true
202 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/bootstrap.8.gz
203 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/mkofboot.8.gz
204 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/ofpath.8.gz
205 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/yaboot.8.gz
206 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/yabootconfig.8.gz
207 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/ybin.8.gz
208 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man5/yaboot.conf.5.gz
209 @if [ -L ${ROOT}/boot/yaboot -a ! -e ${ROOT}/boot/yaboot ] ; then rm -f ${ROOT}/boot/yaboot ; fi
210 @if [ -L ${ROOT}/boot/ofboot.b -a ! -e ${ROOT}/boot/ofboot.b ] ; then rm -f ${ROOT}/boot/ofboot.b ; fi
212 @echo "Deinstall successful."
213 @echo "${ROOT}/etc/yaboot.conf has not been removed, you may remove it yourself if you wish."