Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # (C) Copyright 2000-2006
  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. include $(TOPDIR)/config.mk
  25. LIB = $(obj)lib$(BOARD).a
  26. COBJS := voiceblue.o
  27. SOBJS := setup.o
  28. SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c eeprom_start.S
  29. OBJS := $(addprefix $(obj),$(COBJS))
  30. SOBJS := $(addprefix $(obj),$(SOBJS))
  31. gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
  32. LOAD_ADDR = 0x10400000
  33. LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
  34. lnk = $(if $(obj),$(obj),.)
  35. all: $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin
  36. $(LIB): $(OBJS) $(SOBJS)
  37. $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
  38. $(obj)eeprom.srec: $(obj)eeprom.o $(obj)eeprom_start.o
  39. cd $(lnk) && $(LD) -T $(LDSCRIPT) -g -Ttext $(LOAD_ADDR) \
  40. -o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \
  41. -L$(obj)../../examples -lstubs \
  42. -L$(obj)../../lib_generic -lgeneric \
  43. -L$(gcclibdir) -lgcc
  44. $(OBJCOPY) -O srec $(<:.o=) $@
  45. $(obj)eeprom.bin: $(obj)eeprom.srec
  46. $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
  47. clean:
  48. rm -f $(SOBJS) $(OBJS) $(obj)eeprom \
  49. $(obj)eeprom.srec $(obj)eeprom.bin \
  50. $(obj)eeprom.o $(obj)eeprom_start.o
  51. distclean: clean
  52. rm -f $(LIB) core *.bak $(obj).depend
  53. #########################################################################
  54. # defines $(obj).depend target
  55. include $(SRCTREE)/rules.mk
  56. sinclude $(obj).depend
  57. #########################################################################