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