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