Makefile revision 1.13
1#	$NetBSD: Makefile,v 1.13 2002/09/18 01:45:49 chs Exp $
2
3S=	${.CURDIR}/../../../..
4
5PROG=		ofwboot
6FILES=		${PROG}.elf
7SRCS=		Locore.c alloc.c boot.c ofdev.c net.c netif_of.c vers.c
8CFLAGS+=	-msoft-float -Wno-main
9#CPPFLAGS+=	-DDEBUG -DNETIF_DEBUG
10CPPFLAGS+=	-D_STANDALONE -DSUPPORT_DHCP -I${.CURDIR}
11DBG=		-Os -mmultiple
12
13SRCS+=		ofwmagic.S
14.PATH:		${S}/arch/powerpc/powerpc
15
16SRCS+=		byteorder.c
17.PATH:		${S}/lib/libsa
18
19NOMAN=		# defined
20STRIPFLAG=
21BINMODE=	444
22
23NEWVERSWHAT=	"OpenFirmware Boot"
24
25# For now...
26RELOC=		20000
27
28ENTRY=		_start
29
30CLEANFILES+=	vers.c ${PROG}.elf
31
32CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
33CPPFLAGS+=	-DRELOC=0x${RELOC}
34CPPFLAGS+=	-DFIRMWORKSBUGS
35CPPFLAGS+=	-DCOMPAT_386BSD_MBRPART
36
37.BEGIN:
38	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
39	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
40.NOPATH: machine powerpc
41CLEANFILES+= machine powerpc
42
43### find out what to use for libkern
44KERN_AS=	library
45.include "${S}/lib/libkern/Makefile.inc"
46LIBKERN=	${KERNLIB}
47
48### find out what to use for libz
49Z_AS=		library
50.include "${S}/lib/libz/Makefile.inc"
51LIBZ=		${ZLIB}
52
53### find out what to use for libsa
54SA_AS=		library
55SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
56.include "${S}/lib/libsa/Makefile.inc"
57LIBSA=		${SALIB}
58
59.PHONY: vers.c
60vers.c: version
61	sh ${S}/conf/newvers_stand.sh ${.CURDIR}/version "ofppc" ${NEWVERSWHAT}
62
63${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
64	${LD} -s -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG}.X \
65	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
66	mv -f ${PROG}.X ${PROG}
67
68.include <bsd.prog.mk>
69