aboutsummaryrefslogtreecommitdiffstats
path: root/erlang.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-01-04 19:55:39 +0100
committerLoïc Hoguin <[email protected]>2015-01-04 19:55:39 +0100
commita2e0f9cc31956dd1db877e72ce6ea9134400d586 (patch)
tree42a33c29428b907de3676c3f6993a25e316ee565 /erlang.mk
parentdbd45b8540fe75017e60abfb18a2075cd9d2bc3e (diff)
parentba41fb80efcd2083d1cc98802a118d4db2c1eaf8 (diff)
downloaderlang.mk-a2e0f9cc31956dd1db877e72ce6ea9134400d586.tar.gz
erlang.mk-a2e0f9cc31956dd1db877e72ce6ea9134400d586.tar.bz2
erlang.mk-a2e0f9cc31956dd1db877e72ce6ea9134400d586.zip
Merge branch 'patch-2' of https://github.com/brigadier/erlang.mk
Diffstat (limited to 'erlang.mk')
-rw-r--r--erlang.mk12
1 files changed, 9 insertions, 3 deletions
diff --git a/erlang.mk b/erlang.mk
index 7816648..fa52243 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -918,6 +918,10 @@ distclean-elvis:
# Copyright (c) 2013-2014, Loïc Hoguin <[email protected]>
# This file is part of erlang.mk and subject to the terms of the ISC License.
+# Configuration.
+
+DTL_FULL_PATH ?= 0
+
# Verbosity.
dtl_verbose_0 = @echo " DTL " $(filter %.dtl,$(?F));
@@ -928,9 +932,11 @@ dtl_verbose = $(dtl_verbose_$(V))
define compile_erlydtl
$(dtl_verbose) erl -noshell -pa ebin/ $(DEPS_DIR)/erlydtl/ebin/ -eval ' \
Compile = fun(F) -> \
- Module = list_to_atom( \
- string:to_lower(filename:basename(F, ".dtl")) ++ "_dtl"), \
- erlydtl:compile(F, Module, [{out_dir, "ebin/"}]) \
+ S = fun (1) -> re:replace(filename:rootname(string:sub_string(F, 11), ".dtl"), "/", "_", [{return, list}, global]); \
+ (0) -> filename:basename(F, ".dtl") \
+ end, \
+ Module = list_to_atom(string:to_lower(S($(DTL_FULL_PATH))) ++ "_dtl"), \
+ {ok, _} = erlydtl:compile(F, Module, [{out_dir, "ebin/"}, return_errors, {doc_root, "templates"}]) \
end, \
_ = [Compile(F) || F <- string:tokens("$(1)", " ")], \
init:stop()'