diff options
author | ru <ru@FreeBSD.org> | 2002-03-15 11:27:47 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-03-15 11:27:47 +0000 |
commit | 167a3a1729cb23c5de15803679bc49f621e4a46b (patch) | |
tree | 05224a937c802de955e99c8b158fd16426b5bdbd /usr.sbin/sysinstall/Makefile | |
parent | 8da9958ecceab29614ba40b937f6f2ef3c3908c4 (diff) | |
download | FreeBSD-src-167a3a1729cb23c5de15803679bc49f621e4a46b.zip FreeBSD-src-167a3a1729cb23c5de15803679bc49f621e4a46b.tar.gz |
Embed boot images built as part of buildworld rather than the
installed ones under /boot (which we may not even have in the
case of a cross build).
This introduced chicken and egg problem - we need boot images
early in the "depend" stage but they have not yet been built.
Work around this by excluding the generated makeboot.c source
from the "depend" list; it's okay because we hardcode all its
dependencies explicitly. We actually lose the dependency bit
on <sys/types.h> but it's probably okay too as the only thing
we use is the u_char datatype and this is unlikely to change.
After all, it's normal for sloppy cleaning to cause problems.
beast.FreeBSD.org running 5.0-CURRENT alpha has been able to
cross build i386 world with this patch.
Prodded by: gallatin
Diffstat (limited to 'usr.sbin/sysinstall/Makefile')
-rw-r--r-- | usr.sbin/sysinstall/Makefile | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile index f5074e3..658c3e7 100644 --- a/usr.sbin/sysinstall/Makefile +++ b/usr.sbin/sysinstall/Makefile @@ -53,17 +53,45 @@ makedevs.c: Makefile rtermcap ./rtermcap xterm | \ file2c 'const char termcap_xterm[] = {' ',0};' \ >> makedevs.c + +.if ${MACHINE_ARCH} == i386 +# XXX boot images aren't yet ready when "make depend" is run +.if !make(depend) +SRCS+= makeboot.c +.endif +CLEANFILES+= makeboot.c +.if exists(${.OBJDIR}/../../sys/boot/${MACHINE}/boot0/boot0) +BOOT0= ${.OBJDIR}/../../sys/boot/${MACHINE}/boot0/boot0 +.else +BOOT0= /boot/boot0 +.endif +makeboot.c: ${BOOT0} .if ${MACHINE} == "i386" - file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.c - echo "size_t boot0_size = sizeof(boot0);" >> makedevs.c - file2c 'u_char mbr[] = {' '};' < /boot/mbr >> makedevs.c - echo "size_t mbr_size = sizeof(mbr);" >> makedevs.c +.if exists(${.OBJDIR}/../../sys/boot/i386/mbr/mbr) +MBR= ${.OBJDIR}/../../sys/boot/i386/mbr/mbr +.else +MBR= /boot/mbr +.endif +makeboot.c: ${MBR} +.elif ${MACHINE} == "pc98" +.if exists(${.OBJDIR}/../../sys/boot/pc98/boot0.5/boot0.5) +BOOT05= ${.OBJDIR}/../../sys/boot/pc98/boot0.5/boot0.5 +.else +BOOT05= /boot/boot0.5 +.endif +makeboot.c: ${BOOT05} +.endif +makeboot.c: Makefile + echo '#include <sys/types.h>' > makeboot.c + file2c 'u_char boot0[] = {' '};' < ${BOOT0} >> makeboot.c + echo "size_t boot0_size = sizeof(boot0);" >> makeboot.c +.if ${MACHINE} == i386 + file2c 'u_char mbr[] = {' '};' < ${MBR} >> makeboot.c + echo "size_t mbr_size = sizeof(mbr);" >> makeboot.c +.elif ${MACHINE} == "pc98" + file2c 'u_char boot05[] = {' '};' < ${BOOT05} >> makeboot.c + echo "size_t boot05_size = sizeof(boot05);" >> makeboot.c .endif -.if ${MACHINE} == "pc98" - file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.c - echo "size_t boot0_size = sizeof(boot0);" >> makedevs.c - file2c 'u_char boot05[] = {' '};' < /boot/boot0.5 >> makedevs.c - echo "size_t boot05_size = sizeof(boot05);" >> makedevs.c .endif build-tools: rtermcap |