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