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