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