index.mk 747 B

1234567891011121314151617181920212223242526
  1. # Copyright (c) 2015-2016, Loïc Hoguin <essen@ninenines.eu>
  2. # This file is part of erlang.mk and subject to the terms of the ISC License.
  3. .PHONY: search
  4. define pkg_print
  5. $(verbose) printf "%s\n" \
  6. $(if $(call core_eq,$(1),$(pkg_$(1)_name)),,"Pkg name: $(1)") \
  7. "App name: $(pkg_$(1)_name)" \
  8. "Description: $(pkg_$(1)_description)" \
  9. "Home page: $(pkg_$(1)_homepage)" \
  10. "Fetch with: $(pkg_$(1)_fetch)" \
  11. "Repository: $(pkg_$(1)_repo)" \
  12. "Commit: $(pkg_$(1)_commit)" \
  13. ""
  14. endef
  15. search:
  16. ifdef q
  17. $(foreach p,$(PACKAGES), \
  18. $(if $(findstring $(call core_lc,$(q)),$(call core_lc,$(pkg_$(p)_name) $(pkg_$(p)_description))), \
  19. $(call pkg_print,$(p))))
  20. else
  21. $(foreach p,$(PACKAGES),$(call pkg_print,$(p)))
  22. endif