xref: /freebsd/stand/uboot/arch/arm/Makefile.inc (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1# Address at which ubldr will be loaded.
2# This varies for different boards and SOCs.
3UBLDR_LOADADDR?=	0x1000000
4
5SRCS+=		start.S conf.c self_reloc.c
6
7abs.ldscript:
8	echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET}
9
10pie.ldscript:
11	echo "UBLDR_LOADADDR = 0;" >${.TARGET}
12
13ubldr: ${OBJS} abs.ldscript ${LDSCRIPT} ${DPADD}
14	${CC} ${CFLAGS} -T abs.ldscript ${LDFLAGS} \
15	    -o ${.TARGET} ${OBJS} ${LDADD}
16
17ubldr.pie: ${OBJS} pie.ldscript ${LDSCRIPT} ${DPADD}
18	${CC} ${CFLAGS} -T pie.ldscript ${LDFLAGS} -pie -Wl,-Bsymbolic \
19	    -o ${.TARGET} ${OBJS} ${LDADD}
20
21ubldr.bin: ubldr.pie
22	${OBJCOPY} -S -O binary ubldr.pie ${.TARGET}
23
24CLEANFILES+=	abs.ldscript pie.ldscript ubldr ubldr.pie ubldr.bin
25
26