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