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