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