]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - sys/boot/powerpc/ps3/Makefile
Synchronize releng/9.2 Forth code with stable/9 via MFS of 2 revisions:
[FreeBSD/releng/9.2.git] / sys / boot / powerpc / ps3 / Makefile
1 # $FreeBSD$
2
3 .include <bsd.own.mk>
4 MK_SSP=         no
5
6 PROG=           loader.ps3
7 NEWVERSWHAT=    "Playstation 3 loader" ${MACHINE_ARCH}
8 BINDIR?=        /boot
9 INSTALLFLAGS=   -b
10
11 # Architecture-specific loader code
12 SRCS=           start.S conf.c metadata.c vers.c main.c devicename.c ppc64_elf_freebsd.c
13 SRCS+=          lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c ps3repo.c \
14                 ps3stor.c ps3disk.c ps3cdrom.c
15 SRCS+=          ucmpdi2.c
16
17 LOADER_DISK_SUPPORT?=   yes
18 LOADER_UFS_SUPPORT?=    yes
19 LOADER_CD9660_SUPPORT?= yes
20 LOADER_EXT2FS_SUPPORT?= yes
21 LOADER_NET_SUPPORT?=    yes
22 LOADER_NFS_SUPPORT?=    yes
23 LOADER_TFTP_SUPPORT?=   no
24 LOADER_GZIP_SUPPORT?=   yes
25 LOADER_FDT_SUPPORT?=    no
26 LOADER_BZIP2_SUPPORT?=  no
27
28 .if ${LOADER_DISK_SUPPORT} == "yes"
29 CFLAGS+=        -DLOADER_DISK_SUPPORT
30 .endif
31 .if ${LOADER_UFS_SUPPORT} == "yes"
32 CFLAGS+=        -DLOADER_UFS_SUPPORT
33 .endif
34 .if ${LOADER_CD9660_SUPPORT} == "yes"
35 CFLAGS+=        -DLOADER_CD9660_SUPPORT
36 .endif
37 .if ${LOADER_EXT2FS_SUPPORT} == "yes"
38 CFLAGS+=        -DLOADER_EXT2FS_SUPPORT
39 .endif
40 .if ${LOADER_GZIP_SUPPORT} == "yes"
41 CFLAGS+=        -DLOADER_GZIP_SUPPORT
42 .endif
43 .if ${LOADER_BZIP2_SUPPORT} == "yes"
44 CFLAGS+=        -DLOADER_BZIP2_SUPPORT
45 .endif
46 .if ${LOADER_NET_SUPPORT} == "yes"
47 CFLAGS+=        -DLOADER_NET_SUPPORT
48 .endif
49 .if ${LOADER_NFS_SUPPORT} == "yes"
50 CFLAGS+=        -DLOADER_NFS_SUPPORT
51 .endif
52 .if ${LOADER_TFTP_SUPPORT} == "yes"
53 CFLAGS+=        -DLOADER_TFTP_SUPPORT
54 .endif
55 .if ${LOADER_FDT_SUPPORT} == "yes"
56 CFLAGS+=        -I${.CURDIR}/../../fdt
57 CFLAGS+=        -I${.OBJDIR}/../../fdt
58 CFLAGS+=        -DLOADER_FDT_SUPPORT
59 LIBFDT=         ${.OBJDIR}/../../fdt/libfdt.a
60 .endif
61
62
63 .if ${MK_FORTH} != "no"
64 # Enable BootForth
65 BOOT_FORTH=     yes
66 CFLAGS+=        -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
67 LIBFICL=        ${.OBJDIR}/../../ficl/libficl.a
68 .endif
69
70 # Avoid the open-close-dance for every file access as some firmwares perform
71 # an auto-negotiation on every open of the network interface and thus causes
72 # netbooting to take horribly long.
73 CFLAGS+=        -DNETIF_OPEN_CLOSE_ONCE -mcpu=powerpc64
74
75 # Always add MI sources
76 .PATH:          ${.CURDIR}/../../common ${.CURDIR}/../../../libkern
77 .include        "${.CURDIR}/../../common/Makefile.inc"
78 CFLAGS+=        -I${.CURDIR}/../../common -I${.CURDIR}/../../..
79 CFLAGS+=        -I.
80
81 CLEANFILES+=    vers.c loader.help
82
83 CFLAGS+=        -Wall -ffreestanding -msoft-float -DAIM
84 # load address. set in linker script
85 RELOC?=         0x0
86 CFLAGS+=        -DRELOC=${RELOC}
87
88 LDFLAGS=        -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
89
90 # 64-bit bridge extensions
91 CFLAGS+= -Wa,-mppc64bridge
92
93 # Pull in common loader code
94 #.PATH:         ${.CURDIR}/../../ofw/common
95 #.include       "${.CURDIR}/../../ofw/common/Makefile.inc"
96
97 # where to get libstand from
98 CFLAGS+=        -I${.CURDIR}/../../../../lib/libstand/
99
100 DPADD=          ${LIBFICL} ${LIBOFW} ${LIBSTAND}
101 LDADD=          ${LIBFICL} ${LIBOFW} -lstand
102
103 SC_DFLT_FONT=cp437
104
105 font.h:
106         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
107
108 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
109         sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
110
111 loader.help: help.common help.ps3
112         cat ${.ALLSRC} | \
113             awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
114
115 .PATH: ${.CURDIR}/../../forth
116 FILES=  loader.help loader.4th support.4th loader.conf
117 FILES+= screen.4th frames.4th
118 FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th
119 FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th
120 FILESDIR_loader.conf=   /boot/defaults
121
122 .if !exists(${DESTDIR}/boot/loader.rc)
123 FILES+= loader.rc
124 .endif
125
126 .if !exists(${DESTDIR}/boot/menu.rc)
127 FILES+= menu.rc
128 .endif
129
130 .include <bsd.prog.mk>