1
0

Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 $(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_EGLIBC},y)
  10. package-$(ADK_PACKAGE_EGLIBC) += eglibc
  11. gcc-compile: eglibc-compile
  12. endif
  13. ifeq (${ADK_TARGET_LIB_MUSL},y)
  14. package-$(ADK_PACKAGE_MUSL) += musl
  15. gcc-compile: musl-compile
  16. endif
  17. ifeq (${ADK_NATIVE},y)
  18. package-$(ADK_PACKAGE_LIBC) += libc
  19. endif
  20. ifneq (${ADK_NATIVE},y)
  21. package-$(ADK_PACKAGE_LIBPTHREAD) += libpthread
  22. endif
  23. ifneq (${ADK_TARGET_LIB_GLIBC},y)
  24. ifneq (${ADK_TARGET_LIB_EGLIBC},y)
  25. ifneq (${ADK_TARGET_LIB_MUSL},y)
  26. ifneq (${ADK_NATIVE},y)
  27. package-$(ADK_PACKAGE_UCLIBC) += uclibc
  28. gcc-compile: uclibc-compile
  29. endif
  30. package-$(ADK_PACKAGE_UCLIBCXX) += uclibc++
  31. endif
  32. endif
  33. endif
  34. include $(TOPDIR)/package/Depends.mk
  35. DOWNLOAD:=$(patsubst %,%-download,$(package-y) $(package-m))
  36. REBUILD_PACKAGES:=$(patsubst %,%-rebuild,$(package-y) $(package-m))
  37. COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
  38. INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
  39. all: compile
  40. download: $(DOWNLOAD)
  41. clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m) base-files)
  42. ifeq ($(ADK_TOOLCHAIN_ONLY),y)
  43. compile: $(REBUILD_PACKAGES) $(COMPILE_PACKAGES)
  44. install: $(INSTALL_PACKAGES)
  45. else
  46. compile: $(REBUILD_PACKAGES) base-files-compile $(COMPILE_PACKAGES)
  47. install: base-files-install $(INSTALL_PACKAGES)
  48. endif
  49. %-download:
  50. $(START_TRACE) "package/$(patsubst %-download,%,$@)-download: "
  51. $(MAKE) -C $(patsubst %-download,%,$@) fetch
  52. $(CMD_TRACE) " done"
  53. $(END_TRACE)
  54. %-host-compile:
  55. $(START_TRACE) "package/$(patsubst %-host-compile,%,$@)-host-compile: "
  56. $(MAKE) -C $(patsubst %-host-compile,%,$@) hostpackage
  57. $(CMD_TRACE) " done"
  58. $(END_TRACE)
  59. %-compile:
  60. $(START_TRACE) "package/$(patsubst %-compile,%,$@)-compile: "
  61. $(MAKE) -C $(patsubst %-compile,%,$@) fake build-all-pkgs
  62. $(CMD_TRACE) " done"
  63. $(END_TRACE)
  64. %-rebuild:
  65. $(START_TRACE) "package/$(patsubst %-rebuild,%,$@)-rebuild: "
  66. $(MAKE) -C $(patsubst %-rebuild,%,$@) rebuild
  67. $(CMD_TRACE) " done"
  68. $(END_TRACE)
  69. %-install:
  70. $(START_TRACE) "package/$(patsubst %-install,%,$@)-install: "
  71. $(MAKE) -C $(patsubst %-install,%,$@) install
  72. $(CMD_TRACE) " done"
  73. $(END_TRACE)
  74. %-clean:
  75. $(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean: "
  76. $(MAKE) -C $(patsubst %-clean,%,$@) clean
  77. $(CMD_TRACE) " done"
  78. $(END_TRACE)