Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 1 | # (C) Copyright 2000-2006 |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 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 | |
| 25 | include $(TOPDIR)/config.mk |
| 26 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 27 | LIB = $(obj)lib$(BOARD).a |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 28 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 29 | COBJS := voiceblue.o |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 30 | SOBJS := setup.o |
| 31 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 32 | SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c eeprom_start.S |
| 33 | OBJS := $(addprefix $(obj),$(COBJS)) |
| 34 | SOBJS := $(addprefix $(obj),$(SOBJS)) |
| 35 | |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 36 | gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`) |
| 37 | |
| 38 | LOAD_ADDR = 0x10400000 |
Wolfgang Denk | 30b8732 | 2005-08-12 23:43:12 +0200 | [diff] [blame] | 39 | LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 40 | lnk = $(if $(obj),$(obj),.) |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 41 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 42 | all: $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 43 | |
| 44 | $(LIB): $(OBJS) $(SOBJS) |
Wolfgang Denk | 6a65e42 | 2006-10-09 01:02:05 +0200 | [diff] [blame] | 45 | $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS) |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 46 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 47 | $(obj)eeprom.srec: $(obj)eeprom.o $(obj)eeprom_start.o |
| 48 | cd $(lnk) && $(LD) -T $(LDSCRIPT) -g -Ttext $(LOAD_ADDR) \ |
| 49 | -o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \ |
| 50 | -L$(obj)../../examples -lstubs \ |
| 51 | -L$(obj)../../lib_generic -lgeneric \ |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 52 | -L$(gcclibdir) -lgcc |
| 53 | $(OBJCOPY) -O srec $(<:.o=) $@ |
| 54 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 55 | $(obj)eeprom.bin: $(obj)eeprom.srec |
Wolfgang Denk | dbb564b | 2005-08-12 22:56:51 +0200 | [diff] [blame] | 56 | $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 57 | |
| 58 | clean: |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 59 | rm -f $(SOBJS) $(OBJS) $(obj)eeprom \ |
| 60 | $(obj)eeprom.srec $(obj)eeprom.bin \ |
| 61 | $(obj)eeprom.o $(obj)eeprom_start.o |
| 62 | |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 63 | |
| 64 | distclean: clean |
| 65 | rm -f $(LIB) core config.tmp *.bak .depend |
| 66 | |
| 67 | ######################################################################### |
| 68 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 69 | # defines $(obj).depend target |
| 70 | include $(SRCTREE)/rules.mk |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 71 | |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 72 | sinclude $(obj).depend |
wdenk | e085e5b | 2005-04-05 23:32:21 +0000 | [diff] [blame] | 73 | |
| 74 | ######################################################################### |