Makefile revision 1.12
11.12Sdmcmahil#	$NetBSD: Makefile,v 1.12 2000/07/06 19:42:55 dmcmahill Exp $
21.1Stsubai
31.1StsubaiS=	${.CURDIR}/../../../..
41.1Stsubai
51.1StsubaiPROG=		ofwboot
61.12SdmcmahilFILES=		${PROG}.elf ${PROG}.xcf
71.1StsubaiSRCS=		Locore.c boot.c ofdev.c net.c netif_of.c alloc.c
81.7SwrstudenXCOFFXTRA=	Xcoffxtra.c
91.7SwrstudenXCOFFXTRAOBJ=	Xcoffxtra.o
101.9StsubaiCFLAGS+=	-msoft-float
111.9Stsubai#CFLAGS+=	-DDEBUG -DNETIF_DEBUG
121.10SmycroftCPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP
131.9Stsubai
141.1Stsubai.PATH:		${S}/arch/powerpc/powerpc
151.1StsubaiSRCS+=		ofwmagic.S
161.9Stsubai
171.4SlukemMKMAN=		no
181.1StsubaiSTRIPFLAG=
191.1StsubaiBINMODE=	444
201.1StsubaiOBJCOPY?=	objcopy
211.1Stsubai
221.7Swrstuden.if !defined(FIXCOFF)
231.7Swrstuden.ifnmake(print-objdir)
241.7SwrstudenFIXCOFFDIR!=	cd ${.CURDIR}/../fixcoff; ${MAKE} print-objdir
251.7SwrstudenFIXCOFF=	${FIXCOFFDIR}/fixcoff
261.7SwrstudenFIXCOFFTARG=	${FIXCOFF}
271.7Swrstuden
281.7Swrstuden${FIXCOFF}:
291.7Swrstuden	(cd ${.CURDIR}/../fixcoff; make)
301.7Swrstuden
311.7Swrstuden.endif
321.7Swrstuden.else
331.7SwrstudenFIXCOFFTARG=
341.7Swrstuden.endif
351.7Swrstuden
361.1StsubaiNEWVERSWHAT=	"OpenFirmware Boot"
371.1Stsubai
381.1Stsubai# For now...
391.1Stsubai#RELOC=		20000
401.3StsubaiRELOC=		6c0000
411.11SmattCOPTS=		-Os
421.1Stsubai
431.1StsubaiENTRY=		_start
441.1Stsubai
451.1StsubaiCLEANFILES+=	vers.c vers.o ${PROG}.elf
461.1Stsubai
471.5StsubaiCPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
481.1StsubaiCPPFLAGS+=	-DRELOC=0x${RELOC}
491.1Stsubai#CPPFLAGS+=	-DXCOFF_GLUE		# for booting PCI Powermacs
501.1Stsubai
511.8SmycroftCLEANFILES+= ${XCOFFXTRAOBJ}
521.5Stsubai
531.5Stsubai.BEGIN:
541.5Stsubai	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
551.5Stsubai	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
561.8Smycroft.NOPATH: machine powerpc
571.8SmycroftCLEANFILES+= machine powerpc
581.5Stsubai
591.1Stsubai### find out what to use for libkern
601.1StsubaiKERN_AS=	library
611.1Stsubai.include "${S}/lib/libkern/Makefile.inc"
621.1StsubaiLIBKERN=	${KERNLIB}
631.1Stsubai
641.1Stsubai### find out what to use for libz
651.1StsubaiZ_AS=		library
661.1Stsubai.include "${S}/lib/libz/Makefile.inc"
671.1StsubaiLIBZ=		${ZLIB}
681.1Stsubai
691.1Stsubai### find out what to use for libsa
701.1StsubaiSA_AS=		library
711.5StsubaiSAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
721.1Stsubai.include "${S}/lib/libsa/Makefile.inc"
731.1StsubaiLIBSA=		${SALIB}
741.1Stsubai
751.7Swrstuden${PROG}: ${OBJS} ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} ${FIXCOFFTARG}
761.1Stsubai	sh ${.CURDIR}/../newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
771.1Stsubai	${COMPILE.c} vers.c
781.7Swrstuden	${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \
791.1Stsubai	    ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
801.5Stsubai	${OBJCOPY} -O binary ${PROG}.elf ${PROG}
811.7Swrstuden	${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \
821.7Swrstuden	    -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg  ${XCOFFXTRAOBJ} \
831.7Swrstuden	    ${OBJS} vers.o ${LIBSA} ${LIBZ} ${LIBKERN}
841.7Swrstuden	${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \
851.7Swrstuden	    ${PROG}.mrg ${PROG}.xcf
861.7Swrstuden	${FIXCOFF} ${PROG}.xcf
871.1Stsubai
881.1Stsubai.include <bsd.prog.mk>
89