]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/blackfin/cpu/Makefile
bfin: Move gpio support for bf54x and bf60x into the generic driver folder.
[people/ms/u-boot.git] / arch / blackfin / cpu / Makefile
CommitLineData
9171fc81
MF
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
12include $(TOPDIR)/config.mk
13
6d8962e8 14LIB = $(obj)lib$(CPU).o
9171fc81 15
fb5166ce 16EXTRA := init.elf
9171fc81
MF
17CEXTRA := initcode.o
18SEXTRA := start.o
2c1ea9e3 19SOBJS := interrupt.o cache.o
490fe734 20COBJS-y += cpu.o
da34aae5 21COBJS-$(CONFIG_ADI_GPIO1) += gpio.o
490fe734 22COBJS-y += interrupts.o
36ea8e9a 23COBJS-$(CONFIG_JTAG_CONSOLE) += jtag-console.o
490fe734
MF
24COBJS-y += os_log.o
25COBJS-y += reset.o
490fe734 26COBJS-y += traps.o
9171fc81 27
36ea8e9a
MF
28SRCS := $(SEXTRA:.o=.S) $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
29OBJS := $(addprefix $(obj),$(COBJS-y) $(SOBJS))
9171fc81
MF
30EXTRA := $(addprefix $(obj),$(EXTRA))
31CEXTRA := $(addprefix $(obj),$(CEXTRA))
32SEXTRA := $(addprefix $(obj),$(SEXTRA))
33
34all: $(obj).depend $(LIB) $(obj).depend $(EXTRA) $(CEXTRA) $(SEXTRA) check_initcode
35
36$(LIB): $(OBJS)
6d8962e8 37 $(call cmd_link_o_target, $(OBJS))
9171fc81
MF
38
39$(OBJS): $(obj)bootrom-asm-offsets.h
40$(obj)bootrom-asm-offsets.c: bootrom-asm-offsets.c.in bootrom-asm-offsets.awk
41 echo '#include <asm/mach-common/bits/bootrom.h>' | $(CPP) $(CPPFLAGS) - | gawk -f ./bootrom-asm-offsets.awk > $@.tmp
42 mv $@.tmp $@
43$(obj)bootrom-asm-offsets.s: $(obj)bootrom-asm-offsets.c
44 $(CC) $(CFLAGS) -S $^ -o $@.tmp
45 mv $@.tmp $@
46$(obj)bootrom-asm-offsets.h: $(obj)bootrom-asm-offsets.s
47 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" $^ > $@
48
49# make sure our initcode (which goes into LDR) does not
50# have relocs or external references
6957a620 51$(obj)initcode.o: CFLAGS += -fno-function-sections -fno-data-sections
9171fc81
MF
52READINIT = env LC_ALL=C $(CROSS_COMPILE)readelf -s $<
53check_initcode: $(obj)initcode.o
54ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
55 @if $(READINIT) | grep '\<GLOBAL\>.*\<UND\>' ; then \
56 echo "$< contains external references!" 1>&2 ; \
57 exit 1 ; \
58 fi
59endif
60
fb5166ce
MF
61$(obj)init.lds: init.lds.S
62 $(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P $^ -o $@
63$(obj)init.elf: $(obj)init.lds $(obj)init.o $(obj)initcode.o
64 $(LD) $(LDFLAGS) -T $^ -o $@
65
9171fc81
MF
66#########################################################################
67
68# defines $(obj).depend target
69include $(SRCTREE)/rules.mk
70
71sinclude $(obj).depend
72
73#########################################################################