1# $NetBSD: Makefile,v 1.23 2008/02/13 20:11:38 garbled Exp $ 2 3S!= cd ${.CURDIR}/../../../.. ; pwd 4 5PROG= ofwboot 6SRCS= ofwstart.S Locore.c boot.c ofdev.c net.c netif_of.c vers.c 7CFLAGS+= -msoft-float -Wno-main -ffreestanding 8#CPPFLAGS+= -g -DALLOC_TRACE -DDEBUG #-DOFW_DEBUG -DNETIF_DEBUG 9#CPPFLAGS+= -DOFWDUMP 10CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP -I${.CURDIR} 11CPPFLAGS+= -DHEAP_VARIABLE 12DBG= -Os -mmultiple 13 14SRCS+= ofwmagic.S 15.PATH: ${S}/arch/powerpc/powerpc 16 17SRCS+= byteorder.c 18.PATH: ${S}/lib/libsa 19 20NOMAN= # defined 21STRIPFLAG= 22BINMODE= 444 23 24# XXX SHOULD NOT NEED TO DEFINE THESE! 25LIBCRT0= 26LIBC= 27LIBCRTBEGIN= 28LIBCRTEND= 29 30NEWVERSWHAT= "OpenFirmware Boot" 31 32# For now... 33RELOC= 20000 34 35ENTRY= _start 36 37CLEANFILES+= vers.c 38 39CPPFLAGS+= -I. -I${S} -I${S}/../common/include 40CPPFLAGS+= -DRELOC=0x${RELOC} 41CPPFLAGS+= -DFIRMWORKSBUGS 42CPPFLAGS+= -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 50CLEANFILES+= machine powerpc 51 52### find out what to use for libkern 53KERN_AS= library 54.include "${S}/lib/libkern/Makefile.inc" 55LIBKERN= ${KERNLIB} 56 57### find out what to use for libz 58Z_AS= library 59.include "${S}/lib/libz/Makefile.inc" 60LIBZ= ${ZLIB} 61 62### find out what to use for libsa 63SA_AS= library 64SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes 65.include "${S}/lib/libsa/Makefile.inc" 66LIBSA= ${SALIB} 67 68.PHONY: vers.c 69vers.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