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