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