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