aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/core.mk2
-rw-r--r--core/deps.mk8
-rw-r--r--core/erlc.mk11
3 files changed, 17 insertions, 4 deletions
diff --git a/core/core.mk b/core/core.mk
index f73ef7f..ec42331 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -68,6 +68,6 @@ define core_http_get
endef
else
define core_http_get
- erl -noshell -eval ' ssl:start(), inets:start(), case httpc:request(get, {"$(2)", []}, [{autoredirect, true}], []) of {ok, {{_V, 200, _R}, _H, Body}} -> case file:write_file("$(1)", Body) of ok -> ok ; {error, R1} -> halt(R1) end ; {error, R2} -> halt(R2) end, halt(0). '
+ 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
diff --git a/core/deps.mk b/core/deps.mk
index 6929f5f..490e675 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -46,7 +46,11 @@ define dep_fetch
if [ "$$$$VS" = "git" ]; then \
git clone -n -- $$$$REPO $(DEPS_DIR)/$(1); \
cd $(DEPS_DIR)/$(1) && git checkout -q $$$$COMMIT; \
+ elif [ "$$$$VS" = "hg" ]; then \
+ hg clone -U $$$$REPO $(DEPS_DIR)/$(1); \
+ cd $(DEPS_DIR)/$(1) && hg update -q $$$$COMMIT; \
else \
+ echo "Unknown or invalid dependency: $(1). Please consult the erlang.mk README for instructions." >&2; \
exit 78; \
fi
endef
@@ -56,13 +60,13 @@ $(DEPS_DIR)/$(1):
@mkdir -p $(DEPS_DIR)
@if [ ! -f $(PKG_FILE2) ]; then $(call core_http_get,$(PKG_FILE2),$(PKG_FILE_URL)); fi
ifeq (,$(dep_$(1)))
- DEPPKG=$$$$(awk 'BEGIN { FS = "\t" }; $$$$1 == "$(1)" { print $$$$2 " " $$$$3 " " $$$$4 }' $(PKG_FILE2);) \
+ @DEPPKG=$$$$(awk 'BEGIN { FS = "\t" }; $$$$1 == "$(1)" { print $$$$2 " " $$$$3 " " $$$$4 }' $(PKG_FILE2);); \
VS=$$$$(echo $$$$DEPPKG | cut -d " " -f1); \
REPO=$$$$(echo $$$$DEPPKG | cut -d " " -f2); \
COMMIT=$$$$(echo $$$$DEPPKG | cut -d " " -f3); \
$(call dep_fetch,$(1))
else
- VS=$(word 1,$(dep_$(1))); \
+ @VS=$(word 1,$(dep_$(1))); \
REPO=$(word 2,$(dep_$(1))); \
COMMIT=$(word 3,$(dep_$(1))); \
$(call dep_fetch,$(1))
diff --git a/core/erlc.mk b/core/erlc.mk
index 87d10d8..03e174e 100644
--- a/core/erlc.mk
+++ b/core/erlc.mk
@@ -23,9 +23,13 @@ xyrl_verbose = $(xyrl_verbose_$(V))
# Core targets.
-app:: ebin/$(PROJECT).app
+app:: erlc-include ebin/$(PROJECT).app
$(eval MODULES := $(shell find ebin -type f -name \*.beam \
| sed "s/ebin\//'/;s/\.beam/',/" | sed '$$s/.$$//'))
+ @if [ -z "$$(grep -E '^[^%]*{modules,' src/$(PROJECT).app.src)" ]; then \
+ echo "Empty modules entry not found in $(PROJECT).app.src. Please consult the erlang.mk README for instructions." >&2; \
+ exit 1; \
+ fi
$(appsrc_verbose) cat src/$(PROJECT).app.src \
| sed "s/{modules,[[:space:]]*\[\]}/{modules, \[$(MODULES)\]}/" \
> ebin/$(PROJECT).app
@@ -58,5 +62,10 @@ clean:: clean-app
# Extra targets.
+erlc-include:
+ -@if [ -d ebin/ ]; then \
+ find include/ src/ -type f -name \*.hrl -newer ebin -exec touch $(shell find src/ -type f -name "*.erl") \; 2>/dev/null || printf ''; \
+ fi
+
clean-app:
$(gen_verbose) rm -rf ebin/