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