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