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