1
0

Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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},y)
  14. package-$(ADK_PACKAGE_UCLIBC) += uclibc
  15. package-$(ADK_PACKAGE_UCLIBCXX) += uclibc++
  16. gcc-compile: uclibc-compile
  17. endif
  18. ifeq (${ADK_TARGET_LIB_UCLIBC_NG},y)
  19. package-$(ADK_PACKAGE_UCLIBC_NG) += uclibc-ng
  20. package-$(ADK_PACKAGE_UCLIBCXX) += uclibc++
  21. gcc-compile: uclibc-ng-compile
  22. endif
  23. package-$(ADK_PACKAGE_LIBPTHREAD) += libpthread
  24. include $(ADK_TOPDIR)/package/Depends.mk
  25. COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y))
  26. HOST_COMPILE_PACKAGES:=$(patsubst %,%-host-compile,$(hostpackage-y))
  27. INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
  28. all: compile
  29. download: $(patsubst %,%-download,$(package-y))
  30. clean: $(patsubst %,%-clean,$(package-) $(package-y) base-files)
  31. hostcompile: $(HOST_COMPILE_PACKAGES)
  32. ifeq ($(ADK_TOOLCHAIN_ONLY),y)
  33. compile: $(COMPILE_PACKAGES)
  34. install: $(INSTALL_PACKAGES)
  35. else
  36. compile: base-files-compile $(COMPILE_PACKAGES)
  37. install: base-files-install $(INSTALL_PACKAGES)
  38. endif
  39. %-download:
  40. $(START_TRACE) "package/$(patsubst %-download,%,$@)-download: "
  41. $(MAKE) -C $(patsubst %-download,%,$@) fetch
  42. $(CMD_TRACE) " done"
  43. $(END_TRACE)
  44. %-host-compile:
  45. $(START_TRACE) "package/$(patsubst %-host-compile,%,$@)-host-compile: "
  46. $(MAKE) -C $(patsubst %-host-compile,%,$@) hostpackage
  47. $(CMD_TRACE) " done"
  48. $(END_TRACE)
  49. %-compile:
  50. $(START_TRACE) "package/$(patsubst %-compile,%,$@)-compile: "
  51. @if test -f $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@); then \
  52. $(MAKE) -C $(patsubst %-compile,%,$@) clean ; \
  53. rm $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@) ; \
  54. fi
  55. $(MAKE) -C $(patsubst %-compile,%,$@) fake build-all-pkgs
  56. $(CMD_TRACE) " done"
  57. $(END_TRACE)
  58. %-install:
  59. $(START_TRACE) "package/$(patsubst %-install,%,$@)-install: "
  60. $(MAKE) -C $(patsubst %-install,%,$@) install
  61. $(CMD_TRACE) " done"
  62. $(END_TRACE)
  63. %-clean:
  64. $(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean: "
  65. $(MAKE) -C $(patsubst %-clean,%,$@) clean
  66. $(CMD_TRACE) " done"
  67. $(END_TRACE)