原文連接 https://erlang.mk/guide/why.htmlhtml
Why would you choose Erlang.mk, if not for its many features ? This chapter will attempt to answer that.app
若是不是 Erlang.mk 的不少功能,爲何你會選擇它?本章試圖回答這個問題。編輯器
Erlang.mk is as fast as it gets.ide
Erlang.mk編譯和它的獲取同樣快。工具
Erlang.mk will group the compilation of files so as to avoid running the BEAM more than necessary. This saves many seconds compared to traditional Makefiles, even on small projects.測試
Erlang.mk將對文件進行分組,以免運行沒必要要的BEAM。與傳統的Makefiles相比,這會節省了許多秒,即便在小型項目上也是如此。fetch
Erlang.mk will not try to be too smart. It provides a simple solution that works for most people, and gives additional options for projects that run into edge cases, often in the form of extra variables or rules to be defined.ui
Erlang.mk不會試圖變得更聰明。 它提供了一個適用於大多數人的簡單解決方案,併爲處於邊緣狀況的項目提供了額外選項,一般以擴展變量或規則的形式進行定義。this
Erlang.mk is a Makefile.spa
Erlang.mk就是一個Makefile。
You could use Erlang.mk directly without configuring anything and it would just work. But you can also extend it greatly either through configuration or hooks, and you can of course add your own rules to the Makefile.
你無需配置任何東西,就能夠直接使用Erlang.mk工做。 可是你也能夠經過配置或鉤子來擴展它,固然你也能夠將自定義規則添加到Makefile中。
In all cases: for configuration, hooks or custom rules, you have all the power of Unix at your disposal, and can call any utility or even any language interpreter you want, every time you need to. Erlang.mk also allows you to write scripts in this small language called Erlang directly inside your Makefile if you ever need to…
對於全部這些擴展Erlang.mk的方式(配置、鉤子或自定義規則),你均可以使用Unix的全部功能,也能夠在須要的時候調用任何實用工具,甚至是調用任何你想要的語言解釋器。 若是須要,Erlang.mk也容許你直接在Makefile中使用Erlang編寫的腳本。
Erlang.mk is a Makefile.
Erlang.mk就是一個Makefile文件。
Which means Erlang.mk is a simple text file. You can edit a text file. Nothing stops you. If you run into any bug, or behavior that does not suit you, you can just open theerlang.mk file in your favorite editor, fix and/or comment a few lines, save, and try again. It’s as simple as it gets.
這意味着Erlang.mk是一個簡單的文本文件。它是如此簡單,以致於當遇到任何bug或者不是你期待的表現,你均可以用本身喜歡的編輯器打開erlang.mk文件,修復或者註釋幾行,沒有什麼能阻止你。
Currently using a binary build tool? Good luck with that.
目前你還在使用二進制構建工具?那祝你好運咯!:)
Erlang.mk isn’t written in Erlang.
Erlang.mk不是用Erlang寫的。
That’s not a good thing, you say? Well, here’s one thing that Erlang.mk and Makefiles can do for you that Erlang build tool can’t easily: choose what version of Erlang is to be used for compiling the project.
你認爲這不是一件好事? 好吧。可是,Erlang.mk和Makefiles能夠爲你作一件Erlang構建工具不能輕易作到的事:選擇編譯項目的Erlang版本。
This really is a one-liner in Erlang.mk (a few more lines if you also let it download and build Erlang directly) and allows for even greater things, like testing your project across all supported Erlang versions in one small command: make -k ci
.
這其實是Erlang.mk中的一行代碼(若是你要用Erlang.mk下載並構建Erlang,你也能夠寫更多代碼)。甚至更復雜的事也可使用Erlang.mk來完成,像是在全部支持的Erlang版本中測試你的項目就只須要一條簡單的命令: make -k ci
。
Erlang.mk doesn’t care what your dependencies are written in.
Erlang.mk不關心你寫入了什麼樣的依賴關係。
Erlang.mk will happily compile any dependency, as long as they come with a Makefile. The dependency can be written in C, C++ or even Javascript… Who cares, really? If you need Erlang.mk to fetch it, then Erlang.mk will fetch it and compile it as needed.
Erlang.mk會很高興地編譯任何依賴,只要這些依賴自身帶有Makefile文件。 依賴關係能夠是C,C ++甚至Javascript工程...誰在意,真的嗎? 若是你須要Erlang.mk來獲取它,那麼Erlang.mk將獲取它並在須要時編譯它。
If you are planning to put your project in the middle of a Make or Automake-based build environment, then the most logical thing to do is to use a Makefile.
若是你打算使用 make 或者 automake 來構建項目,那麼理所固然也會使用Makefile。
Erlang.mk will happily sit in such an environment and behave as you expect it to.
Erlang.mk能順利的集成在這樣的環境中,並表現得如你所願。