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