Home | History | Annotate | Line # | Download | only in ofwboot
      1 #	$NetBSD: Makefile,v 1.32 2017/04/08 19:53:22 christos Exp $
      2 
      3 S!=	cd ${.CURDIR}/../../../.. ; pwd
      4 
      5 PROG=		ofwboot
      6 NOMAN=		# defined
      7 SRCS=		ofwstart.S Locore.c boot.c ofdev.c net.c netif_of.c
      8 SRCS+=		mbr.c rdb.c
      9 CFLAGS+=	${${ACTIVE_CC} == "gcc":? -msoft-float :}
     10 CFLAGS+=	-Wno-main -ffreestanding
     11 CFLAGS+=	-Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     12 #CPPFLAGS+=	-g -DALLOC_TRACE -DDEBUG #-DOFW_DEBUG -DNETIF_DEBUG
     13 #CPPFLAGS+=	-DOFWDUMP
     14 CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP -I${.CURDIR}
     15 CPPFLAGS+=	-DHEAP_VARIABLE
     16 
     17 .include <bsd.own.mk>
     18 .include <bsd.klinks.mk>
     19 
     20 DBG=		-Os
     21 
     22 SRCS+=		ofwmagic.S
     23 .PATH:		${S}/arch/powerpc/powerpc
     24 
     25 SRCS+=		byteorder.c
     26 .PATH:		${S}/lib/libsa
     27 
     28 STRIPFLAG=
     29 BINMODE=	444
     30 
     31 # XXX SHOULD NOT NEED TO DEFINE THESE!
     32 LIBCRT0=
     33 LIBCRTI=
     34 LIBC=
     35 LIBCRTBEGIN=
     36 LIBCRTEND=
     37 
     38 NEWVERSWHAT=	"OpenFirmware Boot"
     39 
     40 # For now...
     41 RELOC=		20000
     42 
     43 ENTRY=		_start
     44 
     45 CPPFLAGS+=	-I. -I${S} -I${S}/../common/include
     46 CPPFLAGS+=	-DRELOC=0x${RELOC}
     47 CPPFLAGS+=	-DFIRMWORKSBUGS
     48 CPPFLAGS+=	-DCOMPAT_386BSD_MBRPART
     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 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     67 	${_MKTARGET_LINK}
     68 	${LD} -s -N -T ${.CURDIR}/ldscript -Ttext ${RELOC} -Bstatic \
     69 	    -e ${ENTRY} -o ${PROG}.X ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     70 	mv -f ${PROG}.X ${PROG}
     71 
     72 .include "${S}/conf/newvers_stand.mk"
     73 
     74 .include <bsd.prog.mk>
     75