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