From ad51219ae3112bce6ddb2ca09792df6ac99465bb Mon Sep 17 00:00:00 2001 From: simonb Date: Tue, 1 Jul 2003 13:36:59 +0000 Subject: [PATCH] Make this work without a populated destdir: machine and x86 symlinks. Include from right places. Don't depend on LIBCRT0,etc. Also for the bootxx programs, keep the ELF object during the build process. --- sys/arch/i386/stand/boot/Makefile.boot | 16 ++++++----- sys/arch/i386/stand/bootxx/Makefile.bootxx | 23 +++++++++------- sys/arch/i386/stand/mbr/Makefile.mbr | 31 +++++++++++++++++++--- 3 files changed, 50 insertions(+), 20 deletions(-) diff --git a/sys/arch/i386/stand/boot/Makefile.boot b/sys/arch/i386/stand/boot/Makefile.boot index 310ff7bc8c13..65dc112a324e 100644 --- a/sys/arch/i386/stand/boot/Makefile.boot +++ b/sys/arch/i386/stand/boot/Makefile.boot @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.boot,v 1.5 2003/06/30 17:54:06 thorpej Exp $ +# $NetBSD: Makefile.boot,v 1.6 2003/07/01 13:36:59 simonb Exp $ S= ${.CURDIR}/../../../../../ @@ -79,18 +79,22 @@ SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no # Netboot via TFTP, NFS I386_STAND_DIR?= $S/arch/i386/stand .if !make(obj) && !make(clean) && !make(cleandir) -.BEGIN: machine -.NOPATH: machine +.BEGIN: machine x86 +.NOPATH: machine x86 .endif -realdepend realall: machine -CLEANFILES+= machine +realdepend realall: machine x86 +CLEANFILES+= machine x86 machine:: -rm -f $@ ln -s $S/arch/i386/include $@ -${OBJS}: machine +x86:: + -rm -f $@ + ln -s $S/arch/x86/include $@ + +${OBJS}: machine x86 ### find out what to use for libi386 I386DIR= ${I386_STAND_DIR}/lib diff --git a/sys/arch/i386/stand/bootxx/Makefile.bootxx b/sys/arch/i386/stand/bootxx/Makefile.bootxx index e5bdbb2e4bed..5c90be1d7e57 100644 --- a/sys/arch/i386/stand/bootxx/Makefile.bootxx +++ b/sys/arch/i386/stand/bootxx/Makefile.bootxx @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootxx,v 1.4 2003/05/12 14:34:55 dsl Exp $ +# $NetBSD: Makefile.bootxx,v 1.5 2003/07/01 13:36:59 simonb Exp $ S= ${.CURDIR}/../../../../../ @@ -84,18 +84,22 @@ CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=xxfs \ I386_STAND_DIR?= $S/arch/i386/stand .if !make(obj) && !make(clean) && !make(cleandir) -.BEGIN: machine -.NOPATH: machine +.BEGIN: machine x86 +.NOPATH: machine x86 .endif -realdepend realall: machine -CLEANFILES+= machine +realdepend realall: machine x86 +CLEANFILES+= machine x86 machine:: -rm -f $@ ln -s $S/arch/i386/include $@ -${OBJS}: machine +x86:: + -rm -f $@ + ln -s $S/arch/x86/include $@ + +${OBJS}: machine x86 ### find out what to use for libi386 I386DIR= ${I386_STAND_DIR}/lib @@ -124,13 +128,12 @@ cleanlibdir: LIBLIST= ${LIBI386} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} -CLEANFILES+= ${PROG}.tmp ${PROG}.map +CLEANFILES+= ${PROG}.sym ${PROG}.map ${PROG}: ${OBJS} ${LIBLIST} - ${LD} -o ${PROG}.tmp ${LDFLAGS} -Ttext ${PRIMARY_LOAD_ADDRESS} \ + ${LD} -o ${PROG}.sym ${LDFLAGS} -Ttext ${PRIMARY_LOAD_ADDRESS} \ -Map ${PROG}.map -cref ${OBJS} ${LIBLIST} - ${OBJCOPY} -O binary ${PROG}.tmp ${PROG} - rm -f ${PROG}.tmp + ${OBJCOPY} -O binary ${PROG}.sym ${PROG} @ sz=$$(ls -ln ${PROG}|tr -s ' '|cut -d' ' -f5); \ if [ "$$sz" -gt "${BOOTXX_MAXSIZE}" ]; then \ echo "### ${PROG} size $$sz is larger than ${BOOTXX_MAXSIZE}" >&2; \ diff --git a/sys/arch/i386/stand/mbr/Makefile.mbr b/sys/arch/i386/stand/mbr/Makefile.mbr index f9f140136b75..152fe2eda329 100644 --- a/sys/arch/i386/stand/mbr/Makefile.mbr +++ b/sys/arch/i386/stand/mbr/Makefile.mbr @@ -1,9 +1,14 @@ -# $NetBSD: Makefile.mbr,v 1.3 2003/05/05 13:38:23 hubertf Exp $ +# $NetBSD: Makefile.mbr,v 1.4 2003/07/01 13:36:59 simonb Exp $ S= ${.CURDIR}/../../../../../ -NOMAN= # defined -STRIPFLAG= +NOMAN= # defined +STRIPFLAG= # nothing + +LIBCRT0= # nothing +LIBCRTBEGIN= # nothing +LIBCRTEND= # nothing +LIBC= # nothing .include @@ -15,13 +20,31 @@ BINMODE=444 .PATH: ${.CURDIR}/.. LDFLAGS+= -e start -CPPFLAGS+= -I ${.CURDIR}/../../lib +CPPFLAGS+= -I. -I${.CURDIR}/../../lib -I${S} .if ${MACHINE} == "amd64" LDFLAGS+= -m elf_i386 AFLAGS+= -m32 .endif +.if !make(obj) && !make(clean) && !make(cleandir) +.BEGIN: machine x86 +.NOPATH: machine x86 +.endif + +realdepend realall: machine x86 +CLEANFILES+= machine x86 + +machine:: + -rm -f $@ + ln -s $S/arch/i386/include $@ + +x86:: + -rm -f $@ + ln -s $S/arch/x86/include $@ + +${OBJS}: machine x86 + CLEANFILES+= ${PROG}.tmp ${PROG}: ${OBJS}