Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #
  2. # (C) Copyright 2006
  3. # Stefan Roese, DENX Software Engineering, sr@denx.de.
  4. #
  5. # See file CREDITS for list of people who contributed to this
  6. # project.
  7. #
  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.
  12. #
  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.
  17. #
  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,
  21. # MA 02111-1307 USA
  22. #
  23. include $(TOPDIR)/config.mk
  24. include board/$(BOARDDIR)/config.mk
  25. LDSCRIPT= board/$(BOARDDIR)/u-boot.lds
  26. LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
  27. AFLAGS += -DCONFIG_NAND_SPL
  28. CFLAGS += -DCONFIG_NAND_SPL
  29. SOBJS = start.o init.o resetvec.o
  30. COBJS = nand_boot.o ndfc.o sdram.o
  31. SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
  32. OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  33. ALL = u-boot-spl u-boot-spl.bin u-boot-spl-4k.bin
  34. all: $(obj).depend $(ALL)
  35. u-boot-spl-4k.bin: u-boot-spl
  36. $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
  37. u-boot-spl.bin: u-boot-spl
  38. $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
  39. u-boot-spl: $(OBJS)
  40. $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
  41. -Map u-boot-spl.map -o u-boot-spl
  42. # create symbolic links for common files
  43. # from cpu directory
  44. ndfc.c:
  45. @rm -f ndfc.c
  46. ln -s ../cpu/ppc4xx/ndfc.c ndfc.c
  47. resetvec.S:
  48. @rm -f resetvec.S
  49. ln -s ../cpu/ppc4xx/resetvec.S resetvec.S
  50. start.S:
  51. @rm -f start.S
  52. ln -s ../cpu/ppc4xx/start.S start.S
  53. # from board directory
  54. init.S:
  55. @rm -f init.S
  56. ln -s ../board/amcc/sequoia/init.S init.S
  57. sdram.c:
  58. @rm -f sdram.c
  59. ln -s ../board/amcc/sequoia/sdram.c sdram.c
  60. #########################################################################
  61. # defines $(obj).depend target
  62. include $(SRCTREE)/rules.mk
  63. sinclude $(obj).depend
  64. #########################################################################