core.mk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # Copyright (c) 2013-2014, Loïc Hoguin <essen@ninenines.eu>
  2. #
  3. # Permission to use, copy, modify, and/or distribute this software for any
  4. # purpose with or without fee is hereby granted, provided that the above
  5. # copyright notice and this permission notice appear in all copies.
  6. #
  7. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. .PHONY: all deps app rel docs tests clean distclean help
  15. ERLANG_MK_VERSION = 1
  16. # Core configuration.
  17. PROJECT ?= $(notdir $(CURDIR))
  18. # Verbosity.
  19. V ?= 0
  20. gen_verbose_0 = @echo " GEN " $@;
  21. gen_verbose = $(gen_verbose_$(V))
  22. # Core targets.
  23. all:: deps app rel
  24. clean::
  25. $(gen_verbose) rm -f erl_crash.dump
  26. distclean:: clean
  27. help::
  28. @printf "%s\n" \
  29. "erlang.mk (version $(ERLANG_MK_VERSION)) is distributed under the terms of the ISC License." \
  30. "Copyright (c) 2013-2014 Loïc Hoguin <essen@ninenines.eu>" \
  31. "" \
  32. "Usage: [V=1] make [target]" \
  33. "" \
  34. "Core targets:" \
  35. " all Run deps, app and rel targets in that order" \
  36. " deps Fetch dependencies (if needed) and compile them" \
  37. " app Compile the project" \
  38. " rel Build a release for this project, if applicable" \
  39. " docs Build the documentation for this project" \
  40. " tests Run the tests for this project" \
  41. " clean Delete temporary and output files from most targets" \
  42. " distclean Delete all temporary and output files" \
  43. " help Display this help and exit" \
  44. "" \
  45. "The target clean only removes files that are commonly removed." \
  46. "Dependencies and releases are left untouched." \
  47. "" \
  48. "Setting V=1 when calling make enables verbose mode."
  49. # Core functions.
  50. define core_http_get
  51. wget --no-check-certificate -O $(1) $(2)|| rm $(1)
  52. endef