aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/erlydtl.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-12-15 11:34:11 +0100
committerLoïc Hoguin <[email protected]>2015-12-15 11:34:11 +0100
commit2819f56756353432ff7629c4731dc6a080f8b55e (patch)
tree3d32aa5f797b6f6c36d6cd04f549c7707ef35022 /plugins/erlydtl.mk
parent7cbb09937960b392ab619076a12e77ebbf88407a (diff)
downloaderlang.mk-2819f56756353432ff7629c4731dc6a080f8b55e.tar.gz
erlang.mk-2819f56756353432ff7629c4731dc6a080f8b55e.tar.bz2
erlang.mk-2819f56756353432ff7629c4731dc6a080f8b55e.zip
Fix parallel issues caused by ErlyDTL
Issues were introduced by f58af72831338efba4d5e20898cf92c0ed9f1c0f. In addition some rework has been done: * We don't care about src/, only about templates/ * Fix a misplaced closing paren (why was it working before?) * Move most of the rules and defines inside the ifdef
Diffstat (limited to 'plugins/erlydtl.mk')
-rw-r--r--plugins/erlydtl.mk34
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins/erlydtl.mk b/plugins/erlydtl.mk
index 506e793..5fde292 100644
--- a/plugins/erlydtl.mk
+++ b/plugins/erlydtl.mk
@@ -14,6 +14,20 @@ dtl_verbose = $(dtl_verbose_$(V))
# Core targets.
+DTL_FILES = $(sort $(call core_find,$(DTL_PATH),*.dtl))
+
+ifneq ($(DTL_FILES),)
+
+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
+
+# Rebuild templates when the Makefile changes.
+$(DTL_FILES): $(MAKEFILE_LIST)
+ @touch $@
+
define erlydtl_compile.erl
[begin
Module0 = case "$(strip $(DTL_FULL_PATH))" of
@@ -32,22 +46,8 @@ define erlydtl_compile.erl
halt().
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
-
-# Rebuild templates when the Makefile changes.
-$(DTL_FILES): $(MAKEFILE_LIST)
- @touch $@
-
-ebin/$(PROJECT).app:: $(DTL_FILES)
- $(gen_verbose) mkdir -p ebin/
+ebin/$(PROJECT).app:: $(DTL_FILES) | ebin/
$(if $(strip $?),\
- $(dtl_verbose) $(call erlang,$(call erlydtl_compile.erl,$?,-pa ebin/ $(DEPS_DIR)/erlydtl/ebin/)))
+ $(dtl_verbose) $(call erlang,$(call erlydtl_compile.erl,$?),-pa ebin/ $(DEPS_DIR)/erlydtl/ebin/))
+
endif