1 1.22.4.2 nathanw # $NetBSD: Makefile,v 1.22.4.2 2002/01/08 00:26:15 nathanw Exp $ 2 1.22.4.2 nathanw 3 1.22.4.2 nathanw S= ${.CURDIR}/../../../.. 4 1.22.4.2 nathanw 5 1.22.4.2 nathanw PROG= ofwboot 6 1.22.4.2 nathanw FILES= ${PROG}.elf ${PROG}.xcf 7 1.22.4.2 nathanw SRCS= Locore.c boot.c ofdev.c hfs.c net.c netif_of.c vers.c 8 1.22.4.2 nathanw XCOFFXTRA= Xcoffxtra.c 9 1.22.4.2 nathanw XCOFFXTRAOBJ= Xcoffxtra.o 10 1.22.4.2 nathanw CFLAGS+= -msoft-float -Wno-main 11 1.22.4.2 nathanw #CFLAGS+= -DDEBUG -DNETIF_DEBUG 12 1.22.4.2 nathanw CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP -I${.CURDIR} 13 1.22.4.2 nathanw DBG= -Os -mmultiple 14 1.22.4.2 nathanw 15 1.22.4.2 nathanw .PATH: ${S}/arch/powerpc/powerpc 16 1.22.4.2 nathanw SRCS+= ofwmagic.S 17 1.22.4.2 nathanw 18 1.22.4.2 nathanw NOMAN= # defined 19 1.22.4.2 nathanw STRIPFLAG= 20 1.22.4.2 nathanw BINMODE= 444 21 1.22.4.2 nathanw 22 1.22.4.2 nathanw .if !defined(FIXCOFF) 23 1.22.4.2 nathanw .include <bsd.own.mk> 24 1.22.4.2 nathanw 25 1.22.4.2 nathanw FIXCOFFDIR!= cd ${.CURDIR}/../fixcoff && ${PRINTOBJDIR} 26 1.22.4.2 nathanw FIXCOFF= ${FIXCOFFDIR}/fixcoff 27 1.22.4.2 nathanw FIXCOFFTARG= ${FIXCOFF} 28 1.22.4.2 nathanw 29 1.22.4.2 nathanw ${FIXCOFF}: 30 1.22.4.2 nathanw (cd ${.CURDIR}/../fixcoff; ${MAKE}) 31 1.22.4.2 nathanw 32 1.22.4.2 nathanw .else 33 1.22.4.2 nathanw FIXCOFFTARG= 34 1.22.4.2 nathanw .endif 35 1.22.4.2 nathanw 36 1.22.4.2 nathanw NEWVERSWHAT= "OpenFirmware Boot" 37 1.22.4.2 nathanw 38 1.22.4.2 nathanw # For now... 39 1.22.4.2 nathanw #RELOC= 20000 40 1.22.4.2 nathanw RELOC= 600000 41 1.22.4.2 nathanw 42 1.22.4.2 nathanw ENTRY= _start 43 1.22.4.2 nathanw 44 1.22.4.2 nathanw CLEANFILES+= vers.c ${PROG}.elf ${PROG}.mrg ${PROG}.xcf 45 1.22.4.2 nathanw 46 1.22.4.2 nathanw CPPFLAGS+= -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../.. 47 1.22.4.2 nathanw CPPFLAGS+= -DRELOC=0x${RELOC} 48 1.22.4.2 nathanw #CPPFLAGS+= -DXCOFF_GLUE # for booting PCI Powermacs 49 1.22.4.2 nathanw 50 1.22.4.2 nathanw CLEANFILES+= ${XCOFFXTRAOBJ} 51 1.22.4.2 nathanw 52 1.22.4.2 nathanw .BEGIN: 53 1.22.4.2 nathanw @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine 54 1.22.4.2 nathanw @[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc 55 1.22.4.2 nathanw .NOPATH: machine powerpc 56 1.22.4.2 nathanw CLEANFILES+= machine powerpc 57 1.22.4.2 nathanw 58 1.22.4.2 nathanw ### find out what to use for libkern 59 1.22.4.2 nathanw KERN_AS= library 60 1.22.4.2 nathanw .include "${S}/lib/libkern/Makefile.inc" 61 1.22.4.2 nathanw LIBKERN= ${KERNLIB} 62 1.22.4.2 nathanw 63 1.22.4.2 nathanw ### find out what to use for libz 64 1.22.4.2 nathanw Z_AS= library 65 1.22.4.2 nathanw .include "${S}/lib/libz/Makefile.inc" 66 1.22.4.2 nathanw LIBZ= ${ZLIB} 67 1.22.4.2 nathanw 68 1.22.4.2 nathanw ### find out what to use for libsa 69 1.22.4.2 nathanw SA_AS= library 70 1.22.4.2 nathanw SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 71 1.22.4.2 nathanw .include "${S}/lib/libsa/Makefile.inc" 72 1.22.4.2 nathanw LIBSA= ${SALIB} 73 1.22.4.2 nathanw 74 1.22.4.2 nathanw .PHONY: vers.c 75 1.22.4.2 nathanw vers.c: version 76 1.22.4.2 nathanw sh ${S}/conf/newvers_stand.sh ${.CURDIR}/version "macppc" ${NEWVERSWHAT} 77 1.22.4.2 nathanw 78 1.22.4.2 nathanw ${PROG}: ${OBJS} ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} ${FIXCOFFTARG} 79 1.22.4.2 nathanw ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \ 80 1.22.4.2 nathanw ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 81 1.22.4.2 nathanw ${OBJCOPY} -O binary ${PROG}.elf ${PROG} 82 1.22.4.2 nathanw ${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \ 83 1.22.4.2 nathanw -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg ${XCOFFXTRAOBJ} \ 84 1.22.4.2 nathanw ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 85 1.22.4.2 nathanw ${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \ 86 1.22.4.2 nathanw ${PROG}.mrg ${PROG}.xcf 87 1.22.4.2 nathanw ${FIXCOFF} ${PROG}.xcf 88 1.22.4.2 nathanw 89 1.22.4.2 nathanw .include <bsd.prog.mk> 90