1 # $NetBSD: Makefile,v 1.23 2008/02/13 20:11:38 garbled Exp $ 2 3 S!= cd ${.CURDIR}/../../../.. ; pwd 4 5 PROG= ofwboot 6 SRCS= ofwstart.S Locore.c boot.c ofdev.c net.c netif_of.c vers.c 7 CFLAGS+= -msoft-float -Wno-main -ffreestanding 8 #CPPFLAGS+= -g -DALLOC_TRACE -DDEBUG #-DOFW_DEBUG -DNETIF_DEBUG 9 #CPPFLAGS+= -DOFWDUMP 10 CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP -I${.CURDIR} 11 CPPFLAGS+= -DHEAP_VARIABLE 12 DBG= -Os -mmultiple 13 14 SRCS+= ofwmagic.S 15 .PATH: ${S}/arch/powerpc/powerpc 16 17 SRCS+= byteorder.c 18 .PATH: ${S}/lib/libsa 19 20 NOMAN= # defined 21 STRIPFLAG= 22 BINMODE= 444 23 24 # XXX SHOULD NOT NEED TO DEFINE THESE! 25 LIBCRT0= 26 LIBC= 27 LIBCRTBEGIN= 28 LIBCRTEND= 29 30 NEWVERSWHAT= "OpenFirmware Boot" 31 32 # For now... 33 RELOC= 20000 34 35 ENTRY= _start 36 37 CLEANFILES+= vers.c 38 39 CPPFLAGS+= -I. -I${S} -I${S}/../common/include 40 CPPFLAGS+= -DRELOC=0x${RELOC} 41 CPPFLAGS+= -DFIRMWORKSBUGS 42 CPPFLAGS+= -DCOMPAT_386BSD_MBRPART 43 44 .if !make(obj) && !make(clean) && !make(cleandir) 45 .BEGIN: 46 @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine 47 @[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc 48 .endif 49 .NOPATH: machine powerpc 50 CLEANFILES+= machine powerpc 51 52 ### find out what to use for libkern 53 KERN_AS= library 54 .include "${S}/lib/libkern/Makefile.inc" 55 LIBKERN= ${KERNLIB} 56 57 ### find out what to use for libz 58 Z_AS= library 59 .include "${S}/lib/libz/Makefile.inc" 60 LIBZ= ${ZLIB} 61 62 ### find out what to use for libsa 63 SA_AS= library 64 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 65 .include "${S}/lib/libsa/Makefile.inc" 66 LIBSA= ${SALIB} 67 68 .PHONY: vers.c 69 vers.c: version 70 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "ofppc" ${NEWVERSWHAT} 71 72 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 73 ${LD} -s -N -T ${.CURDIR}/ldscript -Ttext ${RELOC} -Bstatic \ 74 -e ${ENTRY} -o ${PROG}.X ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 75 mv -f ${PROG}.X ${PROG} 76 77 .include <bsd.prog.mk> 78