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.
This commit is contained in:
parent
7f9ffda65e
commit
ad51219ae3
|
@ -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
|
||||
|
|
|
@ -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; \
|
||||
|
|
|
@ -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 <bsd.own.mk>
|
||||
|
||||
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue