why.asciidoc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [[why]]
  2. == Why Erlang.mk
  3. Why would you choose Erlang.mk, if not for its
  4. xref:overview[many features]? This chapter will
  5. attempt to answer that.
  6. === Erlang.mk is fast
  7. Erlang.mk is as fast as it gets.
  8. Erlang.mk will group the compilation of files so as to avoid
  9. running the BEAM more than necessary. This saves many seconds
  10. compared to traditional Makefiles, even on small projects.
  11. Erlang.mk will not try to be too smart. It provides a simple
  12. solution that works for most people, and gives additional
  13. options for projects that run into edge cases, often in the
  14. form of extra variables or rules to be defined.
  15. === Erlang.mk gives you the full power of Unix
  16. Erlang.mk is a Makefile.
  17. You could use Erlang.mk directly without configuring anything
  18. and it would just work. But you can also extend it greatly
  19. either through configuration or hooks, and you can of course
  20. add your own rules to the Makefile.
  21. In all cases: for configuration, hooks or custom rules, you
  22. have all the power of Unix at your disposal, and can call
  23. any utility _or even any language interpreter_ you want,
  24. every time you need to. Erlang.mk also allows you to write
  25. scripts in this small language called Erlang directly inside
  26. your Makefile if you ever need to...
  27. === Erlang.mk is a text file
  28. Erlang.mk is a Makefile.
  29. Which means Erlang.mk is a simple text file. You can edit a
  30. text file. Nothing stops you. If you run into any bug, or
  31. behavior that does not suit you, you can just open the
  32. 'erlang.mk' file in your favorite editor, fix and/or comment
  33. a few lines, save, and try again. It's as simple as it gets.
  34. Currently using a binary build tool? Good luck with that.
  35. === Erlang.mk can manage Erlang itself
  36. Erlang.mk isn't written in Erlang.
  37. That's not a good thing, you say? Well, here's one thing
  38. that Erlang.mk and Makefiles can do for you that Erlang
  39. build tool can't easily: choose what version of Erlang is
  40. to be used for compiling the project.
  41. This really is a one-liner in Erlang.mk (a few more lines
  42. if you also let it download and build Erlang directly)
  43. and allows for even greater things, like testing your
  44. project across all supported Erlang versions in one small
  45. command: `make -k ci`.
  46. === Erlang.mk can do more than Erlang
  47. Erlang.mk doesn't care what your dependencies are written in.
  48. Erlang.mk will happily compile any dependency, as long as
  49. they come with a Makefile. The dependency can be written
  50. in C, C++ or even Javascript... Who cares, really? If you
  51. need Erlang.mk to fetch it, then Erlang.mk will fetch it
  52. and compile it as needed.
  53. === Erlang.mk integrates nicely in Make and Automake projects
  54. If you are planning to put your project in the middle of
  55. a Make or Automake-based build environment, then the most
  56. logical thing to do is to use a Makefile.
  57. Erlang.mk will happily sit in such an environment and behave
  58. as you expect it to.