1 # $NetBSD: Makefile,v 1.17 2000/02/21 14:41:24 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 20 OBJS=${SRCS:N*.h:N*.sh:N*.fth:R:S/$/.o/g} 21 22 OBJCOPY?= objcopy 23 24 LINKFLAGS=-N -e start 25 26 .MAIN: all 27 all: ${FILES} 28 29 30 vers.c: 31 sh ${.CURDIR}/../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} 32 33 .for RELOC in ${RELOCS} 34 boot.${RELOC}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 35 ${LD} -o ${.TARGET}.tmp ${LINKFLAGS} -Ttext ${RELOC} ${OBJS} \ 36 ${LIBSA} ${LIBZ} ${LIBKERN} 37 ${SIZE} ${.TARGET}.tmp 38 ${OBJCOPY} -O binary ${.TARGET}.tmp ${.TARGET} 39 rm -f ${.TARGET}.tmp 40 .endfor 41 42 43 # conjure up a magic header that is accepted by all Sun PROMS; 44 # see installboot.c for details. 45 boot.net: boot.${RELOC_DEFAULT} 46 (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} 47 48 clean cleandir: cleanprog 49 50 cleanprog: 51 rm -f ${OBJS} ${CLEANFILES} 52 53 .include <bsd.files.mk> 54 .include <bsd.links.mk> 55 .include <bsd.sys.mk> 56