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