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