Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_builddir=../
  8. include Rules.mak
  9. ALL_SUBDIRS := $(patsubst %/Makefile,%,$(wildcard */Makefile))
  10. DIRS := $(ALL_SUBDIRS)
  11. ifneq ($(HAVE_SHARED)$(UCLIBC_HAS_THREADS),yy)
  12. DIRS := $(filter-out dlopen,$(DIRS))
  13. endif
  14. ifneq ($(findstring -static,$(LDFLAGS)),)
  15. DIRS := $(filter-out dlopen,$(DIRS))
  16. endif
  17. ifneq ($(UCLIBC_HAS_THREADS),y)
  18. DIRS := $(filter-out pthread,$(DIRS))
  19. endif
  20. ifneq ($(UCLIBC_HAS_FULL_RPC),y)
  21. DIRS := $(filter-out rpc,$(DIRS))
  22. endif
  23. ifneq ($(UCLIBC_HAS_REGEX),y)
  24. DIRS := $(filter-out regex,$(DIRS))
  25. endif
  26. ifneq ($(UCLIBC_HAS_WCHAR),y)
  27. DIRS := $(filter-out locale-mbwc,$(DIRS))
  28. endif
  29. ifneq ($(UCLIBC_HAS_LOCALE),y)
  30. DIRS := $(filter-out locale,$(DIRS))
  31. endif
  32. ifeq ($(UCLIBC_HAS_CRYPT_STUB),y)
  33. DIRS := $(filter-out crypt,$(DIRS))
  34. endif
  35. ifeq ($(HAS_NO_THREADS),y)
  36. DIRS := $(filter-out pthread,$(DIRS))
  37. endif
  38. DIRS := $(filter-out math,$(DIRS))
  39. test check all: run
  40. run: subdirs_run
  41. compile: $(top_builddir)/$(LOCAL_INSTALL_PATH) subdirs_compile
  42. $(top_builddir)/$(LOCAL_INSTALL_PATH):
  43. $(Q)$(MAKE) -C $(top_builddir) $(LOCAL_INSTALL_PATH)
  44. tags:
  45. ctags -R
  46. clean: subdirs_clean
  47. subdirs: $(patsubst %, _dir_%, $(DIRS))
  48. subdirs_compile: $(patsubst %, _dircompile_%, $(DIRS))
  49. subdirs_run: $(patsubst %, _dirrun_%, $(DIRS))
  50. subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
  51. $(patsubst %, _dir_%, $(DIRS)) : dummy
  52. $(Q)$(MAKE) -C $(patsubst _dir_%, %, $@)
  53. $(patsubst %, _dirrun_%, $(DIRS)) : dummy
  54. $(Q)$(MAKE) -C $(patsubst _dirrun_%, %, $@) run
  55. $(patsubst %, _dircompile_%, $(DIRS)) : dummy
  56. $(Q)$(MAKE) -C $(patsubst _dircompile_%, %, $@) compile
  57. $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
  58. $(Q)$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
  59. .PHONY: all check clean dummy subdirs_compile subdirs_run subdirs subdirs_clean test run compile