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