Makefile 1.9 KB

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