1 # $NetBSD: Makefile,v 1.6 2003/05/17 02:26:27 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 vers.c: version 80 sh ${S}/conf/newvers_stand.sh ${CURDIR}/version "sparc64" ${NEWVERSWHAT} 81 82 .if CROSS 83 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 84 ${LD} -N -p -Ttext ${RELOC} -e ${ENTRY} >lderr -o ${PROG} \ 85 ${OBJS} -L${SADST} -lsa -L${ZDST} -lz -L${KERNDST} -lkern # solaris linker 86 .else 87 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 88 ${LD} -X -N -Ttext ${RELOC} -e ${ENTRY} -o ${PROG} \ 89 ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} # native linker 90 .endif 91 92 .include <bsd.prog.mk> 93 94 .if ${MACHINE_ARCH} == "sparc64" 95 AFLAGS+= -Wa,-Av9a 96 CEXTRAFLAGS?= -D_LP64 97 .else 98 AFLAGS+= -Wa,-Av8plusa 99 .endif 100 101 .if CROSS 102 AFLAGS+= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D__ELF__ 103 CEXTRAFLAGS?= -D_LP64 104 .else 105 AFLAGS+= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D__ELF__ ${CEXTRAFLAGS} 106 .endif 107 108 NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 109 srt0.o: srt0.s 110 ${NORMAL_S} 111 112 # Explicit dependency for this. 113 boot.o: boot.c elfXX_exec.c 114