Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. # Main makefile for the packages
  4. include $(ADK_TOPDIR)/rules.mk
  5. ifeq (${ADK_TARGET_LIB_GLIBC},y)
  6. package-$(ADK_PACKAGE_GLIBC) += glibc
  7. gcc-compile: glibc-compile
  8. endif
  9. ifeq (${ADK_TARGET_LIB_MUSL},y)
  10. package-$(ADK_PACKAGE_MUSL) += musl
  11. gcc-compile: musl-compile
  12. endif
  13. ifeq (${ADK_TARGET_LIB_UCLIBC_NG},y)
  14. package-$(ADK_PACKAGE_UCLIBC_NG) += uclibc-ng
  15. gcc-compile: uclibc-ng-compile
  16. endif
  17. package-$(ADK_PACKAGE_LIBPTHREAD) += libpthread
  18. include $(ADK_TOPDIR)/package/Depends.mk
  19. COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y))
  20. HOST_COMPILE_PACKAGES:=$(patsubst %,%-host-compile,$(hostpackage-y))
  21. INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
  22. ifeq ($(ADK_TARGET_LIBICONV),y)
  23. COMPILE_ICONV:=libiconv-compile
  24. INSTALL_ICONV:=libiconv-install
  25. endif
  26. ifeq ($(ADK_TARGET_LIBICONV_TINY),y)
  27. COMPILE_ICONV:=libiconv-tiny-compile
  28. INSTALL_ICONV:=libiconv-tiny-install
  29. endif
  30. all: compile
  31. download: $(patsubst %,%-download,$(package-y))
  32. clean: $(patsubst %,%-clean,$(package-) $(package-y) base-files)
  33. hostcompile: $(HOST_COMPILE_PACKAGES)
  34. ifeq ($(ADK_TOOLCHAIN_ONLY),y)
  35. compile: $(COMPILE_PACKAGES)
  36. install: $(INSTALL_PACKAGES)
  37. else
  38. compile: base-files-compile $(COMPILE_ICONV) $(COMPILE_PACKAGES)
  39. install: base-files-install $(INSTALL_ICONV) $(INSTALL_PACKAGES)
  40. endif
  41. %-download:
  42. $(START_TRACE) "package/$(patsubst %-download,%,$@)-download: "
  43. $(MAKE) -C $(patsubst %-download,%,$@) fetch
  44. $(CMD_TRACE) " done"
  45. $(END_TRACE)
  46. %-host-compile:
  47. $(START_TRACE) "package/$(patsubst %-host-compile,%,$@)-host-compile: "
  48. $(MAKE) -C $(patsubst %-host-compile,%,$@) hostpackage
  49. $(CMD_TRACE) " done"
  50. $(END_TRACE)
  51. %-compile:
  52. $(START_TRACE) "package/$(patsubst %-compile,%,$@)-compile: "
  53. @if test -f $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@); then \
  54. $(MAKE) -C $(patsubst %-compile,%,$@) clean ; \
  55. rm $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@) ; \
  56. fi
  57. $(MAKE) -C $(patsubst %-compile,%,$@) fake build-all-pkgs
  58. $(CMD_TRACE) " done"
  59. $(END_TRACE)
  60. %-install:
  61. $(START_TRACE) "package/$(patsubst %-install,%,$@)-install: "
  62. $(MAKE) -C $(patsubst %-install,%,$@) install
  63. $(CMD_TRACE) " done"
  64. $(END_TRACE)
  65. %-clean:
  66. $(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean: "
  67. $(MAKE) -C $(patsubst %-clean,%,$@) clean
  68. $(CMD_TRACE) " done"
  69. $(END_TRACE)