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