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