aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/erlydtl.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-28 14:57:05 +0100
committerLoïc Hoguin <[email protected]>2018-11-28 14:57:05 +0100
commit3803446bcd539205af129cc5776ca4034e356629 (patch)
tree217f8feb09676afe4d2ea2ee90ec6b1fc8831cbb /plugins/erlydtl.mk
parentc0e062aafae99877ccb907d95a5c98ce4da62779 (diff)
downloaderlang.mk-3803446bcd539205af129cc5776ca4034e356629.tar.gz
erlang.mk-3803446bcd539205af129cc5776ca4034e356629.tar.bz2
erlang.mk-3803446bcd539205af129cc5776ca4034e356629.zip
Add option DTL_PREFIX for erlydtl-produced module names
Diffstat (limited to 'plugins/erlydtl.mk')
-rw-r--r--plugins/erlydtl.mk5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/erlydtl.mk b/plugins/erlydtl.mk
index 79a1581..3a8b705 100644
--- a/plugins/erlydtl.mk
+++ b/plugins/erlydtl.mk
@@ -5,6 +5,7 @@
DTL_FULL_PATH ?=
DTL_PATH ?= templates/
+DTL_PREFIX ?=
DTL_SUFFIX ?= _dtl
DTL_OPTS ?=
@@ -20,7 +21,7 @@ DTL_FILES := $(sort $(call core_find,$(DTL_PATH),*.dtl))
ifneq ($(DTL_FILES),)
-DTL_NAMES = $(addsuffix $(DTL_SUFFIX),$(DTL_FILES:$(DTL_PATH)/%.dtl=%))
+DTL_NAMES = $(addprefix $(DTL_PREFIX),$(addsuffix $(DTL_SUFFIX),$(DTL_FILES:$(DTL_PATH)/%.dtl=%)))
DTL_MODULES = $(if $(DTL_FULL_PATH),$(subst /,_,$(DTL_NAMES)),$(notdir $(DTL_NAMES)))
BEAM_FILES += $(addsuffix .beam,$(addprefix ebin/,$(DTL_MODULES)))
@@ -45,7 +46,7 @@ define erlydtl_compile.erl
"$(DTL_PATH)/" ++ F2 = filename:rootname(F, ".dtl"),
re:replace(F2, "/", "_", [{return, list}, global])
end,
- Module = list_to_atom(string:to_lower(Module0) ++ "$(DTL_SUFFIX)"),
+ Module = list_to_atom("$(DTL_PREFIX)" ++ string:to_lower(Module0) ++ "$(DTL_SUFFIX)"),
case erlydtl:compile(F, Module, [$(DTL_OPTS)] ++ [{out_dir, "ebin/"}, return_errors]) of
ok -> ok;
{ok, _} -> ok