Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #
  2. # (C) Copyright 2007
  3. # Stefan Roese, DENX Software Engineering, sr@denx.de.
  4. # (C) Copyright 2008 Freescale Semiconductor
  5. #
  6. # See file CREDITS for list of people who contributed to this
  7. # project.
  8. #
  9. # This program is free software; you can redistribute it and/or
  10. # modify it under the terms of the GNU General Public License as
  11. # published by the Free Software Foundation; either version 2 of
  12. # the License, or (at your option) any later version.
  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. NAND_SPL := y
  25. TEXT_BASE := 0xfff00000
  26. PAD_TO := 0xfff04000
  27. include $(TOPDIR)/config.mk
  28. LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
  29. LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
  30. AFLAGS += -DCONFIG_NAND_SPL
  31. CFLAGS += -DCONFIG_NAND_SPL
  32. SOBJS = start.o ticks.o
  33. COBJS = nand_boot_fsl_elbc.o $(BOARD).o sdram.o ns16550.o nand_init.o time.o
  34. SRCS := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
  35. OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
  36. __OBJS := $(SOBJS) $(COBJS)
  37. LNDIR := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
  38. nandobj := $(OBJTREE)/nand_spl/
  39. ALL = $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin $(nandobj)u-boot-spl-16k.bin
  40. all: $(obj).depend $(ALL)
  41. $(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
  42. $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
  43. $(nandobj)u-boot-spl.bin: $(nandobj)u-boot-spl
  44. $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
  45. $(nandobj)u-boot-spl: $(OBJS)
  46. cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
  47. -Map $(nandobj)u-boot-spl.map \
  48. -o $(nandobj)u-boot-spl
  49. # create symbolic links for common files
  50. $(obj)start.S:
  51. ln -sf $(SRCTREE)/cpu/mpc83xx/start.S $(obj)start.S
  52. $(obj)nand_boot_fsl_elbc.c:
  53. ln -sf $(SRCTREE)/nand_spl/nand_boot_fsl_elbc.c \
  54. $(obj)nand_boot_fsl_elbc.c
  55. $(obj)sdram.c:
  56. ln -sf $(SRCTREE)/board/$(BOARDDIR)/sdram.c $(obj)sdram.c
  57. $(obj)$(BOARD).c:
  58. ln -sf $(SRCTREE)/board/$(BOARDDIR)/$(BOARD).c $(obj)$(BOARD).c
  59. $(obj)ns16550.c:
  60. ln -sf $(SRCTREE)/drivers/serial/ns16550.c $(obj)ns16550.c
  61. $(obj)nand_init.c:
  62. ln -sf $(SRCTREE)/cpu/mpc83xx/nand_init.c $(obj)nand_init.c
  63. $(obj)time.c:
  64. ln -sf $(SRCTREE)/lib_ppc/time.c $(obj)time.c
  65. $(obj)ticks.S:
  66. ln -sf $(SRCTREE)/lib_ppc/ticks.S $(obj)ticks.S
  67. #########################################################################
  68. $(obj)%.o: $(obj)%.S
  69. $(CC) $(AFLAGS) -c -o $@ $<
  70. $(obj)%.o: $(obj)%.c
  71. $(CC) $(CFLAGS) -c -o $@ $<
  72. # defines $(obj).depend target
  73. include $(SRCTREE)/rules.mk
  74. sinclude $(obj).depend
  75. #########################################################################