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