Home | History | Annotate | Line # | Download | only in ofwboot
Makefile revision 1.5
      1 #	$NetBSD: Makefile,v 1.5 1999/04/29 03:16:20 tsubai Exp $
      2 
      3 S=	${.CURDIR}/../../../..
      4 
      5 PROG=		ofwboot
      6 SRCS=		Locore.c boot.c ofdev.c net.c netif_of.c alloc.c
      7 .PATH:		${S}/arch/powerpc/powerpc
      8 SRCS+=		ofwmagic.S
      9 #CFLAGS+=	-DDEBUG -DNETIF_DEBUG
     10 MKMAN=		no
     11 STRIPFLAG=
     12 BINMODE=	444
     13 OBJCOPY?=	objcopy
     14 
     15 NEWVERSWHAT=	"OpenFirmware Boot"
     16 
     17 # For now...
     18 #RELOC=		20000
     19 RELOC=		6c0000
     20 
     21 ENTRY=		_start
     22 
     23 CLEANFILES+=	vers.c vers.o ${PROG}.elf
     24 
     25 CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
     26 CPPFLAGS+=	-DRELOC=0x${RELOC}
     27 #CPPFLAGS+=	-DXCOFF_GLUE		# for booting PCI Powermacs
     28 
     29 CLEANFILES+= ${.OBJDIR}/machine ${.OBJDIR}/powerpc
     30 
     31 .BEGIN:
     32 	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
     33 	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
     34 
     35 ### find out what to use for libkern
     36 KERN_AS=	library
     37 .include "${S}/lib/libkern/Makefile.inc"
     38 LIBKERN=	${KERNLIB}
     39 
     40 ### find out what to use for libz
     41 Z_AS=		library
     42 .include "${S}/lib/libz/Makefile.inc"
     43 LIBZ=		${ZLIB}
     44 
     45 ### find out what to use for libsa
     46 SA_AS=		library
     47 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     48 .include "${S}/lib/libsa/Makefile.inc"
     49 LIBSA=		${SALIB}
     50 
     51 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     52 	sh ${.CURDIR}/../newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
     53 	${COMPILE.c} vers.c
     54 	${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG} \
     55 	    ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
     56 	mv ${PROG} ${PROG}.elf
     57 	${OBJCOPY} -O binary ${PROG}.elf ${PROG}
     58 #	${OBJCOPY} --input-target=elf32-powerpc \
     59 #	    --output-target=xcoff-powermac ${PROG}.elf ${PROG}.xcf
     60 
     61 .include <bsd.prog.mk>
     62