Home | History | Annotate | Line # | Download | only in ofwboot
Makefile revision 1.57
      1  1.57       uwe #	$NetBSD: Makefile,v 1.57 2017/04/20 18:39:28 uwe Exp $
      2   1.1    tsubai 
      3   1.1    tsubai S=	${.CURDIR}/../../../..
      4   1.1    tsubai 
      5   1.1    tsubai PROG=		ofwboot
      6  1.12  dmcmahil FILES=		${PROG}.elf ${PROG}.xcf
      7  1.56  christos SRCS=		Locore.c boot.c ofdev.c hfs.c net.c netif_of.c alloc.c
      8   1.7  wrstuden XCOFFXTRA=	Xcoffxtra.c
      9   1.7  wrstuden XCOFFXTRAOBJ=	Xcoffxtra.o
     10  1.54     joerg CFLAGS+=	-ffreestanding
     11  1.54     joerg CFLAGS+=	${${ACTIVE_CC} == "gcc":? -msoft-float :}
     12  1.47   tsutsui CFLAGS+=	-Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
     13  1.29   tsutsui #CPPFLAGS+=	-DDEBUG -DNETIF_DEBUG
     14  1.29   tsutsui CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP
     15  1.31   tsutsui CPPFLAGS+=	-DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK
     16  1.41   aymeric DBG=		-Os
     17  1.36   thorpej 
     18  1.36   thorpej LIBCRT0=	# nothing
     19  1.52   tsutsui LIBCRTI=	# nothing
     20  1.36   thorpej LIBCRTBEGIN=	# nothing
     21  1.36   thorpej LIBCRTEND=	# nothing
     22  1.36   thorpej LIBC=		# nothing
     23   1.9    tsubai 
     24   1.1    tsubai .PATH:		${S}/arch/powerpc/powerpc
     25   1.1    tsubai SRCS+=		ofwmagic.S
     26  1.34    itojun 
     27  1.34    itojun .PATH:		${S}/lib/libsa
     28  1.34    itojun SRCS+=		byteorder.c
     29   1.9    tsubai 
     30  1.24        tv NOMAN=		# defined
     31   1.1    tsubai STRIPFLAG=
     32   1.1    tsubai BINMODE=	444
     33   1.1    tsubai 
     34  1.23        tv .include <bsd.own.mk>
     35  1.23        tv 
     36  1.51     joerg .if !defined(FIXCOFF)
     37  1.39      matt .if !defined(TOOL_MACPPCFIXCOFF)
     38  1.39      matt TOOL_MACPPCFIXCOFFDIR!=	cd ${.CURDIR}/../fixcoff && ${PRINTOBJDIR}
     39  1.46     hauke TOOL_MACPPCFIXCOFF=	${TOOL_MACPPCFIXCOFFDIR}/fixcoff
     40  1.39      matt .endif
     41   1.7  wrstuden .endif
     42   1.7  wrstuden 
     43   1.1    tsubai NEWVERSWHAT=	"OpenFirmware Boot"
     44   1.1    tsubai 
     45   1.1    tsubai # For now...
     46   1.1    tsubai #RELOC=		20000
     47  1.42  wrstuden RELOC=		E00000
     48   1.1    tsubai 
     49   1.1    tsubai ENTRY=		_start
     50   1.1    tsubai 
     51  1.56  christos CLEANFILES+=	${PROG}.elf ${PROG}.el1 ${PROG}.mrg ${PROG}.xcf
     52  1.57       uwe CLEANFILES+=	${XCOFFXTRAOBJ}
     53   1.1    tsubai 
     54  1.30   tsutsui CPPFLAGS+=	-I. -I${.CURDIR} -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
     55  1.26  wrstuden CPPFLAGS+=	-DRELOC=0x${RELOC} -DRELOC_FLATFILE=0x${RELOC_FLATFILE}
     56   1.1    tsubai #CPPFLAGS+=	-DXCOFF_GLUE		# for booting PCI Powermacs
     57   1.1    tsubai 
     58   1.1    tsubai ### find out what to use for libkern
     59   1.1    tsubai KERN_AS=	library
     60   1.1    tsubai .include "${S}/lib/libkern/Makefile.inc"
     61   1.1    tsubai LIBKERN=	${KERNLIB}
     62   1.1    tsubai 
     63   1.1    tsubai ### find out what to use for libz
     64   1.1    tsubai Z_AS=		library
     65   1.1    tsubai .include "${S}/lib/libz/Makefile.inc"
     66   1.1    tsubai LIBZ=		${ZLIB}
     67   1.1    tsubai 
     68   1.1    tsubai ### find out what to use for libsa
     69   1.1    tsubai SA_AS=		library
     70   1.5    tsubai SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
     71   1.1    tsubai .include "${S}/lib/libsa/Makefile.inc"
     72   1.1    tsubai LIBSA=		${SALIB}
     73  1.33   tsutsui 
     74  1.50  dholland cleandir distclean: .WAIT cleanlibdir
     75  1.33   tsutsui 
     76  1.33   tsutsui cleanlibdir:
     77  1.44       jmc 	-rm -rf lib
     78   1.1    tsubai 
     79  1.56  christos .include "${S}/conf/newvers_stand.mk"
     80  1.13  jdolecek 
     81  1.27  wrstuden all realall: ${PROG} ${PROG}.xcf ${PROG}.elf
     82  1.26  wrstuden 
     83  1.42  wrstuden ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} 
     84  1.43      matt 	${_MKTARGET_LINK}
     85  1.42  wrstuden 	${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.el1 \
     86  1.42  wrstuden 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     87  1.26  wrstuden 	${OBJCOPY} -O binary ${PROG}.el1 ${PROG}
     88  1.26  wrstuden 
     89  1.48   tsutsui .include <bsd.klinks.mk>
     90  1.26  wrstuden .include <bsd.prog.mk>
     91  1.26  wrstuden 
     92  1.42  wrstuden ${PROG}.elf: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     93  1.43      matt 	${_MKTARGET_LINK}
     94   1.7  wrstuden 	${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \
     95  1.42  wrstuden 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
     96  1.26  wrstuden 
     97  1.42  wrstuden ${PROG}.xcf: ${OBJS} ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN}
     98  1.43      matt 	${_MKTARGET_LINK}
     99  1.55      matt 	${LD} -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \
    100   1.7  wrstuden 	    -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg  ${XCOFFXTRAOBJ} \
    101  1.42  wrstuden 	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
    102   1.7  wrstuden 	${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \
    103   1.7  wrstuden 	    ${PROG}.mrg ${PROG}.xcf
    104  1.39      matt 	${TOOL_MACPPCFIXCOFF} ${PROG}.xcf
    105