Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #
  2. # Copyright (c) 2007
  3. # Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  4. #
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU General Public License as
  7. # published by the Free Software Foundation; either version 2 of
  8. # the License, or (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  18. # MA 02111-1307 USA
  19. #
  20. include $(TOPDIR)/config.mk
  21. LIB = $(obj)lib$(ARCH).o
  22. LIBGCC = $(obj)libgcc.o
  23. SOBJS-y +=
  24. GLSOBJS += ashiftrt.o
  25. GLSOBJS += ashiftlt.o
  26. GLSOBJS += lshiftrt.o
  27. GLSOBJS += ashldi3.o
  28. GLSOBJS += lshrdi3.o
  29. GLSOBJS += movmem.o
  30. COBJS-y += board.o
  31. COBJS-y += bootm.o
  32. ifeq ($(CONFIG_SH2),y)
  33. COBJS-y += time_sh2.o
  34. else
  35. COBJS-y += time.o
  36. endif
  37. ifeq ($(CONFIG_CMD_SH_ZIMAGEBOOT),y)
  38. COBJS-y += zimageboot.o
  39. endif
  40. SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
  41. OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
  42. LGOBJS := $(addprefix $(obj),$(GLSOBJS)) \
  43. $(addprefix $(obj),$(GLCOBJS))
  44. # Always build libsh.o
  45. TARGETS := $(LIB)
  46. # Build private libgcc only when asked for
  47. ifdef USE_PRIVATE_LIBGCC
  48. TARGETS += $(LIBGCC)
  49. endif
  50. all: $(TARGETS)
  51. $(LIB): $(obj).depend $(OBJS)
  52. $(call cmd_link_o_target, $(OBJS))
  53. $(LIBGCC): $(obj).depend $(LGOBJS)
  54. $(call cmd_link_o_target, $(LGOBJS))
  55. #########################################################################
  56. # defines $(obj).depend target
  57. include $(SRCTREE)/rules.mk
  58. sinclude $(obj).depend
  59. #########################################################################