4 # Copyright (c) 2005-2008 Analog Device Inc.
6 # (C) Copyright 2000-2006
7 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
9 # Licensed under the GPL-2 or later.
12 include $(TOPDIR
)/config.mk
14 LIB
= $(obj
)lib
$(CPU
).a
19 SOBJS
:= interrupt.o cache.o flush.o
20 COBJS
:= cpu.o traps.o interrupts.o reset.o serial.o i2c.o watchdog.o
22 ifeq ($(CONFIG_BFIN_BOOT_MODE
),BFIN_BOOT_BYPASS
)
26 SRCS
:= $(SEXTRA
:.o
=.S
) $(SOBJS
:.o
=.S
) $(COBJS
:.o
=.c
)
27 OBJS
:= $(addprefix $(obj
),$(COBJS
) $(SOBJS
))
28 EXTRA
:= $(addprefix $(obj
),$(EXTRA
))
29 CEXTRA
:= $(addprefix $(obj
),$(CEXTRA
))
30 SEXTRA
:= $(addprefix $(obj
),$(SEXTRA
))
32 all: $(obj
).depend
$(LIB
) $(obj
).depend
$(EXTRA
) $(CEXTRA
) $(SEXTRA
) check_initcode
35 $(AR
) $(ARFLAGS
) $@
$(OBJS
)
37 $(OBJS
): $(obj
)bootrom-asm-offsets.h
38 $(obj
)bootrom-asm-offsets.c
: bootrom-asm-offsets.c.in bootrom-asm-offsets.awk
39 echo
'#include <asm/mach-common/bits/bootrom.h>' |
$(CPP
) $(CPPFLAGS
) - | gawk
-f .
/bootrom-asm-offsets.awk
> $@.tmp
41 $(obj
)bootrom-asm-offsets.s
: $(obj
)bootrom-asm-offsets.c
42 $(CC
) $(CFLAGS
) -S
$^
-o
$@.tmp
44 $(obj
)bootrom-asm-offsets.h
: $(obj
)bootrom-asm-offsets.s
45 sed
-ne
"/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" $^
> $@
47 # make sure our initcode (which goes into LDR) does not
48 # have relocs or external references
49 READINIT
= env LC_ALL
=C
$(CROSS_COMPILE
)readelf
-s
$<
50 check_initcode
: $(obj
)initcode.o
51 ifneq ($(CONFIG_BFIN_BOOT_MODE
),BFIN_BOOT_BYPASS
)
52 @if
$(READINIT
) | grep
'\<GLOBAL\>.*\<UND\>' ; then \
53 echo
"$< contains external references!" 1>&2 ; \
58 #########################################################################
60 # defines $(obj).depend target
61 include $(SRCTREE
)/rules.mk
63 sinclude
$(obj
).depend
65 #########################################################################