Home | History | Annotate | Line # | Download | only in ofwboot
Makefile revision 1.15
      1 #	$NetBSD: Makefile,v 1.15 2003/10/08 01:38:49 simonb 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 .BEGIN:
     43 	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
     44 	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
     45 .NOPATH: machine powerpc
     46 CLEANFILES+= machine powerpc
     47 
     48 ### find out what to use for libkern
     49 KERN_AS=	library
     50 .include "${S}/lib/libkern/Makefile.inc"
     51 LIBKERN=	${KERNLIB}
     52 
     53 ### find out what to use for libz
     54 Z_AS=		library
     55 .include "${S}/lib/libz/Makefile.inc"
     56 LIBZ=		${ZLIB}
     57 
     58 ### find out what to use for libsa
     59 SA_AS=		library
     60 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     61 .include "${S}/lib/libsa/Makefile.inc"
     62 LIBSA=		${SALIB}
     63 
     64 .PHONY: vers.c
     65 vers.c: version
     66 	sh ${S}/conf/newvers_stand.sh ${.CURDIR}/version "ofppc" ${NEWVERSWHAT}
     67 
     68 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     69 	${LD} -s -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG}.X \
     70 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     71 	mv -f ${PROG}.X ${PROG}
     72 
     73 .include <bsd.prog.mk>
     74