Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. package-$(ADK_PACKAGE_LIBPTHREAD) += libpthread
  19. include $(ADK_TOPDIR)/package/Depends.mk
  20. COMPILE_PACKAGES:=$(patsubst %,%-compile,$(package-y))
  21. HOST_COMPILE_PACKAGES:=$(patsubst %,%-host-compile,$(hostpackage-y))
  22. INSTALL_PACKAGES:=$(patsubst %,%-install,$(package-y))
  23. all: compile
  24. download: $(patsubst %,%-download,$(package-y))
  25. clean: $(patsubst %,%-clean,$(package-) $(package-y) base-files)
  26. hostcompile: $(HOST_COMPILE_PACKAGES)
  27. ifeq ($(ADK_TOOLCHAIN_ONLY),y)
  28. compile: $(COMPILE_PACKAGES)
  29. install: $(INSTALL_PACKAGES)
  30. else
  31. compile: 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. @if test -f $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@); then \
  47. $(MAKE) -C $(patsubst %-compile,%,$@) clean ; \
  48. rm $(ADK_TOPDIR)/.rebuild.$(patsubst %-compile,%,$@) ; \
  49. fi
  50. $(MAKE) -C $(patsubst %-compile,%,$@) fake build-all-pkgs
  51. $(CMD_TRACE) " done"
  52. $(END_TRACE)
  53. %-install:
  54. $(START_TRACE) "package/$(patsubst %-install,%,$@)-install: "
  55. $(MAKE) -C $(patsubst %-install,%,$@) install
  56. $(CMD_TRACE) " done"
  57. $(END_TRACE)
  58. %-clean:
  59. $(START_TRACE) "package/$(patsubst %-clean,%,$@)-clean: "
  60. $(MAKE) -C $(patsubst %-clean,%,$@) clean
  61. $(CMD_TRACE) " done"
  62. $(END_TRACE)