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