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