aboutsummaryrefslogtreecommitdiffstats
path: root/core/core.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-11-05 16:21:57 +0200
committerLoïc Hoguin <[email protected]>2014-11-05 16:21:57 +0200
commit92626f1548c1dea677594c48040066ac2bb6f550 (patch)
tree520d1b089ac998ef7862ba563ed343d89351c7e5 /core/core.mk
parent724f024bbffaa56dadb10ed88130831ed7e81b09 (diff)
downloaderlang.mk-92626f1548c1dea677594c48040066ac2bb6f550.tar.gz
erlang.mk-92626f1548c1dea677594c48040066ac2bb6f550.tar.bz2
erlang.mk-92626f1548c1dea677594c48040066ac2bb6f550.zip
Add an erlang-mk target for automated updating of erlang.mk
Diffstat (limited to 'core/core.mk')
-rw-r--r--core/core.mk14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/core.mk b/core/core.mk
index ec42331..0b06f73 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -12,7 +12,7 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.PHONY: all deps app rel docs tests clean distclean help
+.PHONY: all deps app rel docs tests clean distclean help erlang-mk
ERLANG_MK_VERSION = 1
@@ -71,3 +71,15 @@ define core_http_get
erl -noshell -eval 'ssl:start(), inets:start(), case httpc:request(get, {"$(2)", []}, [{autoredirect, true}], []) of {ok, {{_, 200, _}, _, Body}} -> case file:write_file("$(1)", Body) of ok -> ok; {error, R1} -> halt(R1) end; {error, R2} -> halt(R2) end, halt(0).'
endef
endif
+
+# Automated update.
+
+ERLANG_MK_BUILD_CONFIG ?= build.config
+ERLANG_MK_BUILD_DIR ?= .erlang.mk.build
+
+erlang-mk:
+ git clone https://github.com/ninenines/erlang.mk $(ERLANG_MK_BUILD_DIR)
+ if [ -f $(ERLANG_MK_BUILD_CONFIG) ]; then cp $(ERLANG_MK_BUILD_CONFIG) $(ERLANG_MK_BUILD_DIR); fi
+ cd $(ERLANG_MK_BUILD_DIR) && make
+ cp $(ERLANG_MK_BUILD_DIR)/erlang.mk ./erlang.mk
+ rm -rf $(ERLANG_MK_BUILD_DIR)