Makefile 2.2 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 $(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_NATIVE},y)
  14. package-$(ADK_PACKAGE_LIBC) += libc
  15. endif
  16. ifneq (${ADK_NATIVE},y)
  17. package-$(ADK_PACKAGE_LIBPTHREAD) += libpthread
  18. endif
  19. ifneq (${ADK_TARGET_LIB_GLIBC},y)
  20. ifneq (${ADK_TARGET_LIB_EGLIBC},y)
  21. ifneq (${ADK_NATIVE},y)
  22. package-$(ADK_PACKAGE_UCLIBC) += uclibc
  23. gcc-compile: uclibc-compile
  24. endif
  25. package-$(ADK_PACKAGE_UCLIBCXX) += uclibc++
  26. endif
  27. endif
  28. include $(TOPDIR)/package/Depends.mk
  29. DOWNLOAD:=$(patsubst %,%-download,$(package-y) $(package-m))
  30. REBUILD_PACKAGES:=$(patsubst %,%-rebuild,$(package-y) $(package-m))
  31. COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
  32. INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
  33. all: compile
  34. download: $(DOWNLOAD)
  35. clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m) base-files)
  36. ifeq ($(ADK_TOOLCHAIN_ONLY),y)
  37. compile: $(REBUILD_PACKAGES) $(COMPILE_PACKAGES)
  38. install: $(INSTALL_PACKAGES)
  39. else
  40. compile: $(REBUILD_PACKAGES) base-files-compile $(COMPILE_PACKAGES)
  41. install: base-files-install $(INSTALL_PACKAGES)
  42. endif
  43. $(TARGET_DIR):
  44. mkdir -p $(TARGET_DIR)
  45. %-download:
  46. $(START_TRACE) "package/$(patsubst %-download,%,$@)-download: "
  47. $(MAKE) -C $(patsubst %-download,%,$@) fetch
  48. $(CMD_TRACE) " done"
  49. $(END_TRACE)
  50. %-compile:
  51. $(START_TRACE) "package/$(patsubst %-compile,%,$@)-compile: "
  52. $(MAKE) -C $(patsubst %-compile,%,$@) fake build-all-pkgs
  53. $(CMD_TRACE) " done"
  54. $(END_TRACE)
  55. %-rebuild:
  56. $(START_TRACE) "package/$(patsubst %-rebuild,%,$@)-rebuild: "
  57. $(MAKE) -C $(patsubst %-rebuild,%,$@) rebuild
  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)