]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - sys/boot/powerpc/uboot/Makefile
MFC r264400,r265836:
[FreeBSD/stable/10.git] / sys / boot / powerpc / uboot / Makefile
1 # $FreeBSD$
2
3 .include <bsd.own.mk>
4
5 PROG=           ubldr
6 NEWVERSWHAT=    "U-Boot loader" ${MACHINE_ARCH}
7 BINDIR?=        /boot
8 INSTALLFLAGS=   -b
9 MAN=
10
11 # Architecture-specific loader code
12 SRCS=           start.S conf.c vers.c
13 SRCS+=          ucmpdi2.c
14
15 .if !defined(LOADER_NO_DISK_SUPPORT)
16 LOADER_DISK_SUPPORT?=   yes
17 .else
18 LOADER_DISK_SUPPORT=    no
19 .endif
20 LOADER_UFS_SUPPORT?=    yes
21 LOADER_CD9660_SUPPORT?= no
22 LOADER_EXT2FS_SUPPORT?= no
23 LOADER_NET_SUPPORT?=    yes
24 LOADER_NFS_SUPPORT?=    yes
25 LOADER_TFTP_SUPPORT?=   no
26 LOADER_GZIP_SUPPORT?=   no
27 LOADER_BZIP2_SUPPORT?=  no
28 .if ${MK_FDT} != "no"
29 LOADER_FDT_SUPPORT=     yes
30 .else
31 LOADER_FDT_SUPPORT=     no
32 .endif
33
34 .if ${LOADER_DISK_SUPPORT} == "yes"
35 CFLAGS+=        -DLOADER_DISK_SUPPORT
36 .endif
37 .if ${LOADER_UFS_SUPPORT} == "yes"
38 CFLAGS+=        -DLOADER_UFS_SUPPORT
39 .endif
40 .if ${LOADER_CD9660_SUPPORT} == "yes"
41 CFLAGS+=        -DLOADER_CD9660_SUPPORT
42 .endif
43 .if ${LOADER_EXT2FS_SUPPORT} == "yes"
44 CFLAGS+=        -DLOADER_EXT2FS_SUPPORT
45 .endif
46 .if ${LOADER_GZIP_SUPPORT} == "yes"
47 CFLAGS+=        -DLOADER_GZIP_SUPPORT
48 .endif
49 .if ${LOADER_BZIP2_SUPPORT} == "yes"
50 CFLAGS+=        -DLOADER_BZIP2_SUPPORT
51 .endif
52 .if ${LOADER_NET_SUPPORT} == "yes"
53 CFLAGS+=        -DLOADER_NET_SUPPORT
54 .endif
55 .if ${LOADER_NFS_SUPPORT} == "yes"
56 CFLAGS+=        -DLOADER_NFS_SUPPORT
57 .endif
58 .if ${LOADER_TFTP_SUPPORT} == "yes"
59 CFLAGS+=        -DLOADER_TFTP_SUPPORT
60 .endif
61 .if ${LOADER_FDT_SUPPORT} == "yes"
62 CFLAGS+=        -I${.CURDIR}/../../fdt
63 CFLAGS+=        -I${.OBJDIR}/../../fdt
64 CFLAGS+=        -DLOADER_FDT_SUPPORT
65 LIBUBOOT_FDT=   ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a
66 LIBFDT=         ${.OBJDIR}/../../fdt/libfdt.a
67 .endif
68
69 .if !defined(NO_FORTH)
70 # Enable BootForth
71 BOOT_FORTH=     yes
72 CFLAGS+=        -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
73 LIBFICL=        ${.OBJDIR}/../../ficl/libficl.a
74 .endif
75
76 # Always add MI sources
77 .PATH:          ${.CURDIR}/../../common ${.CURDIR}/../../../libkern
78 .include        "${.CURDIR}/../../common/Makefile.inc"
79 CFLAGS+=        -I${.CURDIR}/../../common -I${.CURDIR}/../../..
80 CFLAGS+=        -I.
81
82 CLEANFILES+=    vers.c ${PROG}.help
83
84 CFLAGS+=        -ffreestanding
85
86 LDFLAGS=        -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
87
88 # Pull in common loader code
89 .PATH:          ${.CURDIR}/../../uboot/common
90 .include        "${.CURDIR}/../../uboot/common/Makefile.inc"
91 CFLAGS+=        -I${.CURDIR}/../../uboot/common
92
93 # U-Boot standalone support library
94 LIBUBOOT=       ${.OBJDIR}/../../uboot/lib/libuboot.a
95 CFLAGS+=        -I${.CURDIR}/../../uboot/lib
96 CFLAGS+=        -I${.OBJDIR}/../../uboot/lib
97
98 # where to get libstand from
99 LIBSTAND=       ${.OBJDIR}/../../libstand32/libstand.a
100 CFLAGS+=        -I${.CURDIR}/../../../../lib/libstand/
101
102 DPADD=          ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND}
103 LDADD=          ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${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.uboot ${.CURDIR}/../../fdt/help.fdt
109         cat ${.ALLSRC} | \
110             awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
111
112 .PATH: ${.CURDIR}/../../forth
113 FILES=  loader.help
114
115 .include <bsd.prog.mk>