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