]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/boot/powerpc/ofw/Makefile
Update llvm to trunk r256633.
[FreeBSD/FreeBSD.git] / sys / boot / powerpc / ofw / Makefile
1 # $FreeBSD$
2
3 .include <src.opts.mk>
4 MK_SSP=         no
5 MAN=
6
7 PROG=           loader
8 NEWVERSWHAT=    "Open Firmware loader" ${MACHINE_ARCH}
9 BINDIR?=        /boot
10 INSTALLFLAGS=   -b
11
12 # Architecture-specific loader code
13 SRCS=           conf.c metadata.c vers.c start.c
14 SRCS+=          ucmpdi2.c
15
16 LOADER_DISK_SUPPORT?=   yes
17 LOADER_UFS_SUPPORT?=    yes
18 LOADER_CD9660_SUPPORT?= yes
19 LOADER_EXT2FS_SUPPORT?= no
20 LOADER_NET_SUPPORT?=    yes
21 LOADER_NFS_SUPPORT?=    yes
22 LOADER_TFTP_SUPPORT?=   no
23 LOADER_GZIP_SUPPORT?=   yes
24 LOADER_BZIP2_SUPPORT?=  no
25 LOADER_FDT_SUPPORT?=    yes
26
27 .if ${LOADER_DISK_SUPPORT} == "yes"
28 CFLAGS+=        -DLOADER_DISK_SUPPORT
29 .endif
30 .if ${LOADER_UFS_SUPPORT} == "yes"
31 CFLAGS+=        -DLOADER_UFS_SUPPORT
32 .endif
33 .if ${LOADER_CD9660_SUPPORT} == "yes"
34 CFLAGS+=        -DLOADER_CD9660_SUPPORT
35 .endif
36 .if ${LOADER_EXT2FS_SUPPORT} == "yes"
37 CFLAGS+=        -DLOADER_EXT2FS_SUPPORT
38 .endif
39 .if ${LOADER_GZIP_SUPPORT} == "yes"
40 CFLAGS+=        -DLOADER_GZIP_SUPPORT
41 .endif
42 .if ${LOADER_BZIP2_SUPPORT} == "yes"
43 CFLAGS+=        -DLOADER_BZIP2_SUPPORT
44 .endif
45 .if ${LOADER_NET_SUPPORT} == "yes"
46 CFLAGS+=        -DLOADER_NET_SUPPORT
47 .endif
48 .if ${LOADER_NFS_SUPPORT} == "yes"
49 CFLAGS+=        -DLOADER_NFS_SUPPORT
50 .endif
51 .if ${LOADER_TFTP_SUPPORT} == "yes"
52 CFLAGS+=        -DLOADER_TFTP_SUPPORT
53 .endif
54 .if ${LOADER_FDT_SUPPORT} == "yes"
55 SRCS+=          ofwfdt.c
56 CFLAGS+=        -I${.CURDIR}/../../fdt
57 CFLAGS+=        -I${.OBJDIR}/../../fdt
58 CFLAGS+=        -I${.CURDIR}/../../../contrib/libfdt
59 CFLAGS+=        -DLOADER_FDT_SUPPORT
60 LIBFDT=         ${.OBJDIR}/../../fdt/libfdt.a
61 .endif
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
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+=        -ffreestanding -msoft-float
84 # load address. set in linker script
85 RELOC?=         0x1C00000
86 CFLAGS+=        -DRELOC=${RELOC}
87
88 LDFLAGS=        -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
89
90 # Pull in common loader code
91 .PATH:          ${.CURDIR}/../../ofw/common
92 .include        "${.CURDIR}/../../ofw/common/Makefile.inc"
93
94 # Open Firmware standalone support library
95 LIBOFW=         ${.OBJDIR}/../../ofw/libofw/libofw.a
96 CFLAGS+=        -I${.CURDIR}/../../ofw/libofw
97
98 # where to get libstand from
99 LIBSTAND=       ${.OBJDIR}/../../libstand32/libstand.a
100 CFLAGS+=        -I${.CURDIR}/../../../../lib/libstand/
101
102 DPADD=          ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND}
103 LDADD=          ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND}
104
105 vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
106         sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
107
108 loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt
109         cat ${.ALLSRC} | \
110             awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
111
112 .PATH: ${.CURDIR}/../../forth
113 .include        "${.CURDIR}/../../forth/Makefile.inc"
114
115 FILES+= loader.rc menu.rc
116
117 .include <bsd.prog.mk>