1 1.6.8.1 wrstuden # $NetBSD: Makefile,v 1.6.8.1 1999/12/27 18:32:44 wrstuden Exp $ 2 1.1 tsubai 3 1.1 tsubai S= ${.CURDIR}/../../../.. 4 1.1 tsubai 5 1.1 tsubai PROG= ofwboot 6 1.6 wrstuden FILES= ${PROG}.elf 7 1.1 tsubai SRCS= Locore.c boot.c ofdev.c net.c netif_of.c alloc.c 8 1.6.8.1 wrstuden XCOFFXTRA= Xcoffxtra.c 9 1.6.8.1 wrstuden XCOFFXTRAOBJ= Xcoffxtra.o 10 1.1 tsubai .PATH: ${S}/arch/powerpc/powerpc 11 1.1 tsubai SRCS+= ofwmagic.S 12 1.1 tsubai #CFLAGS+= -DDEBUG -DNETIF_DEBUG 13 1.4 lukem MKMAN= no 14 1.1 tsubai STRIPFLAG= 15 1.1 tsubai BINMODE= 444 16 1.1 tsubai OBJCOPY?= objcopy 17 1.1 tsubai 18 1.6.8.1 wrstuden .if !defined(FIXCOFF) 19 1.6.8.1 wrstuden .ifnmake(print-objdir) 20 1.6.8.1 wrstuden FIXCOFFDIR!= cd ${.CURDIR}/../fixcoff; ${MAKE} print-objdir 21 1.6.8.1 wrstuden FIXCOFF= ${FIXCOFFDIR}/fixcoff 22 1.6.8.1 wrstuden FIXCOFFTARG= ${FIXCOFF} 23 1.6.8.1 wrstuden 24 1.6.8.1 wrstuden ${FIXCOFF}: 25 1.6.8.1 wrstuden (cd ${.CURDIR}/../fixcoff; make) 26 1.6.8.1 wrstuden 27 1.6.8.1 wrstuden .endif 28 1.6.8.1 wrstuden .else 29 1.6.8.1 wrstuden FIXCOFFTARG= 30 1.6.8.1 wrstuden .endif 31 1.6.8.1 wrstuden 32 1.1 tsubai NEWVERSWHAT= "OpenFirmware Boot" 33 1.1 tsubai 34 1.1 tsubai # For now... 35 1.1 tsubai #RELOC= 20000 36 1.3 tsubai RELOC= 6c0000 37 1.1 tsubai 38 1.1 tsubai ENTRY= _start 39 1.1 tsubai 40 1.1 tsubai CLEANFILES+= vers.c vers.o ${PROG}.elf 41 1.1 tsubai 42 1.5 tsubai CPPFLAGS+= -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../.. 43 1.1 tsubai CPPFLAGS+= -DRELOC=0x${RELOC} 44 1.1 tsubai #CPPFLAGS+= -DXCOFF_GLUE # for booting PCI Powermacs 45 1.1 tsubai 46 1.6.8.1 wrstuden CLEANFILES+= ${.OBJDIR}/machine ${.OBJDIR}/powerpc ${XCOFFXTRAOBJ} 47 1.5 tsubai 48 1.5 tsubai .BEGIN: 49 1.5 tsubai @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine 50 1.5 tsubai @[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc 51 1.5 tsubai 52 1.1 tsubai ### find out what to use for libkern 53 1.1 tsubai KERN_AS= library 54 1.1 tsubai .include "${S}/lib/libkern/Makefile.inc" 55 1.1 tsubai LIBKERN= ${KERNLIB} 56 1.1 tsubai 57 1.1 tsubai ### find out what to use for libz 58 1.1 tsubai Z_AS= library 59 1.1 tsubai .include "${S}/lib/libz/Makefile.inc" 60 1.1 tsubai LIBZ= ${ZLIB} 61 1.1 tsubai 62 1.1 tsubai ### find out what to use for libsa 63 1.1 tsubai SA_AS= library 64 1.5 tsubai SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 65 1.1 tsubai .include "${S}/lib/libsa/Makefile.inc" 66 1.1 tsubai LIBSA= ${SALIB} 67 1.1 tsubai 68 1.6.8.1 wrstuden ${PROG}: ${OBJS} ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} ${FIXCOFFTARG} 69 1.1 tsubai sh ${.CURDIR}/../newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} 70 1.1 tsubai ${COMPILE.c} vers.c 71 1.6.8.1 wrstuden ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \ 72 1.1 tsubai ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN} 73 1.5 tsubai ${OBJCOPY} -O binary ${PROG}.elf ${PROG} 74 1.6.8.1 wrstuden ${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \ 75 1.6.8.1 wrstuden -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg ${XCOFFXTRAOBJ} \ 76 1.6.8.1 wrstuden ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN} 77 1.6.8.1 wrstuden ${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \ 78 1.6.8.1 wrstuden ${PROG}.mrg ${PROG}.xcf 79 1.6.8.1 wrstuden ${FIXCOFF} ${PROG}.xcf 80 1.1 tsubai 81 1.1 tsubai .include <bsd.prog.mk> 82