xref: /freebsd/stand/uboot/arch/arm/Makefile.inc (revision e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)
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
7ldscript.abs:
8	echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET}
9
10ldscript.pie:
11	echo "UBLDR_LOADADDR = 0;" >${.TARGET}
12
13ubldr: ${OBJS} ldscript.abs ${LDSCRIPT} ${DPADD}
14	${CC} ${CFLAGS} -T ldscript.abs ${LDFLAGS} \
15	    -o ${.TARGET} ${OBJS} ${LDADD}
16
17ubldr.pie: ${OBJS} ldscript.pie ${LDSCRIPT} ${DPADD}
18	${CC} ${CFLAGS} -T ldscript.pie ${LDFLAGS} -pie -Wl,-Bsymbolic \
19	    -o ${.TARGET} ${OBJS} ${LDADD}
20
21ubldr.bin: ubldr.pie
22	${OBJCOPY} -S -O binary ubldr.pie ${.TARGET}
23
24CLEANFILES+=	ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin
25
26