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