Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 1 | # |
| 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 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 |
| 17 | obj-$(CONFIG_ADI_GPIO1) += gpio.o |
| 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 |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 25 | |
Masahiro Yamada | c3c10f9 | 2013-10-21 11:53:36 +0900 | [diff] [blame] | 26 | extra-y += bootrom-asm-offsets.h |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 27 | $(obj)bootrom-asm-offsets.c: bootrom-asm-offsets.c.in bootrom-asm-offsets.awk |
| 28 | echo '#include <asm/mach-common/bits/bootrom.h>' | $(CPP) $(CPPFLAGS) - | gawk -f ./bootrom-asm-offsets.awk > $@.tmp |
| 29 | mv $@.tmp $@ |
| 30 | $(obj)bootrom-asm-offsets.s: $(obj)bootrom-asm-offsets.c |
| 31 | $(CC) $(CFLAGS) -S $^ -o $@.tmp |
| 32 | mv $@.tmp $@ |
| 33 | $(obj)bootrom-asm-offsets.h: $(obj)bootrom-asm-offsets.s |
| 34 | sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" $^ > $@ |
| 35 | |
| 36 | # make sure our initcode (which goes into LDR) does not |
| 37 | # have relocs or external references |
Mike Frysinger | 26bf0cbe | 2008-10-24 18:18:16 -0400 | [diff] [blame] | 38 | $(obj)initcode.o: CFLAGS += -fno-function-sections -fno-data-sections |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 39 | READINIT = env LC_ALL=C $(CROSS_COMPILE)readelf -s $< |
Masahiro Yamada | c3c10f9 | 2013-10-21 11:53:36 +0900 | [diff] [blame] | 40 | $(obj)check_initcode: $(obj)initcode.o |
Mike Frysinger | 94bae5c | 2008-03-30 15:46:13 -0400 | [diff] [blame] | 41 | ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS) |
| 42 | @if $(READINIT) | grep '\<GLOBAL\>.*\<UND\>' ; then \ |
| 43 | echo "$< contains external references!" 1>&2 ; \ |
| 44 | exit 1 ; \ |
| 45 | fi |
| 46 | endif |
| 47 | |
Mike Frysinger | b618d4d | 2011-05-07 17:55:04 -0400 | [diff] [blame] | 48 | $(obj)init.lds: init.lds.S |
| 49 | $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P $^ -o $@ |
| 50 | $(obj)init.elf: $(obj)init.lds $(obj)init.o $(obj)initcode.o |
| 51 | $(LD) $(LDFLAGS) -T $^ -o $@ |