3 # Ladislav Michl, 2N Telekomunikace, michl@2n.cz
5 # See file CREDITS for list of people who contributed to this
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 include $(TOPDIR)/config.mk
28 OBJS := netstar.o flash.o nand.o
29 SOBJS := setup.o crcek.o
31 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
33 LOAD_ADDR = 0x10400000
34 LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
36 HOST_CFLAGS = -Wall -pedantic -I$(TOPDIR)/include
38 all: $(LIB) eeprom.srec eeprom.bin crcek.srec crcek.bin crcit
40 $(LIB): $(OBJS) $(SOBJS)
43 eeprom.srec: eeprom.o eeprom_start.o
44 $(LD) -T $(LDSCRIPT) -g -Ttext $(LOAD_ADDR) \
45 -o $(<:.o=) -e $(<:.o=) $^ \
46 -L../../examples -lstubs \
47 -L../../lib_generic -lgeneric \
49 $(OBJCOPY) -O srec $(<:.o=) $@
51 eeprom.bin: eeprom.srec
52 $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
55 $(LD) -g -Ttext 0x00000000 \
56 -o $(<:.o=) -e $(<:.o=) $^
57 $(OBJCOPY) -O srec $(<:.o=) $@
60 $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
62 crcit: crcit.o crc32.o
63 $(HOSTCC) $(HOST_CFLAGS) -o $@ $^
66 $(HOSTCC) $(HOST_CFLAGS) -c $<
68 crc32.o: $(TOPDIR)/tools/crc32.c
69 $(HOSTCC) $(HOST_CFLAGS) -DUSE_HOSTCC -c $<
72 rm -f $(SOBJS) $(OBJS) eeprom eeprom.srec eeprom.bin \
73 crcek crcek.srec crcek.bin
76 rm -f $(LIB) core *.bak .depend
78 #########################################################################
80 .depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
81 $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
85 #########################################################################