Skip to content
This repository was archived by the owner on Mar 2, 2022. It is now read-only.

Commit 667f92b

Browse files
committed
Update erlang.mk
1 parent 413a102 commit 667f92b

File tree

1 file changed

+63
-63
lines changed

1 file changed

+63
-63
lines changed

erlang.mk

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST)))
1818

19-
ERLANG_MK_VERSION = 2.0.0-pre.2-16-ga6d6bfe-dirty
19+
ERLANG_MK_VERSION = 2.0.0-pre.2-16-gb52203c-dirty
2020

2121
# Core configuration.
2222

@@ -4656,6 +4656,67 @@ $(foreach p,$(DEP_PLUGINS),\
46564656
$(call core_dep_plugin,$p,$(firstword $(subst /, ,$p))),\
46574657
$(call core_dep_plugin,$p/plugins.mk,$p))))
46584658

4659+
# Copyright (c) 2013-2015, Loïc Hoguin <essen@ninenines.eu>
4660+
# This file is part of erlang.mk and subject to the terms of the ISC License.
4661+
4662+
# Configuration.
4663+
4664+
DTL_FULL_PATH ?=
4665+
DTL_PATH ?= templates/
4666+
DTL_SUFFIX ?= _dtl
4667+
4668+
# Verbosity.
4669+
4670+
dtl_verbose_0 = @echo " DTL " $(filter %.dtl,$(?F));
4671+
dtl_verbose = $(dtl_verbose_$(V))
4672+
4673+
# Core targets.
4674+
4675+
define erlydtl_compile.erl
4676+
[begin
4677+
Module0 = case "$(strip $(DTL_FULL_PATH))" of
4678+
"" ->
4679+
filename:basename(F, ".dtl");
4680+
_ ->
4681+
"$(DTL_PATH)" ++ F2 = filename:rootname(F, ".dtl"),
4682+
re:replace(F2, "/", "_", [{return, list}, global])
4683+
end,
4684+
Module = list_to_atom(string:to_lower(Module0) ++ "$(DTL_SUFFIX)"),
4685+
case erlydtl:compile(F, Module, [{out_dir, "ebin/"}, return_errors, {doc_root, "templates"}]) of
4686+
ok -> ok;
4687+
{ok, _} -> ok
4688+
end
4689+
end || F <- string:tokens("$(1)", " ")],
4690+
halt().
4691+
endef
4692+
4693+
ifneq ($(wildcard src/),)
4694+
4695+
DTL_FILES = $(sort $(call core_find,$(DTL_PATH),*.dtl))
4696+
4697+
ifdef DTL_FULL_PATH
4698+
BEAM_FILES += $(addprefix ebin/,$(patsubst %.dtl,%_dtl.beam,$(subst /,_,$(DTL_FILES:$(DTL_PATH)%=%))))
4699+
else
4700+
BEAM_FILES += $(addprefix ebin/,$(patsubst %.dtl,%_dtl.beam,$(notdir $(DTL_FILES))))
4701+
endif
4702+
4703+
ifneq ($(words $(DTL_FILES)),0)
4704+
# Rebuild everything when the Makefile changes.
4705+
$(ERLANG_MK_TMP)/last-makefile-change-erlydtl: $(MAKEFILE_LIST)
4706+
@mkdir -p $(ERLANG_MK_TMP)
4707+
@if test -f $@; then \
4708+
touch $(DTL_FILES); \
4709+
fi
4710+
@touch $@
4711+
4712+
ebin/$(PROJECT).app:: $(ERLANG_MK_TMP)/last-makefile-change-erlydtl
4713+
endif
4714+
4715+
ebin/$(PROJECT).app:: $(DTL_FILES)
4716+
$(if $(strip $?),\
4717+
$(dtl_verbose) $(call erlang,$(call erlydtl_compile.erl,$?,-pa ebin/ $(DEPS_DIR)/erlydtl/ebin/)))
4718+
endif
4719+
46594720
# Copyright (c) 2015, Loïc Hoguin <essen@ninenines.eu>
46604721
# This file is part of erlang.mk and subject to the terms of the ISC License.
46614722

@@ -5988,67 +6049,6 @@ elvis: $(ELVIS) $(ELVIS_CONFIG)
59886049
distclean-elvis:
59896050
$(gen_verbose) rm -rf $(ELVIS)
59906051

5991-
# Copyright (c) 2013-2015, Loïc Hoguin <essen@ninenines.eu>
5992-
# This file is part of erlang.mk and subject to the terms of the ISC License.
5993-
5994-
# Configuration.
5995-
5996-
DTL_FULL_PATH ?=
5997-
DTL_PATH ?= templates/
5998-
DTL_SUFFIX ?= _dtl
5999-
6000-
# Verbosity.
6001-
6002-
dtl_verbose_0 = @echo " DTL " $(filter %.dtl,$(?F));
6003-
dtl_verbose = $(dtl_verbose_$(V))
6004-
6005-
# Core targets.
6006-
6007-
define erlydtl_compile.erl
6008-
[begin
6009-
Module0 = case "$(strip $(DTL_FULL_PATH))" of
6010-
"" ->
6011-
filename:basename(F, ".dtl");
6012-
_ ->
6013-
"$(DTL_PATH)" ++ F2 = filename:rootname(F, ".dtl"),
6014-
re:replace(F2, "/", "_", [{return, list}, global])
6015-
end,
6016-
Module = list_to_atom(string:to_lower(Module0) ++ "$(DTL_SUFFIX)"),
6017-
case erlydtl:compile(F, Module, [{out_dir, "ebin/"}, return_errors, {doc_root, "templates"}]) of
6018-
ok -> ok;
6019-
{ok, _} -> ok
6020-
end
6021-
end || F <- string:tokens("$(1)", " ")],
6022-
halt().
6023-
endef
6024-
6025-
ifneq ($(wildcard src/),)
6026-
6027-
DTL_FILES = $(sort $(call core_find,$(DTL_PATH),*.dtl))
6028-
6029-
ifdef DTL_FULL_PATH
6030-
BEAM_FILES += $(addprefix ebin/,$(patsubst %.dtl,%_dtl.beam,$(subst /,_,$(DTL_FILES:$(DTL_PATH)%=%))))
6031-
else
6032-
BEAM_FILES += $(addprefix ebin/,$(patsubst %.dtl,%_dtl.beam,$(notdir $(DTL_FILES))))
6033-
endif
6034-
6035-
ifneq ($(words $(DTL_FILES)),0)
6036-
# Rebuild everything when the Makefile changes.
6037-
$(ERLANG_MK_TMP)/last-makefile-change-erlydtl: $(MAKEFILE_LIST)
6038-
@mkdir -p $(ERLANG_MK_TMP)
6039-
@if test -f $@; then \
6040-
touch $(DTL_FILES); \
6041-
fi
6042-
@touch $@
6043-
6044-
ebin/$(PROJECT).app:: $(ERLANG_MK_TMP)/last-makefile-change-erlydtl
6045-
endif
6046-
6047-
ebin/$(PROJECT).app:: $(DTL_FILES)
6048-
$(if $(strip $?),\
6049-
$(dtl_verbose) $(call erlang,$(call erlydtl_compile.erl,$?,-pa ebin/ $(DEPS_DIR)/erlydtl/ebin/)))
6050-
endif
6051-
60526052
# Copyright (c) 2014 Dave Cottlehuber <dch@skunkwerks.at>
60536053
# This file is part of erlang.mk and subject to the terms of the ISC License.
60546054

@@ -6491,7 +6491,7 @@ $(ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST):
64916491
$(verbose) :> $@
64926492
else
64936493
LIST_DIRS = $(ALL_DEPS_DIRS)
6494-
LIST_DEPS = $(DEPS)
6494+
LIST_DEPS = $(BUILD_DEPS) $(DEPS)
64956495

64966496
$(ERLANG_MK_RECURSIVE_DEPS_LIST): fetch-deps
64976497

0 commit comments

Comments
 (0)