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