1 # $NetBSD: Makefile,v 1.18 2000/02/25 16:53:22 pk Exp $ 2 3 STRIPFLAG= 4 PROGSOURCE= boot.c net.c netif_sun.c conf.c openfirm.c bootinfo.c vers.c 5 NEWVERSWHAT= "Secondary Boot" 6 FILES= boot.net ${RELOCS:S/^/boot./g} 7 CLEANFILES:= vers.c ${FILES} 8 LINKS= ${BINDIR}/boot.${RELOC_DEFAULT} ${BINDIR}/boot 9 10 INCLUDE_LIBZ= yes 11 SAMISCMAKEFLAGS= SA_USE_CREAD=yes 12 13 .include "../Makefile.buildboot" 14 15 .if exists(${.CURDIR}/../Makefile.inc) 16 .include "${.CURDIR}/../Makefile.inc" 17 .endif 18 .include <bsd.own.mk> 19 .include <bsd.obj.mk> 20 21 OBJS=${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g} 22 23 OBJCOPY?= objcopy 24 25 LINKFLAGS=-N -e start 26 27 .MAIN: all 28 all: ${FILES} 29 30 31 vers.c: 32 sh ${.CURDIR}/../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} 33 34 .for RELOC in ${RELOCS} 35 boot.${RELOC}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 36 ${LD} -o ${.TARGET}.tmp ${LINKFLAGS} -Ttext ${RELOC} ${OBJS} \ 37 ${LIBSA} ${LIBZ} ${LIBKERN} 38 ${SIZE} ${.TARGET}.tmp 39 ${OBJCOPY} -O binary ${.TARGET}.tmp ${.TARGET} 40 rm -f ${.TARGET}.tmp 41 .endfor 42 43 44 # conjure up a magic header that is accepted by all Sun PROMS; 45 # see installboot.c for details. 46 boot.net: boot.${RELOC_DEFAULT} 47 (printf '\01\03\01\07\060\200\0\07\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'; cat ${.ALLSRC} ) > ${.TARGET} 48 49 clean cleandir: cleanprog 50 51 cleanprog: 52 rm -f ${OBJS} ${CLEANFILES} 53 54 .include <bsd.files.mk> 55 .include <bsd.links.mk> 56 .include <bsd.sys.mk> 57