Browse Source

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
Loïc Hoguin 9 years ago
parent
commit
2819f56756
1 changed files with 17 additions and 17 deletions
  1. 17 17
      plugins/erlydtl.mk

+ 17 - 17
plugins/erlydtl.mk

@@ -14,6 +14,20 @@ dtl_verbose = $(dtl_verbose_$(V))
 
 
 # Core targets.
 # 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
 define erlydtl_compile.erl
 	[begin
 	[begin
 		Module0 = case "$(strip $(DTL_FULL_PATH))" of
 		Module0 = case "$(strip $(DTL_FULL_PATH))" of
@@ -32,22 +46,8 @@ define erlydtl_compile.erl
 	halt().
 	halt().
 endef
 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 $?),\
 	$(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
 endif