Wolfgang Denk | 511d0c7 | 2006-10-09 00:42:01 +0200 | [diff] [blame] | 1 | # |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 2 | # (C) Copyright 2006 |
| 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 4 | # |
| 5 | # (C) Copyright 2005 |
| 6 | # Ladislav Michl, 2N Telekomunikace, michl@2n.cz |
| 7 | # |
| 8 | # See file CREDITS for list of people who contributed to this |
| 9 | # project. |
| 10 | # |
| 11 | # This program is free software; you can redistribute it and/or |
| 12 | # modify it under the terms of the GNU General Public License as |
| 13 | # published by the Free Software Foundation; either version 2 of |
| 14 | # the License, or (at your option) any later version. |
| 15 | # |
| 16 | # This program is distributed in the hope that it will be useful, |
| 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | # GNU General Public License for more details. |
| 20 | # |
| 21 | # You should have received a copy of the GNU General Public License |
| 22 | # along with this program; if not, write to the Free Software |
| 23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 24 | # MA 02111-1307 USA |
| 25 | # |
| 26 | |
| 27 | include $(TOPDIR)/config.mk |
| 28 | |
Sebastien Carlier | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 29 | LIB = $(obj)lib$(BOARD).o |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 30 | |
Ladislav Michl | 0fc4f64 | 2009-03-31 13:43:10 +0200 | [diff] [blame] | 31 | COBJS := netstar.o |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 32 | SOBJS := setup.o |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 33 | |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 34 | SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 35 | OBJS := $(addprefix $(obj),$(COBJS)) |
| 36 | SOBJS := $(addprefix $(obj),$(SOBJS)) |
| 37 | |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 38 | LOAD_ADDR = 0x10400000 |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 39 | |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 40 | ######################################################################### |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 41 | |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 42 | all: $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin \ |
| 43 | $(obj)crcek.srec $(obj)crcek.bin $(obj)crcit |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 44 | |
| 45 | $(LIB): $(OBJS) $(SOBJS) |
Sebastien Carlier | 6d8962e | 2010-11-05 15:48:07 +0100 | [diff] [blame] | 46 | $(call cmd_link_o_target, $^) |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 47 | |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 48 | $(obj)eeprom_start.o: |
| 49 | echo "b eeprom" | $(CC) $(AFLAGS) -c -x assembler -o $@ - |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 50 | |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 51 | $(obj)eeprom: $(obj)eeprom_start.o $(obj)eeprom.o |
| 52 | $(LD) -Ttext $(LOAD_ADDR) -e eeprom -o $@ $^ \ |
| 53 | -L$(obj)../../examples/standalone -lstubs \ |
| 54 | $(PLATFORM_LIBS) |
| 55 | |
| 56 | $(obj)eeprom.srec: $(obj)eeprom |
| 57 | $(OBJCOPY) -S -O srec $(<:.o=) $@ |
| 58 | |
| 59 | $(obj)eeprom.bin: $(obj)eeprom |
| 60 | $(OBJCOPY) -S -O binary $< $@ |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 61 | |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 62 | $(obj)crcek.srec: $(obj)crcek.o |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 63 | $(LD) -g -Ttext 0x00000000 -e crcek -o $(<:.o=) $^ |
| 64 | $(OBJCOPY) -S -O srec $(<:.o=) $@ |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 65 | |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 66 | $(obj)crcek.bin: $(obj)crcek.srec |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 67 | $(OBJCOPY) -I srec -O binary $< $@ |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 68 | |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 69 | $(obj)crcit: $(obj)crcit.o $(obj)crc32.o |
Mike Frysinger | 9aef738 | 2009-07-19 15:17:03 -0400 | [diff] [blame] | 70 | $(HOSTCC) $(HOSTCFLAGS) -o $@ $^ |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 71 | |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 72 | $(obj)crcit.o: crcit.c |
Mike Frysinger | 9aef738 | 2009-07-19 15:17:03 -0400 | [diff] [blame] | 73 | $(HOSTCC) $(HOSTCFLAGS) -o $@ -c $< |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 74 | |
Peter Tyser | 78acc47 | 2010-04-12 22:28:05 -0500 | [diff] [blame] | 75 | $(obj)crc32.o: $(SRCTREE)/lib/crc32.c |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 76 | $(HOSTCC) $(HOSTCFLAGS) -DUSE_HOSTCC -I$(TOPDIR)/include \ |
| 77 | -o $@ -c $< |
Wolfgang Denk | 1aada9c | 2009-08-17 14:00:53 +0200 | [diff] [blame] | 78 | |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 79 | clean: |
Ladislav Michl | 3a67566 | 2010-02-08 14:15:47 -0500 | [diff] [blame] | 80 | rm -f $(SOBJS) $(OBJS) \ |
| 81 | $(obj)eeprom_start.o $(obj)eeprom.o \ |
| 82 | $(obj)eeprom $(obj)eeprom.srec $(obj)eeprom.bin \ |
| 83 | $(obj)crcek.o $(obj)crcek $(obj)crcek.srec $(obj)crcek.bin |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 84 | |
| 85 | distclean: clean |
Wolfgang Denk | c8a3b10 | 2008-07-02 23:49:18 +0200 | [diff] [blame] | 86 | rm -f $(LIB) core *.bak $(obj).depend |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 87 | |
| 88 | ######################################################################### |
| 89 | |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 90 | # defines $(obj).depend target |
| 91 | include $(SRCTREE)/rules.mk |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 92 | |
Marian Balakowicz | f932863 | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 93 | sinclude $(obj).depend |
Wolfgang Denk | ac7eb8a3 | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 94 | |
| 95 | ######################################################################### |