From d44e9483b0da0f2860d17766a5b3cb331d0ef4d2 Mon Sep 17 00:00:00 2001 From: simonb Date: Sat, 27 Mar 1999 07:17:50 +0000 Subject: [PATCH] Go back to a Makefile.booters scheme, like most other ports do. No more problems for "make depend" - tested with and without obj dirs. --- 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(-) create mode 100644 sys/arch/pmax/stand/Makefile.booters delete mode 100644 sys/arch/pmax/stand/Makefile.inc diff --git a/sys/arch/pmax/stand/Makefile.booters b/sys/arch/pmax/stand/Makefile.booters new file mode 100644 index 000000000000..ad2f368998c9 --- /dev/null +++ b/sys/arch/pmax/stand/Makefile.booters @@ -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 + +# be sure to turn off any PIC flags for standalone library code. +CPICFLAGS= +CAPICFLAGS= +CPPPICFLAGS= +APICFLAGS= diff --git a/sys/arch/pmax/stand/Makefile.inc b/sys/arch/pmax/stand/Makefile.inc deleted file mode 100644 index e73c8eac52bb..000000000000 --- a/sys/arch/pmax/stand/Makefile.inc +++ /dev/null @@ -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 --git a/sys/arch/pmax/stand/boot/Makefile b/sys/arch/pmax/stand/boot/Makefile index 49bacc6f4984..066b064ac285 100644 --- a/sys/arch/pmax/stand/boot/Makefile +++ b/sys/arch/pmax/stand/boot/Makefile @@ -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 +SRCS+= bcmp.c bzero.c +.PATH: $S/lib/libkern -MKMAN= no -LDBUG= -T $S/arch/mips/conf/stand.ldscript +# Copy boot to / as well. +afterinstall: + cp -p ${DESTDIR}${BINDIR}/${PROG} ${DESTDIR}/ -### 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} - -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} - - -#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 +.include "../Makefile.booters" diff --git a/sys/arch/pmax/stand/scsiboot/Makefile b/sys/arch/pmax/stand/scsiboot/Makefile index e0e074d687e1..c81df348ae18 100644 --- a/sys/arch/pmax/stand/scsiboot/Makefile +++ b/sys/arch/pmax/stand/scsiboot/Makefile @@ -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= start.S alloc.c bootxx.c clear_cache.S memcpy.c memset.c printf.S \ 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 +# .include +.include "../Makefile.booters"