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