Home | History | Annotate | Line # | Download | only in ofwboot
Makefile revision 1.12.18.1
      1 #	$NetBSD: Makefile,v 1.12.18.1 2013/08/28 23:59:21 rmind Exp $
      2 
      3 NOMAN=		# defined
      4 
      5 .include <bsd.own.mk>
      6 .include <bsd.klinks.mk>
      7 
      8 S=		${.CURDIR}/../../../..
      9 
     10 WARNS=		2
     11 PROG=		ofwboot
     12 SRCS=		srt0.S Locore.c alloc.c boot.c ofdev.c net.c netif_of.c vers.c
     13 CFLAGS+=	-ffreestanding -Wno-main
     14 #CPPFLAGS+=	-DDEBUG -DNETIF_DEBUG
     15 CPPFLAGS+=	-DSUPPORT_DHCP -I${.CURDIR}
     16 CPPFLAGS+=	-D_STANDALONE
     17 DBG=		-Os
     18 
     19 SRCS+=		byteorder.c
     20 .PATH:		${S}/lib/libsa
     21 
     22 # XXX SHOULD NOT NEED TO DEFINE THESE!
     23 LIBCRT0=
     24 LIBC=
     25 LIBCRTBEGIN=
     26 LIBCRTEND=
     27 
     28 STRIPFLAG=
     29 BINMODE=	444
     30 
     31 NEWVERSWHAT=	"OpenFirmware Boot"
     32 
     33 RELOC=		f0000000
     34 
     35 ENTRY=		_start
     36 
     37 CLEANFILES+=	vers.c
     38 
     39 CPPFLAGS+=	-nostdinc -I. -I${.CURDIR}/../../.. -I${S}
     40 CPPFLAGS+=	-DRELOC=0x${RELOC}
     41 CFLAGS+=	-fno-unwind-tables
     42 CPUFLAGS=	-mcpu=strongarm
     43 
     44 CLEANFILES+= ${PROG}.aout
     45 
     46 ### find out what to use for libkern
     47 KERN_AS=	library
     48 .include "${S}/lib/libkern/Makefile.inc"
     49 LIBKERN=	${KERNLIB}
     50 
     51 ### find out what to use for libz
     52 Z_AS=		library
     53 .include "${S}/lib/libz/Makefile.inc"
     54 LIBZ=		${ZLIB}
     55 
     56 ### find out what to use for libsa
     57 SA_AS=		library
     58 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     59 .include "${S}/lib/libsa/Makefile.inc"
     60 LIBSA=		${SALIB}
     61 
     62 .PHONY: vers.c
     63 vers.c: version
     64 	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
     65 	    ${.CURDIR}/version "shark" ${NEWVERSWHAT}
     66 
     67 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     68 	${_MKTARGET_LINK}
     69 	${LD} -s -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${.TARGET}.aout \
     70 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     71 	${OBJCOPY} -O binary ${.TARGET}.aout ${.TARGET}
     72 
     73 .include <bsd.prog.mk>
     74