Makefile revision 314922
143166Snsouch# $FreeBSD: stable/10/sys/boot/powerpc/uboot/Makefile 314922 2017-03-08 22:39:45Z pfg $
243166Snsouch
343166Snsouch.include <bsd.own.mk>
443166Snsouch
543166SnsouchPROG=		ubldr
643166SnsouchNEWVERSWHAT=	"U-Boot loader" ${MACHINE_ARCH}
743166SnsouchBINDIR?=	/boot
843166SnsouchINSTALLFLAGS=	-b
943166SnsouchMAN=
1043166Snsouch
1143166Snsouch# Architecture-specific loader code
1243166SnsouchSRCS=		start.S conf.c vers.c
1343166SnsouchSRCS+=		ucmpdi2.c
1443166Snsouch
1543166Snsouch.if !defined(LOADER_NO_DISK_SUPPORT)
1643166SnsouchLOADER_DISK_SUPPORT?=	yes
1743166Snsouch.else
1843166SnsouchLOADER_DISK_SUPPORT=	no
1943166Snsouch.endif
2043166SnsouchLOADER_UFS_SUPPORT?=	yes
2143166SnsouchLOADER_CD9660_SUPPORT?=	no
2243166SnsouchLOADER_EXT2FS_SUPPORT?=	no
2343166SnsouchLOADER_NET_SUPPORT?=	yes
2443166SnsouchLOADER_NFS_SUPPORT?=	yes
2543166SnsouchLOADER_TFTP_SUPPORT?=	no
2650477SpeterLOADER_GZIP_SUPPORT?=	no
2743166SnsouchLOADER_BZIP2_SUPPORT?=	no
2843166Snsouch.if ${MK_FDT} != "no"
29162289SjhbLOADER_FDT_SUPPORT=	yes
30162289Sjhb.else
31162289SjhbLOADER_FDT_SUPPORT=	no
32162289Sjhb.endif
33162289Sjhb
34162289Sjhb.if ${LOADER_DISK_SUPPORT} == "yes"
35162289SjhbCFLAGS+=	-DLOADER_DISK_SUPPORT
36162289Sjhb.endif
37165951Sjhb.if ${LOADER_UFS_SUPPORT} == "yes"
38197128SavgCFLAGS+=	-DLOADER_UFS_SUPPORT
39162289Sjhb.endif
40197128Savg.if ${LOADER_CD9660_SUPPORT} == "yes"
41162289SjhbCFLAGS+=	-DLOADER_CD9660_SUPPORT
42162289Sjhb.endif
43162289Sjhb.if ${LOADER_EXT2FS_SUPPORT} == "yes"
44162289SjhbCFLAGS+=	-DLOADER_EXT2FS_SUPPORT
45162289Sjhb.endif
46162289Sjhb.if ${LOADER_GZIP_SUPPORT} == "yes"
47162289SjhbCFLAGS+=	-DLOADER_GZIP_SUPPORT
48162289Sjhb.endif
49162289Sjhb.if ${LOADER_BZIP2_SUPPORT} == "yes"
50162289SjhbCFLAGS+=	-DLOADER_BZIP2_SUPPORT
51162289Sjhb.endif
52162289Sjhb.if ${LOADER_NET_SUPPORT} == "yes"
53162289SjhbCFLAGS+=	-DLOADER_NET_SUPPORT
54162289Sjhb.endif
55162289Sjhb.if ${LOADER_NFS_SUPPORT} == "yes"
56162289SjhbCFLAGS+=	-DLOADER_NFS_SUPPORT
57162289Sjhb.endif
58162289Sjhb.if ${LOADER_TFTP_SUPPORT} == "yes"
59162289SjhbCFLAGS+=	-DLOADER_TFTP_SUPPORT
60162289Sjhb.endif
61162289Sjhb.if ${LOADER_FDT_SUPPORT} == "yes"
62162289SjhbCFLAGS+=	-I${.CURDIR}/../../fdt
63162289SjhbCFLAGS+=	-I${.OBJDIR}/../../fdt
64162289SjhbCFLAGS+=	-DLOADER_FDT_SUPPORT
65162289SjhbLIBUBOOT_FDT=	${.OBJDIR}/../../uboot/fdt/libuboot_fdt.a
66162289SjhbLIBFDT=		${.OBJDIR}/../../fdt/libfdt.a
67162289Sjhb.endif
68162289Sjhb
69162289Sjhb.if ${MK_FORTH} != "no"
70162289Sjhb# Enable BootForth
71162289SjhbBOOT_FORTH=	yes
72162289SjhbCFLAGS+=	-DBOOT_FORTH -I${.CURDIR}/../../ficl
73162289SjhbCFLAGS+=	-I${.CURDIR}/../../ficl/powerpc
74162289SjhbLIBFICL=	${.OBJDIR}/../../ficl/libficl.a
75162289Sjhb.endif
76162289Sjhb
77162289Sjhb# Always add MI sources
78162289Sjhb.PATH:		${.CURDIR}/../../common ${.CURDIR}/../../../libkern
79162289Sjhb.include	"${.CURDIR}/../../common/Makefile.inc"
80162289SjhbCFLAGS+=	-I${.CURDIR}/../../common -I${.CURDIR}/../../..
81162289SjhbCFLAGS+=	-I.
82162289Sjhb
83162289SjhbCLEANFILES+=	vers.c ${PROG}.help
84162289Sjhb
85162289SjhbCFLAGS+=	-ffreestanding
86162289Sjhb
87162289SjhbLDFLAGS=	-nostdlib -static -T ${.CURDIR}/ldscript.powerpc
88162289Sjhb
89162289Sjhb# Pull in common loader code
90162289Sjhb.PATH:		${.CURDIR}/../../uboot/common
91.include	"${.CURDIR}/../../uboot/common/Makefile.inc"
92CFLAGS+=	-I${.CURDIR}/../../uboot/common
93
94# U-Boot standalone support library
95LIBUBOOT=	${.OBJDIR}/../../uboot/lib/libuboot.a
96CFLAGS+=	-I${.CURDIR}/../../uboot/lib
97CFLAGS+=	-I${.OBJDIR}/../../uboot/lib
98
99# where to get libstand from
100LIBSTAND=	${.OBJDIR}/../../libstand32/libstand.a
101CFLAGS+=	-I${.CURDIR}/../../../../lib/libstand/
102
103DPADD=		${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND}
104LDADD=		${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND}
105
106vers.c:	${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
107	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
108
109loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt
110	cat ${.ALLSRC} | \
111	    awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
112
113.PATH: ${.CURDIR}/../../forth
114FILES=	loader.help
115
116.include <bsd.prog.mk>
117