Makefile revision 1.13
11.13Smatt#	$NetBSD: Makefile,v 1.13 2013/06/30 21:54:26 matt Exp $
21.13Smatt
31.13SmattNOMAN=		# defined
41.12Sjoerg
51.12Sjoerg.include <bsd.own.mk>
61.1Sthorpej
71.1SthorpejS=		${.CURDIR}/../../../..
81.1Sthorpej
91.11StsutsuiWARNS=		2
101.1SthorpejPROG=		ofwboot
111.1SthorpejSRCS=		srt0.S Locore.c alloc.c boot.c ofdev.c net.c netif_of.c vers.c
121.9SuweCFLAGS+=	-ffreestanding -Wno-main
131.1Sthorpej#CPPFLAGS+=	-DDEBUG -DNETIF_DEBUG
141.1SthorpejCPPFLAGS+=	-DSUPPORT_DHCP -I${.CURDIR}
151.1SthorpejCPPFLAGS+=	-D_STANDALONE
161.9SuweDBG=		-Os
171.3Sitojun
181.3SitojunSRCS+=		byteorder.c
191.3Sitojun.PATH:		${S}/lib/libsa
201.1Sthorpej
211.1Sthorpej# XXX SHOULD NOT NEED TO DEFINE THESE!
221.1SthorpejLIBCRT0=
231.4SsimonbLIBC=
241.1SthorpejLIBCRTBEGIN=
251.1SthorpejLIBCRTEND=
261.1Sthorpej
271.1SthorpejSTRIPFLAG=
281.1SthorpejBINMODE=	444
291.1Sthorpej
301.1SthorpejNEWVERSWHAT=	"OpenFirmware Boot"
311.1Sthorpej
321.1SthorpejRELOC=		f0000000
331.1Sthorpej
341.1SthorpejENTRY=		_start
351.1Sthorpej
361.1SthorpejCLEANFILES+=	vers.c
371.1Sthorpej
381.1SthorpejCPPFLAGS+=	-nostdinc -I. -I${.CURDIR}/../../.. -I${S}
391.1SthorpejCPPFLAGS+=	-DRELOC=0x${RELOC}
401.13SmattCFLAGS+=	-fno-unwind-tables
411.13SmattCPUFLAGS=	-mcpu=strongarm
421.1Sthorpej
431.8Suwe.if !make(obj) && !make(clean) && !make(cleandir)
441.1Sthorpej.BEGIN:
451.1Sthorpej	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
461.1Sthorpej	@[ -h arm ] || ln -s ${S}/arch/arm/include arm
471.8Suwe.endif
481.8Suwe
491.1Sthorpej.NOPATH: machine arm
501.1SthorpejCLEANFILES+= machine arm
511.1Sthorpej
521.1SthorpejCLEANFILES+= ${PROG}.aout
531.1Sthorpej
541.1Sthorpej### find out what to use for libkern
551.1SthorpejKERN_AS=	library
561.1Sthorpej.include "${S}/lib/libkern/Makefile.inc"
571.1SthorpejLIBKERN=	${KERNLIB}
581.1Sthorpej
591.1Sthorpej### find out what to use for libz
601.1SthorpejZ_AS=		library
611.1Sthorpej.include "${S}/lib/libz/Makefile.inc"
621.1SthorpejLIBZ=		${ZLIB}
631.1Sthorpej
641.1Sthorpej### find out what to use for libsa
651.1SthorpejSA_AS=		library
661.1SthorpejSAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
671.1Sthorpej.include "${S}/lib/libsa/Makefile.inc"
681.1SthorpejLIBSA=		${SALIB}
691.1Sthorpej
701.1Sthorpej.PHONY: vers.c
711.1Sthorpejvers.c: version
721.12Sjoerg	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
731.12Sjoerg	    ${.CURDIR}/version "shark" ${NEWVERSWHAT}
741.1Sthorpej
751.1Sthorpej${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
761.13Smatt	${_MKTARGET_LINK}
771.1Sthorpej	${LD} -s -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${.TARGET}.aout \
781.1Sthorpej	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
791.1Sthorpej	${OBJCOPY} -O binary ${.TARGET}.aout ${.TARGET}
801.1Sthorpej
811.1Sthorpej.include <bsd.prog.mk>
82