Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/pmax/stand Go back to a Makefile.booters scheme, li...



details:   https://anonhg.NetBSD.org/src/rev/6db4bedac8e5
branches:  trunk
changeset: 467690:6db4bedac8e5
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sat Mar 27 07:17:50 1999 +0000

description:
Go back to a Makefile.booters scheme, like most other ports do.  No
more problems for "make depend" - tested with and without obj dirs.

diffstat:

 sys/arch/pmax/stand/Makefile.booters  |  87 +++++++++++++++++++++++++++++++++++
 sys/arch/pmax/stand/Makefile.inc      |  36 --------------
 sys/arch/pmax/stand/boot/Makefile     |  63 ++++++-------------------
 sys/arch/pmax/stand/scsiboot/Makefile |  36 +++++--------
 4 files changed, 116 insertions(+), 106 deletions(-)

diffs (274 lines):

diff -r 2d998506d445 -r 6db4bedac8e5 sys/arch/pmax/stand/Makefile.booters
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/pmax/stand/Makefile.booters      Sat Mar 27 07:17:50 1999 +0000
@@ -0,0 +1,87 @@
+#      $NetBSD: Makefile.booters,v 1.18 1999/03/27 07:17:50 simonb Exp $
+#
+#      NOTE: $S must correspond to the top of the 'sys' tree
+
+BINDIR?=/usr/mdec
+BINMODE?=444
+
+.BEGIN: ${.OBJDIR}/machine ${.OBJDIR}/mips
+${PROG} depend all: ${.OBJDIR}/machine ${.OBJDIR}/mips
+CLEANFILES+= machine mips
+
+${.OBJDIR}/machine:
+       -rm -f ${.TARGET}
+       ln -s $S/arch/${MACHINE}/include ${.TARGET}
+
+${.OBJDIR}/mips:
+       -rm -f ${.TARGET}
+       ln -s $S/arch/mips/include mips
+
+CLEANFILES+=vers.c vers.o ${PROG}.map
+
+# Tailor C compilation for standalone environment.
+COPTS= -Os                             # -Os gives smaller code
+
+C_MACHDEP=-mmemcpy -mno-abicalls -G 128        # even smaller code
+
+DEFS?= -DSMALL -D_STANDALONE -D_NO_PROM_DEFINES -DNO_ABICALLS \
+       ${BOOTDEFADD}
+INCL?= -nostdinc -I${.OBJDIR} -I$S -I${PMAX_STAND_DIR}/lib -I$S/lib/libsa
+
+CFLAGS+=       ${CWARN} ${C_MACHDEP}
+AFLAGS+=       -D_LOCORE -D_KERNEL
+CPPFLAGS+=     ${DEFS} ${INCL}
+
+LDBUG= -T $S/arch/mips/conf/stand.ldscript
+
+# We don't need libkern/libsa for the first stage bootblocks
+.if ${PROG} != "bootxx"
+
+### find out what to use for libsa
+SA_AS=         library
+.include "${S}/lib/libsa/Makefile.inc"
+LIBSA=         ${SALIB}
+SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no
+
+### find out what to use for libz
+Z_AS=          library
+.include "${S}/lib/libz/Makefile.inc"
+LIBZ=          ${ZLIB}
+
+### find out what to use for libkern
+KERN_AS=       library
+.include "${S}/lib/libkern/Makefile.inc"
+LIBKERN=       ${KERNLIB}
+
+.endif # ${PROG} != "bootxx"
+
+PMAX_STAND_DIR?= $S/arch/pmax/stand
+### find out what to use for libpmax
+PMAXDIR= ${PMAX_STAND_DIR}/lib
+.include "${PMAXDIR}/Makefile.inc"
+LIBPMAX=               ${PMAXLIB}
+
+cleandir distclean: cleanlibdir
+
+cleanlibdir:
+       rm -rf lib
+
+LIBS=  ${LIBPMAX} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBPMAX}
+VERS_O?=vers.o
+
+vers.o:        ${VERSIONFILE}
+       sh ${PMAX_STAND_DIR}/lib/newvers.sh ${.ALLSRC} ${NEWVERSWHAT}
+       ${COMPILE.c} vers.c
+
+${PROG}: ${OBJS} ${VERS_O} ${LIBS}
+       ld -Map ${PROG}.map -N -x -Ttext ${RELOC} ${LDBUG} -e start \
+           ${OBJS} ${VERS_O} ${LIBS} -o ${PROG}
+
+
+.include <bsd.prog.mk>
+
+# be sure to turn off any PIC flags for standalone library code.
+CPICFLAGS=
+CAPICFLAGS=
+CPPPICFLAGS=
+APICFLAGS=
diff -r 2d998506d445 -r 6db4bedac8e5 sys/arch/pmax/stand/Makefile.inc
--- a/sys/arch/pmax/stand/Makefile.inc  Sat Mar 27 07:11:35 1999 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#      $NetBSD: Makefile.inc,v 1.9 1999/03/26 02:12:17 simonb Exp $
-#
-#      NOTE: $S must correspond to the top of the 'sys' tree
-
-BINDIR?=/usr/mdec
-BINMODE?=444
-
-.BEGIN: machine
-depend all ${SRCS} ${OBJS}: machine
-CLEANFILES+= machine mips
-
-# Do `mips' link here too - can't just depend on target mips
-# because make finds sys/lib/libkern/mips...
-machine:
-       -rm -f ${.TARGET} mips
-       ln -s $S/arch/${MACHINE}/include ${.TARGET}
-       ln -s $S/arch/mips/include mips
-
-# Tailor C compilation for standalone environment.
-COPTS= -Os                             # -Os gives smaller code
-
-C_MACHDEP=-mmemcpy -mno-abicalls -G 128        # even smaller code
-
-DEFS?= -DSMALL -D_STANDALONE -D_NO_PROM_DEFINES -DNO_ABICALLS \
-       ${BOOTDEFADD}
-INCL?= -nostdinc -I${.OBJDIR} -I$S -I${PMAX_STAND_DIR}/lib -I$S/lib/libsa
-
-CFLAGS+=       ${CWARN} ${C_MACHDEP}
-AFLAGS+=       -D_LOCORE -D_KERNEL
-CPPFLAGS+=     ${DEFS} ${INCL}
-
-# be sure to turn off any PIC flags for standalone library code.
-CPICFLAGS=
-CAPICFLAGS=
-CPPPICFLAGS=
-APICFLAGS=
diff -r 2d998506d445 -r 6db4bedac8e5 sys/arch/pmax/stand/boot/Makefile
--- a/sys/arch/pmax/stand/boot/Makefile Sat Mar 27 07:11:35 1999 +0000
+++ b/sys/arch/pmax/stand/boot/Makefile Sat Mar 27 07:17:50 1999 +0000
@@ -1,56 +1,23 @@
-#      $NetBSD: Makefile,v 1.2 1999/03/26 02:07:55 simonb Exp $
+#      $NetBSD: Makefile,v 1.3 1999/03/27 07:17:51 simonb Exp $
 #      @(#)Makefile    8.3 (Berkeley) 2/16/94
 
-RELOC_BOOT=80710000
-
 S=     ${.CURDIR}/../../../..
 
-PROG=  boot
-BINDIR=        /
-BINMODE=555
-SRCS=  start.S boot.c # bootinfo.c callvec.c conf.c \
-NEWVERSWHAT="Secondary Boot"
-CLEANFILES+=vers.c vers.o
-CLEANFILES+=${PROG}.map
-.PATH: ${.CURDIR}/../lib
+PROG=          boot
+RELOC=         80710000
+BINMODE=       555
+MKMAN=         no
+SRCS=          start.S boot.c
+NEWVERSWHAT=   "Secondary Boot"
+VERSIONFILE=   ${.CURDIR}/version
+.PATH:         ${.CURDIR}/../lib
 
 # XXX These aren't build by libkern at the moment - fix libkern?
-SRCS+= bcmp.c bzero.c
-.PATH: $S/lib/libkern
-
-MKMAN= no
-LDBUG= -T $S/arch/mips/conf/stand.ldscript
-
-### find out what to use for libsa
-SA_AS=         library
-.include "${S}/lib/libsa/Makefile.inc"
-LIBSA=         ${SALIB}
-SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no
-
-### find out what to use for libz
-Z_AS=          library
-.include "${S}/lib/libz/Makefile.inc"
-LIBZ=          ${ZLIB}
+SRCS+=         bcmp.c bzero.c
+.PATH:         $S/lib/libkern
 
-### find out what to use for libkern
-KERN_AS=       library
-.include "${S}/lib/libkern/Makefile.inc"
-LIBKERN=       ${KERNLIB}
-
-PMAX_STAND_DIR?= $S/arch/pmax/stand
-### find out what to use for libpmax
-PMAXDIR= ${PMAX_STAND_DIR}/lib
-.include "${PMAXDIR}/Makefile.inc"
-LIBPMAX=               ${PMAXLIB}
+# Copy boot to / as well.
+afterinstall:
+       cp -p ${DESTDIR}${BINDIR}/${PROG} ${DESTDIR}/
 
-
-#LIBS= ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBPMAX}
-LIBS=  ${LIBPMAX} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBPMAX}
-
-${PROG}: ${OBJS} ${LIBS}
-       sh ${.CURDIR}/../lib/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
-       ${COMPILE.c} vers.c
-       ld -Map ${PROG}.map -N -Ttext ${RELOC_BOOT} ${LDBUG} -e start \
-               ${OBJS} vers.o ${LIBS} -o ${PROG}
-
-.include <bsd.prog.mk>
+.include "../Makefile.booters"
diff -r 2d998506d445 -r 6db4bedac8e5 sys/arch/pmax/stand/scsiboot/Makefile
--- a/sys/arch/pmax/stand/scsiboot/Makefile     Sat Mar 27 07:11:35 1999 +0000
+++ b/sys/arch/pmax/stand/scsiboot/Makefile     Sat Mar 27 07:17:50 1999 +0000
@@ -1,11 +1,13 @@
-#      $NetBSD: Makefile,v 1.8 1999/03/25 12:26:32 simonb Exp $
+#      $NetBSD: Makefile,v 1.9 1999/03/27 07:17:51 simonb Exp $
 #      @(#)Makefile    8.3 (Berkeley) 2/16/94
 
-RELOC_BOOTXX=80700000  # Room for an almost 7MB kernel
-
 S=     ${.CURDIR}/../../../..
 
 PROG=  bootxx
+RELOC= 80700000        # Room for an almost 7MB kernel
+VERS_O=                        # no version info in first stage
+MKMAN= no
+
 SRCS=  start.S alloc.c bootxx.c clear_cache.S memcpy.c memset.c printf.S \
        strcmp.S strcpy.S strlen.S twiddle.c
 
@@ -13,38 +15,28 @@
 SRCS+= disklabel.c dkcksum.c lseek.c open.c read.c ufs.c
 # from sys/lib/libkern:
 SRCS+= bcmp.c
-CLEANFILES+=${PROG}.elf ${PROG}.map ${ALL}
+CLEANFILES+=${PROG}.aout ${PROG}.map mkboot ${ALL}
 .PATH:  ${.CURDIR}/../lib $S/lib/libsa $S/lib/libkern
 
-BOOTDEFADD+=-DBOOTXX -DRELOC=0x${RELOC_BOOTXX} -DUFS_NOCLOSE -DUFS_NOSYMLINK \
+BOOTDEFADD+=-DBOOTXX -DRELOC=0x${RELOC} -DUFS_NOCLOSE -DUFS_NOSYMLINK \
        -DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET
 
-MKMAN= no
-LDBUG= -T $S/arch/mips/conf/stand.ldscript
-
-ALL=   bootxx mkboot rzboot bootrz
+ALL=   rzboot bootrz
 
 all:   ${ALL}
 
-PMAX_STAND_DIR?= $S/arch/pmax/stand
-### find out what to use for libpmax
-PMAXDIR= ${PMAX_STAND_DIR}/lib
-.include "${PMAXDIR}/Makefile.inc"
-LIBPMAX=               ${PMAXLIB}
-
-${PROG}: ${OBJS} ${LIBPMAX}
-       ld -Map ${PROG}.map -N -x -Ttext ${RELOC_BOOTXX} ${LDBUG} \
-               -e start ${OBJS} ${LIBPMAX} -o ${PROG}.elf
-       elf2aout ${PROG}.elf ${PROG}
+${PROG}.aout: ${PROG}
+       elf2aout ${PROG} ${PROG}.aout
 
 mkboot:        ${.CURDIR}/mkboot.c
        ${CC} ${CPPFLAGS} -I${DESTDIR}/usr/include -o mkboot ${.IMPSRC}
 
-rzboot bootrz: mkboot ${PROG}
-       ./mkboot ${PROG} rzboot bootrz
+rzboot bootrz: ${PROG}.aout mkboot
+       ./mkboot ${PROG}.aout rzboot bootrz
 
 proginstall:: bootrz rzboot
        ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
                ${.ALLSRC} ${DESTDIR}${BINDIR}
 
-.include <bsd.prog.mk>
+# .include <bsd.prog.mk>
+.include "../Makefile.booters"



Home | Main Index | Thread Index | Old Index