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