Makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #
  2. # (C) Copyright 2006
  3. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  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. include $(TOPDIR)/config.mk
  27. LIB = $(obj)lib$(BOARD).a
  28. COBJS := netstar.o
  29. SOBJS := setup.o
  30. SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
  31. OBJS := $(addprefix $(obj),$(COBJS))
  32. SOBJS := $(addprefix $(obj),$(SOBJS))
  33. LOAD_ADDR = 0x10400000
  34. #########################################################################
  35. all: $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin \
  36. $(obj)crcek.srec $(obj)crcek.bin $(obj)crcit
  37. $(LIB): $(OBJS) $(SOBJS)
  38. $(AR) $(ARFLAGS) $@ $^
  39. $(obj)eeprom_start.o:
  40. echo "b eeprom" | $(CC) $(AFLAGS) -c -x assembler -o $@ -
  41. $(obj)eeprom: $(obj)eeprom_start.o $(obj)eeprom.o
  42. $(LD) -Ttext $(LOAD_ADDR) -e eeprom -o $@ $^ \
  43. -L$(obj)../../examples/standalone -lstubs \
  44. $(PLATFORM_LIBS)
  45. $(obj)eeprom.srec: $(obj)eeprom
  46. $(OBJCOPY) -S -O srec $(<:.o=) $@
  47. $(obj)eeprom.bin: $(obj)eeprom
  48. $(OBJCOPY) -S -O binary $< $@
  49. $(obj)crcek.srec: $(obj)crcek.o
  50. $(LD) -g -Ttext 0x00000000 -e crcek -o $(<:.o=) $^
  51. $(OBJCOPY) -S -O srec $(<:.o=) $@
  52. $(obj)crcek.bin: $(obj)crcek.srec
  53. $(OBJCOPY) -I srec -O binary $< $@
  54. $(obj)crcit: $(obj)crcit.o $(obj)crc32.o
  55. $(HOSTCC) $(HOSTCFLAGS) -o $@ $^
  56. $(obj)crcit.o: crcit.c
  57. $(HOSTCC) $(HOSTCFLAGS) -o $@ -c $<
  58. $(obj)crc32.o: $(SRCTREE)/lib_generic/crc32.c
  59. $(HOSTCC) $(HOSTCFLAGS) -DUSE_HOSTCC -I$(TOPDIR)/include \
  60. -o $@ -c $<
  61. clean:
  62. rm -f $(SOBJS) $(OBJS) \
  63. $(obj)eeprom_start.o $(obj)eeprom.o \
  64. $(obj)eeprom $(obj)eeprom.srec $(obj)eeprom.bin \
  65. $(obj)crcek.o $(obj)crcek $(obj)crcek.srec $(obj)crcek.bin
  66. distclean: clean
  67. rm -f $(LIB) core *.bak $(obj).depend
  68. #########################################################################
  69. # defines $(obj).depend target
  70. include $(SRCTREE)/rules.mk
  71. sinclude $(obj).depend
  72. #########################################################################