Makefile revision 176185
1# $FreeBSD: head/sys/boot/powerpc/ofw/Makefile 176185 2008-02-11 12:30:32Z raj $
2
3.include <bsd.own.mk>
4
5PROG=		loader
6NEWVERSWHAT=	"Open Firmware loader" ${MACHINE_ARCH}
7BINDIR?=	/boot
8INSTALLFLAGS=	-b
9
10# Architecture-specific loader code
11SRCS=		conf.c metadata.c vers.c start.c
12
13LOADER_DISK_SUPPORT?=	yes
14LOADER_UFS_SUPPORT?=	yes
15LOADER_CD9660_SUPPORT?=	yes
16LOADER_EXT2FS_SUPPORT?=	no
17LOADER_NET_SUPPORT?=	yes
18LOADER_NFS_SUPPORT?=	yes
19LOADER_TFTP_SUPPORT?=	no
20LOADER_GZIP_SUPPORT?=	yes
21LOADER_BZIP2_SUPPORT?=	no
22
23.if ${LOADER_DISK_SUPPORT} == "yes"
24CFLAGS+=	-DLOADER_DISK_SUPPORT
25.endif
26.if ${LOADER_UFS_SUPPORT} == "yes"
27CFLAGS+=	-DLOADER_UFS_SUPPORT
28.endif
29.if ${LOADER_CD9660_SUPPORT} == "yes"
30CFLAGS+=	-DLOADER_CD9660_SUPPORT
31.endif
32.if ${LOADER_EXT2FS_SUPPORT} == "yes"
33CFLAGS+=	-DLOADER_EXT2FS_SUPPORT
34.endif
35.if ${LOADER_GZIP_SUPPORT} == "yes"
36CFLAGS+=	-DLOADER_GZIP_SUPPORT
37.endif
38.if ${LOADER_BZIP2_SUPPORT} == "yes"
39CFLAGS+=	-DLOADER_BZIP2_SUPPORT
40.endif
41.if ${LOADER_NET_SUPPORT} == "yes"
42CFLAGS+=	-DLOADER_NET_SUPPORT
43.endif
44.if ${LOADER_NFS_SUPPORT} == "yes"
45CFLAGS+=	-DLOADER_NFS_SUPPORT
46.endif
47.if ${LOADER_TFTP_SUPPORT} == "yes"
48CFLAGS+=	-DLOADER_TFTP_SUPPORT
49.endif
50
51.if ${MK_FORTH} != "no"
52# Enable BootForth
53BOOT_FORTH=	yes
54CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
55LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
56.endif
57
58# Always add MI sources
59.PATH:		${.CURDIR}/../../common
60.include	"${.CURDIR}/../../common/Makefile.inc"
61CFLAGS+=	-I${.CURDIR}/../../common
62CFLAGS+=	-I.
63
64CLEANFILES+=	vers.c loader.help
65
66CFLAGS+=	-ffreestanding
67# load address. set in linker script
68RELOC?=		0x1C00000
69CFLAGS+=	-DRELOC=${RELOC}
70
71LDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.powerpc
72
73# 64-bit bridge extensions
74CFLAGS+= -Wa,-mppc64bridge
75
76# Pull in common loader code
77.PATH:		${.CURDIR}/../../ofw/common
78.include	"${.CURDIR}/../../ofw/common/Makefile.inc"
79
80# Open Firmware standalone support library
81LIBOFW=		${.OBJDIR}/../../ofw/libofw/libofw.a
82CFLAGS+=	-I${.CURDIR}/../../ofw/libofw
83
84# where to get libstand from
85CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
86
87DPADD=		${LIBFICL} ${LIBOFW} ${LIBSTAND}
88LDADD=		${LIBFICL} ${LIBOFW} -lstand
89
90vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
91	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
92
93loader.help: help.common help.ofw
94	cat ${.ALLSRC} | \
95	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
96
97.PATH: ${.CURDIR}/../../forth
98FILES=	loader.help loader.4th support.4th loader.conf
99FILESDIR_loader.conf=	/boot/defaults
100
101.if !exists(${DESTDIR}/boot/loader.rc)
102FILES+= loader.rc
103.endif
104
105.include <bsd.prog.mk>
106