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