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