depends.mk 686 B

12345678910111213141516171819202122232425262728
  1. #
  2. # Copyright (C) 2007 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # define a dependency on a subtree
  8. # parameters:
  9. # 1: directory
  10. # 2: directory dependency
  11. # 3: tempfile for file listings
  12. # 4: find options
  13. FINDPARAMS := -type f -not -name ".*" -and -not -path "*.svn*"
  14. define rdep
  15. $(foreach file,$(shell find $(1) $(FINDPARAMS) -and -not -path "*:*" $(4)),
  16. $(2): $(file)
  17. $(file): ;
  18. )
  19. ifneq ($(shell find $(1) $(FINDPARAMS) $(4) 2>/dev/null | md5s),$(shell cat $(3) 2>/dev/null))
  20. $(2): $(3)
  21. endif
  22. $(3): FORCE
  23. @-find $(1) $(FINDPARAMS) $(4) 2>/dev/null | md5s > $$@
  24. endef