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