aboutsummaryrefslogtreecommitdiffstats
path: root/core/core.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-07-02 18:35:44 +0200
committerLoïc Hoguin <[email protected]>2015-07-02 18:35:44 +0200
commit6a3bf18655384cbd534308104d82b1ae0f66c228 (patch)
tree65a4d3a9c0910774eb664ac5895af18bb623cbf1 /core/core.mk
parent061d4491da416ad23a8d470a4198a0cd608b7e0f (diff)
downloaderlang.mk-6a3bf18655384cbd534308104d82b1ae0f66c228.tar.gz
erlang.mk-6a3bf18655384cbd534308104d82b1ae0f66c228.tar.bz2
erlang.mk-6a3bf18655384cbd534308104d82b1ae0f66c228.zip
Reduce dependency on external programs
This commit implements a core_find and core_ls function that can be used to list files recursively or not. A few other minute changes are included and a couple hacks removed.
Diffstat (limited to 'core/core.mk')
-rw-r--r--core/core.mk11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/core.mk b/core/core.mk
index c9c8256..ad70ee6 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -126,13 +126,13 @@ define newline
endef
-define erlang_list
-[$(subst $(space),$(comma),$(strip $(1)))]
+define comma_list
+$(subst $(space),$(comma),$(strip $(1)))
endef
# Adding erlang.mk to make Erlang scripts who call init:get_plain_arguments() happy.
define erlang
-$(ERL) -pa $(ERLANG_MK_TMP)/rebar/ebin -eval "$(subst $(newline),,$(subst ",\",$(1)))" -- erlang.mk
+$(ERL) -pz $(ERLANG_MK_TMP)/rebar/ebin -eval "$(subst $(newline),,$(subst ",\",$(1)))" -- erlang.mk
endef
ifeq ($(shell which wget 2>/dev/null | wc -l), 1)
@@ -162,8 +162,13 @@ endif
core_eq = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
+core_find = $(foreach d,$(call core_ls,$1*),$(call core_find,$d/,$2) $(filter $(subst *,%,$2),$d))
+
core_lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$(1)))))))))))))))))))))))))))
+# @todo On Windows: $(shell dir /B $(1)); make sure to handle when no file exists.
+core_ls = $(filter-out $(1),$(shell echo $(1)))
+
# Automated update.
ERLANG_MK_BUILD_CONFIG ?= build.config