xref: /netbsd/sys/arch/ofppc/stand/ofwboot/Makefile (revision c4a72b64)
1#	$NetBSD: Makefile,v 1.14 2002/09/21 01:18:40 chs 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
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
22NEWVERSWHAT=	"OpenFirmware Boot"
23
24# For now...
25RELOC=		20000
26
27ENTRY=		_start
28
29CLEANFILES+=	vers.c
30
31CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
32CPPFLAGS+=	-DRELOC=0x${RELOC}
33CPPFLAGS+=	-DFIRMWORKSBUGS
34CPPFLAGS+=	-DCOMPAT_386BSD_MBRPART
35
36.BEGIN:
37	@[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
38	@[ -h powerpc ] || ln -s ${S}/arch/powerpc/include powerpc
39.NOPATH: machine powerpc
40CLEANFILES+= machine powerpc
41
42### find out what to use for libkern
43KERN_AS=	library
44.include "${S}/lib/libkern/Makefile.inc"
45LIBKERN=	${KERNLIB}
46
47### find out what to use for libz
48Z_AS=		library
49.include "${S}/lib/libz/Makefile.inc"
50LIBZ=		${ZLIB}
51
52### find out what to use for libsa
53SA_AS=		library
54SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes
55.include "${S}/lib/libsa/Makefile.inc"
56LIBSA=		${SALIB}
57
58.PHONY: vers.c
59vers.c: version
60	sh ${S}/conf/newvers_stand.sh ${.CURDIR}/version "ofppc" ${NEWVERSWHAT}
61
62${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
63	${LD} -s -N -Ttext ${RELOC} -Bstatic -e ${ENTRY} -o ${PROG}.X \
64	    ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
65	mv -f ${PROG}.X ${PROG}
66
67.include <bsd.prog.mk>
68