Makefile revision 224106
1217044Snwhitehorn# $FreeBSD: head/sys/boot/powerpc/ps3/Makefile 224106 2011-07-16 19:01:09Z nwhitehorn $
2217044Snwhitehorn
3217044Snwhitehorn.include <bsd.own.mk>
4217044SnwhitehornMK_SSP=		no
5217044Snwhitehorn
6217044SnwhitehornPROG=		loader.ps3
7217044SnwhitehornNEWVERSWHAT=	"Playstation 3 loader" ${MACHINE_ARCH}
8217044SnwhitehornBINDIR?=	/boot
9217044SnwhitehornINSTALLFLAGS=	-b
10217044Snwhitehorn
11217044Snwhitehorn# Architecture-specific loader code
12217044SnwhitehornSRCS=		start.S conf.c metadata.c vers.c main.c devicename.c ppc64_elf_freebsd.c
13224106SnwhitehornSRCS+=		lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c ps3repo.c ps3stor.c ps3disk.c
14217044SnwhitehornSRCS+=		ucmpdi2.c
15217044Snwhitehorn
16217044SnwhitehornLOADER_DISK_SUPPORT?=	yes
17217044SnwhitehornLOADER_UFS_SUPPORT?=	yes
18217044SnwhitehornLOADER_CD9660_SUPPORT?=	yes
19224106SnwhitehornLOADER_EXT2FS_SUPPORT?=	yes
20217044SnwhitehornLOADER_NET_SUPPORT?=	yes
21217044SnwhitehornLOADER_NFS_SUPPORT?=	yes
22217044SnwhitehornLOADER_TFTP_SUPPORT?=	no
23217044SnwhitehornLOADER_GZIP_SUPPORT?=	yes
24217044SnwhitehornLOADER_FDT_SUPPORT?=	no
25217044SnwhitehornLOADER_BZIP2_SUPPORT?=	no
26217044Snwhitehorn
27217044Snwhitehorn.if ${LOADER_DISK_SUPPORT} == "yes"
28217044SnwhitehornCFLAGS+=	-DLOADER_DISK_SUPPORT
29217044Snwhitehorn.endif
30217044Snwhitehorn.if ${LOADER_UFS_SUPPORT} == "yes"
31217044SnwhitehornCFLAGS+=	-DLOADER_UFS_SUPPORT
32217044Snwhitehorn.endif
33217044Snwhitehorn.if ${LOADER_CD9660_SUPPORT} == "yes"
34217044SnwhitehornCFLAGS+=	-DLOADER_CD9660_SUPPORT
35217044Snwhitehorn.endif
36217044Snwhitehorn.if ${LOADER_EXT2FS_SUPPORT} == "yes"
37217044SnwhitehornCFLAGS+=	-DLOADER_EXT2FS_SUPPORT
38217044Snwhitehorn.endif
39217044Snwhitehorn.if ${LOADER_GZIP_SUPPORT} == "yes"
40217044SnwhitehornCFLAGS+=	-DLOADER_GZIP_SUPPORT
41217044Snwhitehorn.endif
42217044Snwhitehorn.if ${LOADER_BZIP2_SUPPORT} == "yes"
43217044SnwhitehornCFLAGS+=	-DLOADER_BZIP2_SUPPORT
44217044Snwhitehorn.endif
45217044Snwhitehorn.if ${LOADER_NET_SUPPORT} == "yes"
46217044SnwhitehornCFLAGS+=	-DLOADER_NET_SUPPORT
47217044Snwhitehorn.endif
48217044Snwhitehorn.if ${LOADER_NFS_SUPPORT} == "yes"
49217044SnwhitehornCFLAGS+=	-DLOADER_NFS_SUPPORT
50217044Snwhitehorn.endif
51217044Snwhitehorn.if ${LOADER_TFTP_SUPPORT} == "yes"
52217044SnwhitehornCFLAGS+=	-DLOADER_TFTP_SUPPORT
53217044Snwhitehorn.endif
54217044Snwhitehorn.if ${LOADER_FDT_SUPPORT} == "yes"
55217044SnwhitehornCFLAGS+=	-I${.CURDIR}/../../fdt
56217044SnwhitehornCFLAGS+=	-I${.OBJDIR}/../../fdt
57217044SnwhitehornCFLAGS+=	-DLOADER_FDT_SUPPORT
58217044SnwhitehornLIBFDT=		${.OBJDIR}/../../fdt/libfdt.a
59217044Snwhitehorn.endif
60217044Snwhitehorn
61217044Snwhitehorn
62217044Snwhitehorn.if ${MK_FORTH} != "no"
63217044Snwhitehorn# Enable BootForth
64217044SnwhitehornBOOT_FORTH=	yes
65217044SnwhitehornCFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
66217044SnwhitehornLIBFICL=	${.OBJDIR}/../../ficl/libficl.a
67217044Snwhitehorn.endif
68217044Snwhitehorn
69217044Snwhitehorn# Avoid the open-close-dance for every file access as some firmwares perform
70217044Snwhitehorn# an auto-negotiation on every open of the network interface and thus causes
71217044Snwhitehorn# netbooting to take horribly long.
72217044SnwhitehornCFLAGS+=	-DNETIF_OPEN_CLOSE_ONCE -mcpu=powerpc64
73217044Snwhitehorn
74217044Snwhitehorn# Always add MI sources
75217044Snwhitehorn.PATH:		${.CURDIR}/../../common ${.CURDIR}/../../../libkern
76217044Snwhitehorn.include	"${.CURDIR}/../../common/Makefile.inc"
77217044SnwhitehornCFLAGS+=	-I${.CURDIR}/../../common -I${.CURDIR}/../../..
78217044SnwhitehornCFLAGS+=	-I.
79217044Snwhitehorn
80217044SnwhitehornCLEANFILES+=	vers.c loader.help
81217044Snwhitehorn
82217044SnwhitehornCFLAGS+=	-Wall -ffreestanding -msoft-float -DAIM
83217044Snwhitehorn# load address. set in linker script
84217044SnwhitehornRELOC?=		0x0
85217044SnwhitehornCFLAGS+=	-DRELOC=${RELOC}
86217044Snwhitehorn
87217044SnwhitehornLDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.powerpc
88217044Snwhitehorn
89217044Snwhitehorn# 64-bit bridge extensions
90217044SnwhitehornCFLAGS+= -Wa,-mppc64bridge
91217044Snwhitehorn
92217044Snwhitehorn# Pull in common loader code
93217044Snwhitehorn#.PATH:		${.CURDIR}/../../ofw/common
94217044Snwhitehorn#.include	"${.CURDIR}/../../ofw/common/Makefile.inc"
95217044Snwhitehorn
96217044Snwhitehorn# where to get libstand from
97217044SnwhitehornCFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
98217044Snwhitehorn
99217044SnwhitehornDPADD=		${LIBFICL} ${LIBOFW} ${LIBSTAND}
100217044SnwhitehornLDADD=		${LIBFICL} ${LIBOFW} -lstand
101217044Snwhitehorn
102217044SnwhitehornSC_DFLT_FONT=cp437
103217044Snwhitehorn
104217044Snwhitehornfont.h:
105217044Snwhitehorn	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
106217044Snwhitehorn
107217044Snwhitehornvers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
108217044Snwhitehorn	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
109217044Snwhitehorn
110217044Snwhitehornloader.help: help.common help.ps3
111217044Snwhitehorn	cat ${.ALLSRC} | \
112217044Snwhitehorn	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
113217044Snwhitehorn
114217044Snwhitehorn.PATH: ${.CURDIR}/../../forth
115217044SnwhitehornFILES=	loader.help loader.4th support.4th loader.conf
116222472SjulianFILES+=	screen.4th frames.4th
117222417SjulianFILES+=	beastie.4th brand.4th check-password.4th color.4th delay.4th
118222472SjulianFILES+=	menu.4th menu-commands.4th shortcuts.4th version.4th
119217044SnwhitehornFILESDIR_loader.conf=	/boot/defaults
120217044Snwhitehorn
121217044Snwhitehorn.if !exists(${DESTDIR}/boot/loader.rc)
122217044SnwhitehornFILES+= loader.rc
123217044Snwhitehorn.endif
124217044Snwhitehorn
125222417Sjulian.if !exists(${DESTDIR}/boot/menu.rc)
126222417SjulianFILES+= menu.rc
127222417Sjulian.endif
128222417Sjulian
129217044Snwhitehorn.include <bsd.prog.mk>
130