Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  7. top_srcdir=../
  8. top_builddir=../
  9. include Rules.mak
  10. ALL_SUBDIRS := $(patsubst %/Makefile,%,$(wildcard */Makefile))
  11. DIRS := $(ALL_SUBDIRS)
  12. ifneq ($(HAVE_SHARED)$(UCLIBC_HAS_THREADS),yy)
  13. DIRS := $(filter-out dlopen,$(DIRS))
  14. endif
  15. ifneq ($(findstring -static,$(LDFLAGS)),)
  16. DIRS := $(filter-out dlopen,$(DIRS))
  17. endif
  18. ifneq ($(UCLIBC_HAS_THREADS)$(ARCH_USE_MMU),yy)
  19. DIRS := $(filter-out pthread,$(DIRS))
  20. endif
  21. ifneq ($(UCLIBC_HAS_FULL_RPC),y)
  22. DIRS := $(filter-out rpc,$(DIRS))
  23. endif
  24. ifneq ($(UCLIBC_HAS_REGEX),y)
  25. DIRS := $(filter-out regex,$(DIRS))
  26. endif
  27. ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  28. DIRS := $(filter-out tls nptl,$(DIRS))
  29. endif
  30. ifneq ($(UCLIBC_HAS_WCHAR),y)
  31. DIRS := $(filter-out locale-mbwc,$(DIRS))
  32. endif
  33. ifneq ($(UCLIBC_HAS_LOCALE),y)
  34. DIRS := $(filter-out locale,$(DIRS))
  35. endif
  36. ifneq ($(UCLIBC_HAS_CRYPT_IMPL),y)
  37. DIRS := $(filter-out crypt,$(DIRS))
  38. endif
  39. ifeq ($(HAS_NO_THREADS),y)
  40. DIRS := $(filter-out pthread,$(DIRS))
  41. endif
  42. ifneq ($(UCLIBC_HAS_ARGP),y)
  43. DIRS := $(filter-out argp,$(DIRS))
  44. endif
  45. test check all: run
  46. run: subdirs_run
  47. gen:
  48. -rm -f $(top_builddir)/test/uclibcng-testrunner.in
  49. $(MAKE) run UCLIBCNG_GENERATE_TESTRUNNER=1
  50. compile: $(top_builddir)$(LOCAL_INSTALL_PATH) subdirs_compile
  51. $(top_builddir)$(LOCAL_INSTALL_PATH):
  52. $(Q)$(MAKE) -C $(top_builddir) $(LOCAL_INSTALL_PATH)
  53. tags:
  54. ctags -R
  55. clean: subdirs_clean
  56. subdirs: $(patsubst %, _dir_%, $(DIRS))
  57. subdirs_compile: $(patsubst %, _dircompile_%, $(DIRS))
  58. subdirs_run: $(patsubst %, _dirrun_%, $(DIRS))
  59. subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
  60. $(patsubst %, _dir_%, $(DIRS)) : dummy
  61. $(Q)$(MAKE) -C $(patsubst _dir_%, %, $@) \
  62. KCONFIG_CONFIG=$(KCONFIG_CONFIG)
  63. $(patsubst %, _dirrun_%, $(DIRS)) : dummy
  64. $(Q)$(MAKE) -C $(patsubst _dirrun_%, %, $@) run \
  65. UCLIBCNG_TEST_SUBDIR=$(strip $(patsubst _dirrun_%, %, $@)) \
  66. KCONFIG_CONFIG=$(KCONFIG_CONFIG)
  67. $(patsubst %, _dircompile_%, $(DIRS)) : dummy
  68. $(Q)$(MAKE) -C $(patsubst _dircompile_%, %, $@) compile \
  69. KCONFIG_CONFIG=$(KCONFIG_CONFIG)
  70. $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
  71. $(Q)$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  72. .PHONY: all check clean dummy subdirs_compile subdirs_run subdirs subdirs_clean test run compile