1995-01-18 09:53:36 +03:00
|
|
|
# $NetBSD: Makefile.booters,v 1.5 1995/01/18 06:53:36 mellon Exp $
|
1994-10-27 00:08:38 +03:00
|
|
|
# @(#)Makefile 8.3 (Berkeley) 2/16/94
|
1993-10-12 06:22:19 +03:00
|
|
|
|
|
|
|
DESTDIR=
|
|
|
|
STAND= ../../stand
|
1995-01-18 09:53:36 +03:00
|
|
|
#VPATH= ${STAND}
|
1993-10-12 06:22:19 +03:00
|
|
|
|
|
|
|
# RELOC=80200000 allows for boot prog up to 1D0000 (1900544) bytes long
|
|
|
|
RELOC= 80200000
|
|
|
|
|
1995-01-18 09:53:36 +03:00
|
|
|
S= ${.CURDIR}/../../..
|
|
|
|
|
1994-05-27 12:40:50 +04:00
|
|
|
DEFS= -DSTANDALONE -DSMALL
|
|
|
|
CFLAGS= -O2 ${INCPATH} ${DEFS}
|
|
|
|
AFLAGS= -O2 ${INCPATH} ${DEFS} -DLOCORE
|
1993-10-12 06:22:19 +03:00
|
|
|
|
1995-01-18 09:53:36 +03:00
|
|
|
.PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
|
|
|
|
.PATH: ${S}/stand ${S}/lib/libsa
|
|
|
|
|
|
|
|
#INCPATH=-I. -I/sys
|
|
|
|
INCPATH=-I${.CURDIR} -I${.CURDIR}/../.. -I${S} -I${S}/lib/libsa
|
|
|
|
|
|
|
|
### find out what to use for libkern
|
|
|
|
.include "$S/lib/libkern/Makefile.inc"
|
|
|
|
#LIBKERN= ${KERNLIB}
|
|
|
|
#KERNLIB= ${.CURDIR}/../compile/libkern.a
|
|
|
|
|
|
|
|
.include "$S/lib/libsa/Makefile.inc"
|
|
|
|
LIBSA= ${SA_LIB}
|
|
|
|
|
|
|
|
# not yet: need to write libsa/Makefile.inc first
|
|
|
|
LIBS= ${.OBJDIR}/libdrive.a ${.CURDIR}/libsa/libsa.a ${KERNLIB}
|
|
|
|
#LIBS= libdrive.a libsa/libsa.a ../../libkern/obj/libkern.a
|
|
|
|
|
1993-10-12 06:22:19 +03:00
|
|
|
DRIVERS= rz.c
|
|
|
|
SRCS= ${DRIVERS}
|
1995-01-18 09:53:36 +03:00
|
|
|
#STUFF= callvec.c devopen.c getenv.c gets.c strcmp.c
|
|
|
|
STUFF=
|
1993-10-12 06:22:19 +03:00
|
|
|
|
1995-01-18 09:53:36 +03:00
|
|
|
ALL= boot mkboot mkboottape dec_label rzboot bootrz
|
1993-10-12 06:22:19 +03:00
|
|
|
|
|
|
|
.s.o:
|
|
|
|
${CPP} -E ${CFLAGS:M-[ID]*} ${AINC} ${.IMPSRC} | \
|
|
|
|
${AS} -o ${.TARGET}
|
|
|
|
|
|
|
|
all: ${ALL}
|
|
|
|
|
|
|
|
boot: ${LIBS}
|
|
|
|
|
1995-01-18 09:53:36 +03:00
|
|
|
#libsa/libsa.a::
|
|
|
|
# cd libsa; make
|
1993-10-12 06:22:19 +03:00
|
|
|
|
1995-01-18 09:53:36 +03:00
|
|
|
${.OBJDIR}/libdrive.a: conf.o ${DRIVERS:.c=.o}
|
1993-10-12 06:22:19 +03:00
|
|
|
ar crv $@ $?
|
|
|
|
ranlib $@
|
|
|
|
|
|
|
|
# depend on DEFS
|
|
|
|
|
1995-01-18 09:53:36 +03:00
|
|
|
#before other deps on bootconf.o
|
1993-10-12 06:22:19 +03:00
|
|
|
bootconf.o: conf.o
|
|
|
|
rm -f bootconf.c
|
1995-01-18 09:53:36 +03:00
|
|
|
ln -s ${.CURDIR}/conf.c bootconf.c
|
1993-10-12 06:22:19 +03:00
|
|
|
${CC} -c ${CFLAGS} -DBOOT bootconf.c
|
|
|
|
rm -f bootconf.c
|
|
|
|
|
|
|
|
|
1995-01-18 09:53:36 +03:00
|
|
|
# bootable from real disks
|
|
|
|
|
|
|
|
boot: start.o boot.o bootconf.o filesystem.o ${LIBS}
|
|
|
|
ld -Map boot.map -N -Ttext ${RELOC} -e start start.o boot.o bootconf.o filesystem.o ${LIBS} -o boot.elf
|
|
|
|
elf2aout boot.elf boot
|
|
|
|
|
|
|
|
start.o: ${.CURDIR}/start.S
|
|
|
|
|
|
|
|
# ${CPP} -E ${CFLAGS:M-[ID]*} -DLOCORE ${AINC} ${.IMPSRC} | \
|
|
|
|
# ${AS} -o ${.TARGET}
|
1993-10-12 06:22:19 +03:00
|
|
|
|
1995-01-18 09:53:36 +03:00
|
|
|
mkboot: ${.CURDIR}/mkboot.c
|
|
|
|
${CC} ${CFLAGS} -o mkboot ${.CURDIR}/mkboot.c
|
|
|
|
|
|
|
|
mkboottape: ${.CURDIR}/mkboottape.c
|
|
|
|
${CC} ${CFLAGS} -o mkboottape ${.CURDIR}/mkboottape.c
|
|
|
|
|
|
|
|
dec_label: ${.CURDIR}/dec_label.c
|
|
|
|
${CC} ${CFLAGS} -o dec_label ${.CURDIR}/dec_label.c
|
|
|
|
|
|
|
|
rzboot bootrz: mkboot boot
|
|
|
|
./mkboot boot rzboot bootrz
|
1994-05-27 12:40:50 +04:00
|
|
|
|
1993-10-12 06:22:19 +03:00
|
|
|
# utilities
|
|
|
|
|
|
|
|
clean cleandir:
|
|
|
|
rm -f .depend *.o *.exe *.i errs make.out core*
|
1994-05-27 12:40:50 +04:00
|
|
|
rm -f a.out ${ALL}
|
1993-10-12 06:22:19 +03:00
|
|
|
rm -f boot[a-z][a-z] [a-z][a-z]boot
|
1994-05-27 12:40:50 +04:00
|
|
|
rm -f libdrive.a
|
1993-10-12 06:22:19 +03:00
|
|
|
cd libsa; make cleandir
|
|
|
|
|
|
|
|
install:
|
|
|
|
./mkboot boot rzboot bootrz
|
1994-05-27 12:40:50 +04:00
|
|
|
install -o bin -g bin -m 444 rzboot ${DESTDIR}/usr/mdec
|
|
|
|
install -o bin -g bin -m 444 bootrz ${DESTDIR}/usr/mdec
|
1993-10-12 06:22:19 +03:00
|
|
|
|
|
|
|
depend: ${SRCS}
|
|
|
|
mkdep ${INCPATH} ${DEFS} ${SRCS}
|
|
|
|
mkdep -a -p ${INCPATH} ${DEFS} mkboot.c mkboottape.c
|
|
|
|
cd libsa; make depend
|
1995-01-18 09:53:36 +03:00
|
|
|
|
|
|
|
.include <bsd.dep.mk>
|
|
|
|
.include <bsd.obj.mk>
|