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