summaryrefslogtreecommitdiff
path: root/automake.head.mk
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-03-03 17:55:39 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-03-03 17:55:39 -0500
commit8b4ed19938c1314ea15eb0b507dcc5aadeb3d9e6 (patch)
treeaa210642cb233b6ec79655244afc82fb400fa378 /automake.head.mk
parent592eded56c45cdecb9ec9b6fc269d6c3e60f4c4c (diff)
make a public `am_path`, more docs
Diffstat (limited to 'automake.head.mk')
-rw-r--r--automake.head.mk3
1 files changed, 2 insertions, 1 deletions
diff --git a/automake.head.mk b/automake.head.mk
index ad7154c..c79da83 100644
--- a/automake.head.mk
+++ b/automake.head.mk
@@ -17,13 +17,14 @@ _am = am_
_am_noslash = $(patsubst %/.,%,$(patsubst %/,%,$1))
# These are all $(call _am_func,parent,child)
-#_am_relto = $(if $2,$(shell realpath -s --relative-to='$1' $2))
+#_am_relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2))
_am_is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.)
_am_relto_helper = $(if $(call _am_is_subdir,$1,$2),$(patsubst $1/%,%,$(addsuffix /.,$2)),$(addprefix ../,$(call _am_relto_helper,$(patsubst %/,%,$(dir $1)),$2)))
_am_relto = $(call _am_noslash,$(call _am_relto_helper,$(call _am_noslash,$(abspath $1)),$(call _am_noslash,$(abspath $2))))
# Note that _am_is_subdir says that a directory is a subdirectory of
# itself.
_am_path = $(call _am_relto,.,$1)
+am_path = $(foreach p,$1,$(call _am_relto,$p))
## Declare the default target
all: build