1 # $NetBSD: Makefile,v 1.10 2003/12/07 09:05:18 mrg Exp $ 2 3 CURDIR= ${.CURDIR} 4 S= ${CURDIR}/../../../.. 5 6 # 7 # Override normal settings 8 # 9 10 WARNS= 0 11 12 PROG?= ofwboot 13 SRCS= srt0.s Locore.c boot.c ofdev.c alloc.c net.c netif_of.c vers.c 14 .PATH: ${S}/arch/sparc64/sparc64 15 16 COPTS+= -ffreestanding 17 CWARNFLAGS+= -Wno-main 18 CFLAGS+= ${COPTS} ${CEXTRAFLAGS} 19 CPPFLAGS+= -D_STANDALONE -DSUN4U 20 CPPFLAGS+= -DBOOT_ELF32 -DBOOT_ELF64 21 CPPFLAGS+= -DNETBOOT 22 #CPPFLAGS+= -DNETIF_DEBUG 23 24 LINKS+= ${BINDIR}/ofwboot ${BINDIR}/ofwboot.net 25 26 NOMAN= # defined 27 STRIPFLAG= 28 BINMODE= 444 29 30 NEWVERSWHAT= "OpenFirmware Boot" 31 32 # 33 # Elf64 defaults to 1MB 34 # 35 # We may get address conflicts with other bootloaders, say 36 # Sun's ufsboot, so we'll pick a reasonably empty address. 37 # 38 RELOC= 800000 39 40 ENTRY= _start 41 42 CLEANFILES+= vers.c sparc64 machine 43 44 CPPFLAGS+= -I${CURDIR}/../../.. -I${CURDIR}/../../../.. -I${CURDIR} -I. 45 CPPFLAGS+= -DRELOC=0x${RELOC} 46 47 # 48 # XXXXX FIXME 49 # 50 CPPFLAGS+= -DSPARC_BOOT_AOUT 51 CPPFLAGS+= -DSPARC_BOOT_ELF 52 CPPFLAGS+= -DSPARC_BOOT_UFS 53 CPPFLAGS+= -DSPARC_BOOT_NFS 54 #CPPFLAGS+= -DSPARC_BOOT_HSFS 55 56 ### find out what to use for libkern 57 KERN_AS= library 58 .include "${S}/lib/libkern/Makefile.inc" 59 LIBKERN= ${KERNLIB} 60 61 ### find out what to use for libz 62 Z_AS= library 63 .include "${S}/lib/libz/Makefile.inc" 64 LIBZ= ${ZLIB} 65 66 ### find out what to use for libsa 67 SA_AS= library 68 SAMISCMAKEFLAGS= SA_USE_CREAD=yes 69 .include "${S}/lib/libsa/Makefile.inc" 70 LIBSA= ${SALIB} 71 72 .NOPATH: machine sparc64 73 ${SRCS}: machine sparc64 74 75 machine: 76 rm -f machine 77 ln -s sparc64 machine 78 79 sparc64: 80 rm -f sparc64 81 ln -s ${.CURDIR}/../../../sparc64/include sparc64 82 83 cleandir distclean: cleanlibdir 84 85 cleanlibdir: 86 rm -rf lib 87 88 vers.c: version 89 ${HOST_SH} ${S}/conf/newvers_stand.sh ${CURDIR}/version "sparc64" ${NEWVERSWHAT} 90 91 .if CROSS 92 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 93 ${LD} -N -p -Ttext ${RELOC} -e ${ENTRY} >lderr -o ${PROG} \ 94 ${OBJS} -L${SADST} -lsa -L${ZDST} -lz -L${KERNDST} -lkern # solaris linker 95 .else 96 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 97 ${LD} -X -N -Ttext ${RELOC} -e ${ENTRY} -o ${PROG} \ 98 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} # native linker 99 .endif 100 101 .include <bsd.prog.mk> 102 103 .if ${MACHINE_ARCH} == "sparc64" 104 AFLAGS+= -Wa,-Av9a 105 CEXTRAFLAGS?= -D_LP64 106 .else 107 AFLAGS+= -Wa,-Av8plusa 108 .endif 109 110 .if CROSS 111 AFLAGS+= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D__ELF__ 112 CEXTRAFLAGS?= -D_LP64 113 .else 114 AFLAGS+= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D__ELF__ ${CEXTRAFLAGS} 115 .endif 116 117 NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 118 srt0.o: srt0.s 119 ${NORMAL_S} 120 121 # Explicit dependency for this. 122 boot.o: boot.c elfXX_exec.c 123