Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_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. package-$(ADK_PACKAGE_LIBPTHREAD) += libpthread
  19. include $(TOPDIR)/package/Depends.mk
  20. DOWNLOAD:=$(patsubst %,%-download,$(package-y) $(package-m))
  21. REBUILD_PACKAGES:=$(patsubst %,%-rebuild,$(package-y) $(package-m))
  22. COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y) $(package-m))
  23. INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
  24. all: compile
  25. download: $(DOWNLOAD)
  26. clean: $(patsubst %,%-clean,$(package-) $(package-y) $(package-m) base-files)
  27. ifeq ($(ADK_TOOLCHAIN_ONLY),y)
  28. compile: $(REBUILD_PACKAGES) $(COMPILE_PACKAGES)
  29. install: $(INSTALL_PACKAGES)
  30. else
  31. compile: $(REBUILD_PACKAGES) base-files-compile $(COMPILE_PACKAGES)
  32. install: base-files-install $(INSTALL_PACKAGES)
  33. endif
  34. %-download:
  35. $(START_TRACE) "package/$(patsubst %-download,%,$@)-download: "
  36. $(MAKE) -C $(patsubst %-download,%,$@) fetch
  37. $(CMD_TRACE) " done"
  38. $(END_TRACE)
  39. %-host-compile:
  40. $(START_TRACE) "package/$(patsubst %-host-compile,%,$@)-host-compile: "
  41. $(MAKE) -C $(patsubst %-host-compile,%,$@) hostpackage
  42. $(CMD_TRACE) " done"
  43. $(END_TRACE)
  44. %-compile:
  45. $(START_TRACE) "package/$(patsubst %-compile,%,$@)-compile: "
  46. $(MAKE) -C $(patsubst %-compile,%,$@) fake build-all-pkgs
  47. $(CMD_TRACE) " done"
  48. $(END_TRACE)
  49. %-rebuild:
  50. $(START_TRACE) "package/$(patsubst %-rebuild,%,$@)-rebuild: "
  51. $(MAKE) -C $(patsubst %-rebuild,%,$@) rebuild
  52. $(CMD_TRACE) " done"
  53. $(END_TRACE)
  54. %-install:
  55. $(START_TRACE) "package/$(patsubst %-install,%,$@)-install: "
  56. $(MAKE) -C $(patsubst %-install,%,$@) install
  57. $(CMD_TRACE) " done"
  58. $(END_TRACE)
  59. %-clean:
  60. $(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean: "
  61. $(MAKE) -C $(patsubst %-clean,%,$@) clean
  62. $(CMD_TRACE) " done"
  63. $(END_TRACE)