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