Home | History | Annotate | Line # | Download | only in ofwboot
Makefile revision 1.11.2.5
      1  1.11.2.5        he #	$NetBSD: Makefile,v 1.11.2.5 2002/02/13 23:12:10 he Exp $
      2       1.1    tsubai 
      3       1.1    tsubai S=	${.CURDIR}/../../../..
      4       1.1    tsubai 
      5       1.1    tsubai PROG=		ofwboot
      6  1.11.2.1  dmcmahil FILES=		${PROG}.elf ${PROG}.xcf
      7  1.11.2.5        he SRCS=		Locore.c ofdev.c hfs.c net.c netif_of.c alloc.c vers.c
      8       1.7  wrstuden XCOFFXTRA=	Xcoffxtra.c
      9       1.7  wrstuden XCOFFXTRAOBJ=	Xcoffxtra.o
     10       1.9    tsubai CFLAGS+=	-msoft-float
     11       1.9    tsubai #CFLAGS+=	-DDEBUG -DNETIF_DEBUG
     12  1.11.2.4        he CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP -I${.CURDIR}
     13       1.9    tsubai 
     14       1.1    tsubai .PATH:		${S}/arch/powerpc/powerpc
     15       1.1    tsubai SRCS+=		ofwmagic.S
     16       1.9    tsubai 
     17       1.4     lukem MKMAN=		no
     18       1.1    tsubai STRIPFLAG=
     19       1.1    tsubai BINMODE=	444
     20       1.1    tsubai OBJCOPY?=	objcopy
     21       1.1    tsubai 
     22       1.7  wrstuden .if !defined(FIXCOFF)
     23       1.7  wrstuden .ifnmake(print-objdir)
     24       1.7  wrstuden FIXCOFFDIR!=	cd ${.CURDIR}/../fixcoff; ${MAKE} print-objdir
     25       1.7  wrstuden FIXCOFF=	${FIXCOFFDIR}/fixcoff
     26       1.7  wrstuden FIXCOFFTARG=	${FIXCOFF}
     27       1.7  wrstuden 
     28       1.7  wrstuden ${FIXCOFF}:
     29       1.7  wrstuden 	(cd ${.CURDIR}/../fixcoff; make)
     30       1.7  wrstuden 
     31       1.7  wrstuden .endif
     32       1.7  wrstuden .else
     33       1.7  wrstuden FIXCOFFTARG=
     34       1.7  wrstuden .endif
     35       1.7  wrstuden 
     36       1.1    tsubai NEWVERSWHAT=	"OpenFirmware Boot"
     37       1.1    tsubai 
     38       1.1    tsubai # For now...
     39       1.1    tsubai #RELOC=		20000
     40  1.11.2.5        he RELOC=		640000
     41  1.11.2.5        he RELOC_FLATFILE=	600000
     42  1.11.2.3        tv COPTS=		-Os -mmultiple
     43       1.1    tsubai 
     44       1.1    tsubai ENTRY=		_start
     45       1.1    tsubai 
     46  1.11.2.5        he CLEANFILES+=	vers.c vers.o ${PROG}.elf ${PROG}.el1 ${PROG}.mrg ${PROG}.xcf
     47  1.11.2.5        he CLEANFILES+=	machine powerpc
     48       1.1    tsubai 
     49       1.5    tsubai CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
     50  1.11.2.5        he CPPFLAGS+=	-DRELOC=0x${RELOC} -DRELOC_FLATFILE=0x${RELOC_FLATFILE}
     51       1.1    tsubai #CPPFLAGS+=	-DXCOFF_GLUE		# for booting PCI Powermacs
     52       1.1    tsubai 
     53  1.11.2.5        he CLEANFILES+= ${XCOFFXTRAOBJ} boot.o boot1.o
     54       1.5    tsubai 
     55       1.5    tsubai .BEGIN:
     56       1.5    tsubai 	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
     57       1.5    tsubai 	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
     58       1.8   mycroft .NOPATH: machine powerpc
     59       1.8   mycroft CLEANFILES+= machine powerpc
     60       1.5    tsubai 
     61       1.1    tsubai ### find out what to use for libkern
     62       1.1    tsubai KERN_AS=	library
     63       1.1    tsubai .include "${S}/lib/libkern/Makefile.inc"
     64       1.1    tsubai LIBKERN=	${KERNLIB}
     65       1.1    tsubai 
     66       1.1    tsubai ### find out what to use for libz
     67       1.1    tsubai Z_AS=		library
     68       1.1    tsubai .include "${S}/lib/libz/Makefile.inc"
     69       1.1    tsubai LIBZ=		${ZLIB}
     70       1.1    tsubai 
     71       1.1    tsubai ### find out what to use for libsa
     72       1.1    tsubai SA_AS=		library
     73       1.5    tsubai SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     74       1.1    tsubai .include "${S}/lib/libsa/Makefile.inc"
     75       1.1    tsubai LIBSA=		${SALIB}
     76       1.1    tsubai 
     77  1.11.2.5        he .PHONY: vers.c
     78  1.11.2.5        he vers.c: version
     79       1.1    tsubai 	sh ${.CURDIR}/../newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
     80  1.11.2.5        he 
     81  1.11.2.5        he all: ${PROG} ${PROG}.xcf ${PROG}.elf
     82  1.11.2.5        he 
     83  1.11.2.5        he ${PROG}: ${OBJS} boot1.o ${LIBSA} ${LIBZ} ${LIBKERN} 
     84  1.11.2.5        he 	${LD} -s -N -Ttext ${RELOC_FLATFILE} -Bstatic -o ${PROG}.el1 \
     85  1.11.2.5        he 	    ${OBJS} boot1.o ${LIBSA} ${LIBZ} ${LIBKERN}
     86  1.11.2.5        he 	${OBJCOPY} -O binary ${PROG}.el1 ${PROG}
     87  1.11.2.5        he 
     88  1.11.2.5        he .include <bsd.prog.mk>
     89  1.11.2.5        he 
     90  1.11.2.5        he ${PROG}.elf: ${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
     91       1.7  wrstuden 	${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \
     92  1.11.2.5        he 	    ${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
     93  1.11.2.5        he 
     94  1.11.2.5        he ${PROG}.xcf: ${OBJS} boot.o ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} ${FIXCOFFTARG}
     95       1.7  wrstuden 	${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \
     96       1.7  wrstuden 	    -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg  ${XCOFFXTRAOBJ} \
     97  1.11.2.5        he 	    ${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
     98       1.7  wrstuden 	${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \
     99       1.7  wrstuden 	    ${PROG}.mrg ${PROG}.xcf
    100       1.7  wrstuden 	${FIXCOFF} ${PROG}.xcf
    101