blob: dd4d2d13e0eb2bc91062c537db8673c2d779e3f5 [file] [log] [blame]
Mike Frysinger9171fc82008-03-30 15:46:13 -04001#
2# U-boot - Makefile
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#
9# Licensed under the GPL-2 or later.
10#
11
Masahiro Yamada36fde452013-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 Rinic0bb1102013-11-04 09:28:08 -050017obj-y += gpio.o
Masahiro Yamada36fde452013-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 Frysinger9171fc82008-03-30 15:46:13 -040023
Masahiro Yamada36fde452013-10-21 11:53:36 +090024extra-y += check_initcode
Mike Frysinger9171fc82008-03-30 15:46:13 -040025
Mike Frysinger9171fc82008-03-30 15:46:13 -040026# make sure our initcode (which goes into LDR) does not
27# have relocs or external references
Masahiro Yamada6825a952014-02-04 17:24:28 +090028CFLAGS_REMOVE_initcode.o := -ffunction-sections -fdata-sections
Mike Frysinger9171fc82008-03-30 15:46:13 -040029READINIT = env LC_ALL=C $(CROSS_COMPILE)readelf -s $<
Masahiro Yamada9e414032014-02-04 17:24:24 +090030$(obj)/check_initcode: $(obj)/initcode.o
Mike Frysinger9171fc82008-03-30 15:46:13 -040031ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
32 @if $(READINIT) | grep '\<GLOBAL\>.*\<UND\>' ; then \
33 echo "$< contains external references!" 1>&2 ; \
34 exit 1 ; \
35 fi
36endif
37
Masahiro Yamada6825a952014-02-04 17:24:28 +090038CPPFLAGS_init.lds := -ansi
Masahiro Yamada9e414032014-02-04 17:24:24 +090039$(obj)/init.elf: $(obj)/init.lds $(obj)/init.o $(obj)/initcode.o
Mike Frysingerfb5166c2011-05-07 17:55:04 -040040 $(LD) $(LDFLAGS) -T $^ -o $@