Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 1 | # |
Bin Meng | 7557405 | 2016-02-05 19:30:11 -0800 | [diff] [blame] | 2 | # U-Boot - Makefile |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 3 | # |
| 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 Rini | 0cab3ec | 2015-11-10 01:06:16 +0000 | [diff] [blame] | 9 | # SPDX-License-Identifier: GPL-2.0+ |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 10 | # |
| 11 | |
Masahiro Yamada | c3c10f9 | 2013-10-21 11:53:36 +0900 | [diff] [blame] | 12 | extra-y := init.elf |
| 13 | extra-y += initcode.o |
| 14 | extra-y += start.o |
| 15 | obj-y := interrupt.o cache.o |
| 16 | obj-y += cpu.o |
Tom Rini | 9170310 | 2013-11-04 09:28:08 -0500 | [diff] [blame] | 17 | obj-y += gpio.o |
Masahiro Yamada | c3c10f9 | 2013-10-21 11:53:36 +0900 | [diff] [blame] | 18 | obj-y += interrupts.o |
| 19 | obj-$(CONFIG_JTAG_CONSOLE) += jtag-console.o |
| 20 | obj-y += os_log.o |
| 21 | obj-y += reset.o |
| 22 | obj-y += traps.o |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 23 | |
Masahiro Yamada | c3c10f9 | 2013-10-21 11:53:36 +0900 | [diff] [blame] | 24 | extra-y += check_initcode |
Masahiro Yamada | 0a17a42 | 2014-02-04 17:24:40 +0900 | [diff] [blame] | 25 | clean-files := init.lds |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 26 | |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 27 | # make sure our initcode (which goes into LDR) does not |
| 28 | # have relocs or external references |
Masahiro Yamada | 0d68fb1 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 29 | CFLAGS_REMOVE_initcode.o := -ffunction-sections -fdata-sections |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 30 | READINIT = env LC_ALL=C $(CROSS_COMPILE)readelf -s $< |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 31 | $(obj)/check_initcode: $(obj)/initcode.o |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 32 | ifneq ($(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 |
| 37 | endif |
| 38 | |
Masahiro Yamada | 0d68fb1 | 2014-02-04 17:24:28 +0900 | [diff] [blame] | 39 | CPPFLAGS_init.lds := -ansi |
Masahiro Yamada | 020a1f2 | 2014-02-24 11:12:19 +0900 | [diff] [blame] | 40 | |
| 41 | quiet_cmd_link_init = LD $@ |
| 42 | cmd_link_init = $(LD) $(LDFLAGS) -T $^ -o $@ |
Masahiro Yamada | 59f15f2 | 2014-02-04 17:24:24 +0900 | [diff] [blame] | 43 | $(obj)/init.elf: $(obj)/init.lds $(obj)/init.o $(obj)/initcode.o |
Masahiro Yamada | 020a1f2 | 2014-02-24 11:12:19 +0900 | [diff] [blame] | 44 | $(call if_changed,link_init) |
| 45 | targets += init.lds init.o |