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