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