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