1# $NetBSD: Makefile,v 1.1 2000/08/20 14:58:37 mrg Exp $ 2 3CURDIR= ${.CURDIR} 4S= ${CURDIR}/../../../.. 5 6# 7# Override normal settings 8# 9 10WARNS= 0 11 12PROG?= ofwboot 13SRCS= 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.if CROSS 17CEXTRAFLAGS?= -nostdinc 18.else 19CEXTRAFLAGS?= -D_LP64 20.endif 21CWARNFLAGS+= -Wno-main 22CFLAGS+= ${COPTS} -D__ELF__ ${CEXTRAFLAGS} 23CPPFLAGS+= -D_STANDALONE 24#CPPFLAGS+= -DNETIF_DEBUG 25 26MKMAN= no 27STRIPFLAG= 28BINMODE= 444 29OBJCOPY?= objcopy 30 31NEWVERSWHAT= "OpenFirmware Boot" 32 33# 34# Elf64 defaults to 1MB 35# 36# We may get address conflicts with other bootloaders, say 37# Sun's ufsboot, so we'll pick a reasonably empty address. 38# 39RELOC= 800000 40 41ENTRY= _start 42 43CLEANFILES+= vers.c sparc machine 44 45CPPFLAGS+= -I${CURDIR}/../../.. -I${CURDIR}/../../../.. -I${CURDIR} -I. 46CPPFLAGS+= -DRELOC=0x${RELOC} 47 48# 49# XXXXX FIXME 50# 51CPPFLAGS+= -DSPARC_BOOT_AOUT 52CPPFLAGS+= -DSPARC_BOOT_ELF 53CPPFLAGS+= -DSPARC_BOOT_UFS 54CPPFLAGS+= -DSPARC_BOOT_NFS 55#CPPFLAGS+= -DSPARC_BOOT_HSFS 56 57### find out what to use for libkern 58KERN_AS= library 59.include "${S}/lib/libkern/Makefile.inc" 60LIBKERN= ${KERNLIB} 61 62### find out what to use for libz 63Z_AS= library 64.include "${S}/lib/libz/Makefile.inc" 65LIBZ= ${ZLIB} 66 67### find out what to use for libsa 68SA_AS= library 69SAMISCMAKEFLAGS= SA_USE_CREAD=yes 70.include "${S}/lib/libsa/Makefile.inc" 71LIBSA= ${SALIB} 72 73.NOPATH: machine sparc 74${SRCS}: machine sparc 75 76machine: 77 rm -f machine 78 ln -s ${.CURDIR}/../../../${MACHINE}/include machine 79 80sparc: 81 rm -f sparc 82 ln -s ${.CURDIR}/../../../sparc/include sparc 83 84vers.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 CROSS 100AFLAGS= -x assembler-with-cpp -Wa,-Av9a -traditional-cpp -D_LOCORE -D__ELF__ 101.else 102AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE -D__ELF__ -Wa,-Av9a ${CEXTRAFLAGS} #-Wa,-Av8plusa 103.endif 104NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 105srt0.o: srt0.s 106 ${NORMAL_S} 107 108# Explicit dependency for this. 109boot.o: boot.c elfXX_exec.c 110