xref: /NextBSD/sys/boot/powerpc/ps3/Makefile (revision c21ffb8d6aca32c9584cfa072f309a5890a21aea)
1# $FreeBSD$
2
3.include <src.opts.mk>
4MK_SSP=		no
5MAN=
6
7PROG=		loader.ps3
8NEWVERSWHAT=	"Playstation 3 loader" ${MACHINE_ARCH}
9BINDIR?=	/boot
10INSTALLFLAGS=	-b
11
12# Architecture-specific loader code
13SRCS=		start.S conf.c metadata.c vers.c main.c devicename.c ppc64_elf_freebsd.c
14SRCS+=		lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c ps3repo.c \
15		ps3stor.c ps3disk.c ps3cdrom.c
16SRCS+=		ucmpdi2.c
17
18LOADER_DISK_SUPPORT?=	yes
19LOADER_UFS_SUPPORT?=	yes
20LOADER_CD9660_SUPPORT?=	yes
21LOADER_EXT2FS_SUPPORT?=	yes
22LOADER_NET_SUPPORT?=	yes
23LOADER_NFS_SUPPORT?=	yes
24LOADER_TFTP_SUPPORT?=	no
25LOADER_GZIP_SUPPORT?=	yes
26LOADER_FDT_SUPPORT?=	no
27LOADER_BZIP2_SUPPORT?=	no
28
29.if ${LOADER_DISK_SUPPORT} == "yes"
30CFLAGS+=	-DLOADER_DISK_SUPPORT
31.endif
32.if ${LOADER_UFS_SUPPORT} == "yes"
33CFLAGS+=	-DLOADER_UFS_SUPPORT
34.endif
35.if ${LOADER_CD9660_SUPPORT} == "yes"
36CFLAGS+=	-DLOADER_CD9660_SUPPORT
37.endif
38.if ${LOADER_EXT2FS_SUPPORT} == "yes"
39CFLAGS+=	-DLOADER_EXT2FS_SUPPORT
40.endif
41.if ${LOADER_GZIP_SUPPORT} == "yes"
42CFLAGS+=	-DLOADER_GZIP_SUPPORT
43.endif
44.if ${LOADER_BZIP2_SUPPORT} == "yes"
45CFLAGS+=	-DLOADER_BZIP2_SUPPORT
46.endif
47.if ${LOADER_NET_SUPPORT} == "yes"
48CFLAGS+=	-DLOADER_NET_SUPPORT
49.endif
50.if ${LOADER_NFS_SUPPORT} == "yes"
51CFLAGS+=	-DLOADER_NFS_SUPPORT
52.endif
53.if ${LOADER_TFTP_SUPPORT} == "yes"
54CFLAGS+=	-DLOADER_TFTP_SUPPORT
55.endif
56.if ${LOADER_FDT_SUPPORT} == "yes"
57CFLAGS+=	-I${.CURDIR}/../../fdt
58CFLAGS+=	-I${.OBJDIR}/../../fdt
59CFLAGS+=	-DLOADER_FDT_SUPPORT
60LIBFDT=		${.OBJDIR}/../../fdt/libfdt.a
61.endif
62
63
64.if ${MK_FORTH} != "no"
65# Enable BootForth
66BOOT_FORTH=	yes
67CFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
68LIBFICL=	${.OBJDIR}/../../ficl/libficl.a
69.endif
70
71# Avoid the open-close-dance for every file access as some firmwares perform
72# an auto-negotiation on every open of the network interface and thus causes
73# netbooting to take horribly long.
74CFLAGS+=	-DNETIF_OPEN_CLOSE_ONCE -mcpu=powerpc64
75
76# Always add MI sources
77.PATH:		${.CURDIR}/../../common ${.CURDIR}/../../../libkern
78.include	"${.CURDIR}/../../common/Makefile.inc"
79CFLAGS+=	-I${.CURDIR}/../../common -I${.CURDIR}/../../..
80CFLAGS+=	-I.
81
82CLEANFILES+=	vers.c loader.help
83
84CFLAGS+=	-Wall -ffreestanding -msoft-float -DAIM
85# load address. set in linker script
86RELOC?=		0x0
87CFLAGS+=	-DRELOC=${RELOC}
88
89LDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.powerpc
90
91# Pull in common loader code
92#.PATH:		${.CURDIR}/../../ofw/common
93#.include	"${.CURDIR}/../../ofw/common/Makefile.inc"
94
95# where to get libstand from
96LIBSTAND=	${.OBJDIR}/../../libstand32/libstand.a
97CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
98
99DPADD=		${LIBFICL} ${LIBOFW} ${LIBSTAND}
100LDADD=		${LIBFICL} ${LIBOFW} ${LIBSTAND}
101
102SC_DFLT_FONT=cp437
103
104font.h:
105	uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h
106
107vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
108	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
109
110loader.help: help.common help.ps3 ${.CURDIR}/../../fdt/help.fdt
111	cat ${.ALLSRC} | \
112	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
113
114.PATH: ${.CURDIR}/../../forth
115.include	"${.CURDIR}/../../forth/Makefile.inc"
116
117FILES+= loader.rc menu.rc
118
119.include <bsd.prog.mk>
120