Makefile 2.1 KB

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