Home | History | Annotate | Line # | Download | only in ofwboot
Makefile revision 1.1
      1 #	$NetBSD: Makefile,v 1.1 2000/08/20 14:58:37 mrg 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 .if CROSS
     17 CEXTRAFLAGS?=	-nostdinc
     18 .else
     19 CEXTRAFLAGS?=	-D_LP64
     20 .endif
     21 CWARNFLAGS+=	-Wno-main
     22 CFLAGS+=	${COPTS} -D__ELF__ ${CEXTRAFLAGS}
     23 CPPFLAGS+=	-D_STANDALONE
     24 #CPPFLAGS+=	-DNETIF_DEBUG 
     25 
     26 MKMAN=		no
     27 STRIPFLAG=
     28 BINMODE=	444
     29 OBJCOPY?=	objcopy
     30 
     31 NEWVERSWHAT=	"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 #
     39 RELOC=		800000
     40 
     41 ENTRY=		_start
     42 
     43 CLEANFILES+=	vers.c sparc machine
     44 
     45 CPPFLAGS+=	-I${CURDIR}/../../.. -I${CURDIR}/../../../.. -I${CURDIR} -I.
     46 CPPFLAGS+=	-DRELOC=0x${RELOC}
     47 
     48 #
     49 # XXXXX FIXME
     50 #
     51 CPPFLAGS+=	-DSPARC_BOOT_AOUT
     52 CPPFLAGS+=	-DSPARC_BOOT_ELF
     53 CPPFLAGS+=	-DSPARC_BOOT_UFS
     54 CPPFLAGS+=	-DSPARC_BOOT_NFS
     55 #CPPFLAGS+=	-DSPARC_BOOT_HSFS
     56 
     57 ### find out what to use for libkern
     58 KERN_AS=	library
     59 .include "${S}/lib/libkern/Makefile.inc"
     60 LIBKERN=	${KERNLIB}
     61 
     62 ### find out what to use for libz
     63 Z_AS=		library
     64 .include "${S}/lib/libz/Makefile.inc"
     65 LIBZ=		${ZLIB}
     66 
     67 ### find out what to use for libsa
     68 SA_AS=		library
     69 SAMISCMAKEFLAGS= SA_USE_CREAD=yes
     70 .include "${S}/lib/libsa/Makefile.inc"
     71 LIBSA=		${SALIB}
     72 
     73 .NOPATH: machine sparc
     74 ${SRCS}: machine sparc
     75 
     76 machine:
     77 	rm -f machine
     78 	ln -s ${.CURDIR}/../../../${MACHINE}/include machine
     79 
     80 sparc:
     81 	rm -f sparc
     82 	ln -s ${.CURDIR}/../../../sparc/include sparc
     83 
     84 vers.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
    100 AFLAGS=		-x assembler-with-cpp -Wa,-Av9a -traditional-cpp -D_LOCORE -D__ELF__
    101 .else
    102 AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE -D__ELF__ -Wa,-Av9a ${CEXTRAFLAGS} #-Wa,-Av8plusa
    103 .endif
    104 NORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
    105 srt0.o: srt0.s
    106 	${NORMAL_S}
    107 
    108 # Explicit dependency for this.
    109 boot.o: boot.c elfXX_exec.c
    110