blob: 7ba5f1b84811e8f70c4a99d931289f58f3c07a16 [file] [log] [blame]
Mike Frysinger94bae5c2008-03-30 15:46:13 -04001#
Bin Meng75574052016-02-05 19:30:11 -08002# U-Boot - Makefile
Mike Frysinger94bae5c2008-03-30 15:46:13 -04003#
4# Copyright (c) 2005-2008 Analog Device Inc.
5#
6# (C) Copyright 2000-2006
7# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8#
Tom Rini0cab3ec2015-11-10 01:06:16 +00009# SPDX-License-Identifier: GPL-2.0+
Mike Frysinger94bae5c2008-03-30 15:46:13 -040010#
11
Masahiro Yamadac3c10f92013-10-21 11:53:36 +090012extra-y := init.elf
13extra-y += initcode.o
14extra-y += start.o
15obj-y := interrupt.o cache.o
16obj-y += cpu.o
Tom Rini91703102013-11-04 09:28:08 -050017obj-y += gpio.o
Masahiro Yamadac3c10f92013-10-21 11:53:36 +090018obj-y += interrupts.o
19obj-$(CONFIG_JTAG_CONSOLE) += jtag-console.o
20obj-y += os_log.o
21obj-y += reset.o
22obj-y += traps.o
Mike Frysinger94bae5c2008-03-30 15:46:13 -040023
Masahiro Yamadac3c10f92013-10-21 11:53:36 +090024extra-y += check_initcode
Masahiro Yamada0a17a422014-02-04 17:24:40 +090025clean-files := init.lds
Mike Frysinger94bae5c2008-03-30 15:46:13 -040026
Mike Frysinger94bae5c2008-03-30 15:46:13 -040027# make sure our initcode (which goes into LDR) does not
28# have relocs or external references
Masahiro Yamada0d68fb12014-02-04 17:24:28 +090029CFLAGS_REMOVE_initcode.o := -ffunction-sections -fdata-sections
Mike Frysinger94bae5c2008-03-30 15:46:13 -040030READINIT = env LC_ALL=C $(CROSS_COMPILE)readelf -s $<
Masahiro Yamada59f15f22014-02-04 17:24:24 +090031$(obj)/check_initcode: $(obj)/initcode.o
Mike Frysinger94bae5c2008-03-30 15:46:13 -040032ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
33 @if $(READINIT) | grep '\<GLOBAL\>.*\<UND\>' ; then \
34 echo "$< contains external references!" 1>&2 ; \
35 exit 1 ; \
36 fi
37endif
38
Masahiro Yamada0d68fb12014-02-04 17:24:28 +090039CPPFLAGS_init.lds := -ansi
Masahiro Yamada020a1f22014-02-24 11:12:19 +090040
41quiet_cmd_link_init = LD $@
42 cmd_link_init = $(LD) $(LDFLAGS) -T $^ -o $@
Masahiro Yamada59f15f22014-02-04 17:24:24 +090043$(obj)/init.elf: $(obj)/init.lds $(obj)/init.o $(obj)/initcode.o
Masahiro Yamada020a1f22014-02-24 11:12:19 +090044 $(call if_changed,link_init)
45targets += init.lds init.o