1 ## Configuration section
13 # Enable colormap setup
14 CONFIG_SET_COLORMAP = y
15 # Enable splash screen
16 CONFIG_SPLASH_SCREEN = n
17 # Enable md5 passwords
20 # We use fixed addresses to avoid overlap when relocating
21 # and other trouble with initrd
23 # Load the bootstrap at 2Mb
25 # Malloc block at 3Mb -> 4Mb
28 # Load kernel at 20Mb and ramdisk just after
29 KERNELADDR = 0x01400000
31 # Set this to the prefix of your cross-compiler, if you have one.
32 # Else leave it empty.
36 # The flags for the target compiler.
38 CFLAGS = -Os -nostdinc -Wall -isystem `gcc -print-file-name=include` -fsigned-char
39 CFLAGS += -DVERSION=\"${VERSION}\" #"
40 CFLAGS += -DTEXTADDR=$(TEXTADDR) -DDEBUG=$(DEBUG)
41 CFLAGS += -DMALLOCADDR=$(MALLOCADDR) -DMALLOCSIZE=$(MALLOCSIZE)
42 CFLAGS += -DKERNELADDR=$(KERNELADDR)
43 CFLAGS += -I ./include
45 ifeq ($(CONFIG_COLOR_TEXT),y)
46 CFLAGS += -DCONFIG_COLOR_TEXT
49 ifeq ($(CONFIG_SET_COLORMAP),y)
50 CFLAGS += -DCONFIG_SET_COLORMAP
53 ifeq ($(CONFIG_SPLASH_SCREEN),y)
54 CFLAGS += -DCONFIG_SPLASH_SCREEN
57 ifeq ($(USE_MD5_PASSWORDS),y)
58 CFLAGS += -DUSE_MD5_PASSWORDS
63 LFLAGS = -Ttext $(TEXTADDR) -Bstatic
67 LLIBS = lib/libext2fs.a
70 # For compiling build-tools that run on the host.
73 HOSTCFLAGS = -I/usr/include $(CFLAGS)
75 ## End of configuration section
77 OBJS = second/crt0.o second/yaboot.o second/cache.o second/prom.o second/file.o \
78 second/partition.o second/fs.o second/cfg.o second/setjmp.o second/cmdline.o \
79 second/fs_of.o second/fs_ext2.o second/fs_reiserfs.o second/fs_iso.o second/iso_util.o \
80 lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o
82 ifeq ($(CONFIG_SPLASH_SCREEN),y)
83 OBJS += second/gui/effects.o second/gui/colormap.o second/gui/video.o second/gui/pcx.o
86 ifeq ($(USE_MD5_PASSWORDS),y)
93 OBJCOPY = $(CROSS)objcopy
95 all: yaboot addnote mkofboot
97 lgcc = `$(CC) -print-libgcc-file-name`
100 $(LD) $(LFLAGS) $(OBJS) $(LLIBS) $(lgcc) -o second/$@
101 chmod -x second/yaboot
104 $(HOSTCC) $(HOSTCFLAGS) -o util/addnote util/addnote.c
107 $(HOSTCC) $(HOSTCFLAGS) -o util/elfextract util/elfextract.c
110 ln -sf ybin ybin/mkofboot
113 $(CC) $(CFLAGS) -c -o $@ $<
116 $(CC) $(CFLAGS) -D__ASSEMBLY__ -c -o $@ $<
119 makedepend -Iinclude *.c lib/*.c util/*.c gui/*.c
122 mkdir ../yaboot-binary-${VERSION}
123 ${GETROOT} make ROOT=../yaboot-binary-${VERSION} install
124 mkdir -p -m 755 ../yaboot-binary-${VERSION}/usr/local/share/doc/yaboot
125 cp -a COPYING ../yaboot-binary-${VERSION}/usr/local/share/doc/yaboot/COPYING
126 cp -a README ../yaboot-binary-${VERSION}/usr/local/share/doc/yaboot/README
127 mv ../yaboot-binary-${VERSION}/etc/yaboot.conf ../yaboot-binary-${VERSION}/usr/local/share/doc/
128 rmdir ../yaboot-binary-${VERSION}/etc
129 ${GETROOT} tar -C ../yaboot-binary-${VERSION} -zcvpf ../yaboot-binary-${VERSION}.tar.gz .
130 rm -rf ../yaboot-binary-${VERSION}
133 rm -f second/yaboot util/addnote util/elfextract $(OBJS)
134 find . -name '#*' | xargs rm -f
135 find . -name '.#*' | xargs rm -f
136 find . -name '*~' | xargs rm -f
138 chmod 755 ybin/ybin ybin/ofpath ybin/yabootconfig
139 chmod -R u+rwX,go=rX .
144 strip --remove-section=.comment second/yaboot
146 strip --remove-section=.comment --remove-section=.note util/addnote
149 install -d -o root -g root -m 0755 ${ROOT}/etc/
150 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/sbin/
151 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/lib
152 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/lib/yaboot
153 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man5/
154 install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man8/
155 install -o root -g root -m 0644 second/yaboot ${ROOT}/$(PREFIX)/lib/yaboot
156 install -o root -g root -m 0755 util/addnote ${ROOT}/${PREFIX}/lib/yaboot/addnote
157 install -o root -g root -m 0644 first/ofboot ${ROOT}/${PREFIX}/lib/yaboot/ofboot
158 install -o root -g root -m 0755 ybin/ofpath ${ROOT}/${PREFIX}/sbin/ofpath
159 install -o root -g root -m 0755 ybin/ybin ${ROOT}/${PREFIX}/sbin/ybin
160 install -o root -g root -m 0755 ybin/yabootconfig ${ROOT}/${PREFIX}/sbin/yabootconfig
161 rm -f ${ROOT}/${PREFIX}/sbin/mkofboot
162 ln -s ybin ${ROOT}/${PREFIX}/sbin/mkofboot
164 install -o root -g root -m 0644 man/bootstrap.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/bootstrap.8.gz
165 install -o root -g root -m 0644 man/mkofboot.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/mkofboot.8.gz
166 install -o root -g root -m 0644 man/ofpath.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/ofpath.8.gz
167 install -o root -g root -m 0644 man/yaboot.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/yaboot.8.gz
168 install -o root -g root -m 0644 man/yabootconfig.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/yabootconfig.8.gz
169 install -o root -g root -m 0644 man/ybin.8.gz ${ROOT}/${PREFIX}/${MANDIR}/man8/ybin.8.gz
170 install -o root -g root -m 0644 man/yaboot.conf.5.gz ${ROOT}/${PREFIX}/${MANDIR}/man5/yaboot.conf.5.gz
172 @[ ! -e ${ROOT}/etc/yaboot.conf ] && install -o root -g root -m 0644 etc/yaboot.conf ${ROOT}/etc/yaboot.conf
174 @echo "Installation successful."
176 @echo "An example /etc/yaboot.conf has been installed (unless /etc/yaboot.conf already existed"
177 @echo "You may either alter that file to match your system, or alternatively run yabootconfig"
178 @echo "yabootconfig will generate a simple and valid /etc/yaboot.conf for your system"
182 rm -f ${ROOT}/${PREFIX}/sbin/ofpath
183 rm -f ${ROOT}/${PREFIX}/sbin/ybin
184 rm -f ${ROOT}/${PREFIX}/sbin/yabootconfig
185 rm -f ${ROOT}/${PREFIX}/sbin/mkofboot
186 rm -f ${ROOT}/${PREFIX}/lib/yaboot/yaboot
187 rm -f ${ROOT}/${PREFIX}/lib/yaboot/ofboot
188 rm -f ${ROOT}/${PREFIX}/lib/yaboot/addnote
189 @rmdir ${ROOT}/${PREFIX}/lib/yaboot || true
190 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/bootstrap.8.gz
191 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/mkofboot.8.gz
192 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/ofpath.8.gz
193 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/yaboot.8.gz
194 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/yabootconfig.8.gz
195 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man8/ybin.8.gz
196 rm -f ${ROOT}/${PREFIX}/${MANDIR}/man5/yaboot.conf.5.gz
197 @if [ -L ${ROOT}/boot/yaboot -a ! -e ${ROOT}/boot/yaboot ] ; then rm -f ${ROOT}/boot/yaboot ; fi
198 @if [ -L ${ROOT}/boot/ofboot.b -a ! -e ${ROOT}/boot/ofboot.b ] ; then rm -f ${ROOT}/boot/ofboot.b ; fi
200 @echo "Deinstall successful."
201 @echo "${ROOT}/etc/yaboot.conf has not been removed, you may remove it yourself if you wish."