blob: 3b3e5239e635956b7778bcecf87911deb6e5195c [file] [log] [blame]
wdenke085e5b2005-04-05 23:32:21 +00001# (C) Copyright 2000-2002
2# Wolfgang Denk, DENX Software Engineering, wd@denx.de
3#
4# (C) Copyright 2005
5# Ladislav Michl, 2N Telekomunikace, michl@2n.cz
6#
7# See file CREDITS for list of people who contributed to this
8# project.
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License version 2 as
12# published by the Free Software Foundation.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22# MA 02111-1307 USA
23#
24
25include $(TOPDIR)/config.mk
26
27LIB = lib$(BOARD).a
28
29OBJS := voiceblue.o
30SOBJS := setup.o
31
32gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
33
34LOAD_ADDR = 0x10400000
Wolfgang Denkdbb564b2005-08-12 22:56:51 +020035LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
wdenke085e5b2005-04-05 23:32:21 +000036
37all: $(LIB) eeprom.srec eeprom.bin
38
39$(LIB): $(OBJS) $(SOBJS)
40 $(AR) crv $@ $(OBJS) $(SOBJS)
41
Wolfgang Denkdbb564b2005-08-12 22:56:51 +020042eeprom.srec: eeprom.o eeprom_start.o
43 $(LD) -T $(LDSCRIPT) -g -Ttext $(LOAD_ADDR) \
44 -o $(<:.o=) -e $(<:.o=) $^ \
wdenke085e5b2005-04-05 23:32:21 +000045 -L../../examples -lstubs \
46 -L../../lib_generic -lgeneric \
47 -L$(gcclibdir) -lgcc
48 $(OBJCOPY) -O srec $(<:.o=) $@
49
50eeprom.bin: eeprom.srec
Wolfgang Denkdbb564b2005-08-12 22:56:51 +020051 $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
wdenke085e5b2005-04-05 23:32:21 +000052
53clean:
54 rm -f $(SOBJS) $(OBJS) eeprom eeprom.srec eeprom.bin
55
56distclean: clean
57 rm -f $(LIB) core config.tmp *.bak .depend
58
59#########################################################################
60
61.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
62 $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
63
64-include .depend
65
66#########################################################################