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