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