aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/erlydtl.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-10-12 12:50:22 +0200
committerLoïc Hoguin <[email protected]>2015-10-12 12:50:22 +0200
commitf7ac6d1b54f4d7faf3acb443a48f74b1ef5ea0cf (patch)
treed7bcaae13c90ba454356b1b00eb80929f1045a82 /plugins/erlydtl.mk
parent53703b7eded4e275f50e0b7d90a39648c90bbab3 (diff)
downloaderlang.mk-f7ac6d1b54f4d7faf3acb443a48f74b1ef5ea0cf.tar.gz
erlang.mk-f7ac6d1b54f4d7faf3acb443a48f74b1ef5ea0cf.tar.bz2
erlang.mk-f7ac6d1b54f4d7faf3acb443a48f74b1ef5ea0cf.zip
Add test for and fix DTL_FULL_PATH
Diffstat (limited to 'plugins/erlydtl.mk')
-rw-r--r--plugins/erlydtl.mk13
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/erlydtl.mk b/plugins/erlydtl.mk
index 67dd5b9..dea6366 100644
--- a/plugins/erlydtl.mk
+++ b/plugins/erlydtl.mk
@@ -3,7 +3,7 @@
# Configuration.
-DTL_FULL_PATH ?= 0
+DTL_FULL_PATH ?=
DTL_PATH ?= templates/
DTL_SUFFIX ?= _dtl
@@ -16,10 +16,10 @@ dtl_verbose = $(dtl_verbose_$(V))
define erlydtl_compile.erl
[begin
- Module0 = case $(DTL_FULL_PATH) of
- 0 ->
+ Module0 = case "$(strip $(DTL_FULL_PATH))" of
+ "" ->
filename:basename(F, ".dtl");
- 1 ->
+ _ ->
"$(DTL_PATH)" ++ F2 = filename:rootname(F, ".dtl"),
re:replace(F2, "/", "_", [{return, list}, global])
end,
@@ -35,7 +35,12 @@ endef
ifneq ($(wildcard src/),)
DTL_FILES = $(sort $(call core_find,$(DTL_PATH),*.dtl))
+
+ifdef DTL_FULL_PATH
+BEAM_FILES += $(addprefix ebin/,$(patsubst %.dtl,%_dtl.beam,$(subst /,_,$(DTL_FILES:$(DTL_PATH)%=%))))
+else
BEAM_FILES += $(addprefix ebin/,$(patsubst %.dtl,%_dtl.beam,$(notdir $(DTL_FILES))))
+endif
ebin/$(PROJECT).app:: $(DTL_FILES)
$(if $(strip $?),\