From 2819f56756353432ff7629c4731dc6a080f8b55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 15 Dec 2015 11:34:11 +0100 Subject: 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 --- plugins/erlydtl.mk | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'plugins') 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 -- cgit v1.2.3