summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authoreksperimental <eksperimental@users.noreply.github.com>2016-02-18 07:29:36 +0700
committereksperimental <eksperimental@users.noreply.github.com>2016-02-18 07:29:48 +0700
commitd8cc1927e5930b2e313ceb16b132279f5418d41d (patch)
treeb2cf349d930000a97f6e3e80747fc8bbf0acc16b /Makefile
parent800c2a35d30a8c1bd5c619c934d334423b3fedc7 (diff)
downloadelixir-d8cc1927e5930b2e313ceb16b132279f5418d41d.tar.gz
Makefile and System.revision/0 no longer read from .git/HEAD
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 345d443b6..aebbe40af 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,8 @@ INSTALL = install
INSTALL_DIR = $(INSTALL) -m755 -d
INSTALL_DATA = $(INSTALL) -m644
INSTALL_PROGRAM = $(INSTALL) -m755
+GIT_REVISION = $(strip $(shell git rev-parse HEAD 2> /dev/null ))
+GIT_TAG = $(strip $(shell head="$(call GIT_REVISION)"; git tag --points-at $$head 2> /dev/null | tail -1) )
.PHONY: install compile erlang elixir build_plt clean_plt dialyze test clean install_man clean_man docs Docs.zip Precompiled.zip publish_zips publish_docs publish_mix
.NOTPARALLEL: compile
@@ -19,9 +21,9 @@ INSTALL_PROGRAM = $(INSTALL) -m755
define CHECK_ERLANG_RELEASE
$(Q) erl -noshell -eval 'io:fwrite("~s", [erlang:system_info(otp_release) >= "18"])' -s erlang halt | grep -q '^true'; \
- if [ $$? != 0 ]; then \
- echo "At least Erlang 18.0 is required to build Elixir"; \
- exit 1; \
+ if [ $$? != 0 ]; then \
+ echo "At least Erlang 18.0 is required to build Elixir"; \
+ exit 1; \
fi;
endef
@@ -71,7 +73,7 @@ elixir: stdlib lib/eex/ebin/Elixir.EEx.beam mix ex_unit logger eex iex
stdlib: $(KERNEL) VERSION
$(KERNEL): lib/elixir/lib/*.ex lib/elixir/lib/*/*.ex lib/elixir/lib/*/*/*.ex
- $(Q) if [ ! -f $(KERNEL) ]; then \
+ $(Q) if [ ! -f $(KERNEL) ]; then \
echo "==> bootstrap (compile)"; \
$(ERL) -s elixir_compiler core -s erlang halt; \
fi
@@ -124,10 +126,10 @@ clean:
clean_exbeam:
$(Q) rm -f lib/*/ebin/Elixir.*.beam
-#==> Create Documentation
+#==> Create Documentation
LOGO_PATH = $(shell test -f ../docs/logo.png && echo "--logo ../docs/logo.png")
-SOURCE_REF = $(shell head="$$(git rev-parse HEAD)" tag="$$(git tag --points-at $$head | tail -1)" ; echo "$${tag:-$$head}\c")
+SOURCE_REF = $(shell tag="$(call GIT_TAG)" revision="$(call GIT_REVISION)"; echo "$${tag:-$$revision}\c")
COMPILE_DOCS = bin/elixir ../ex_doc/bin/ex_doc "$(1)" "$(VERSION)" "lib/$(2)/ebin" -m "$(3)" -u "https://github.com/elixir-lang/elixir" --source-ref "$(call SOURCE_REF)" $(call LOGO_PATH) -o doc/$(2) -p http://elixir-lang.org/docs.html $(4)
docs: compile ../ex_doc/bin/ex_doc docs_elixir docs_eex docs_mix docs_iex docs_ex_unit docs_logger