summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2011-12-25 01:16:01 +0100
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2011-12-25 01:16:38 +0100
commit5b80e12d424084d0e6c37b5f25bca1e38c5497f2 (patch)
treedec4b461bc6d6f4eb6a1d0cbd1e5f441a44d66e9 /mk
parentf176d598536a8935e0e6ab0f8fe730f95fa5544f (diff)
downloadembtoolkit-5b80e12d424084d0e6c37b5f25bca1e38c5497f2.tar.gz
embtoolkit-5b80e12d424084d0e6c37b5f25bca1e38c5497f2.tar.bz2
embtoolkit-5b80e12d424084d0e6c37b5f25bca1e38c5497f2.tar.xz
Build system: create macros to test if a path exists or not
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/macros.mk18
1 files changed, 17 insertions, 1 deletions
diff --git a/mk/macros.mk b/mk/macros.mk
index 0339119..1abf045 100644
--- a/mk/macros.mk
+++ b/mk/macros.mk
@@ -56,7 +56,23 @@ endef
# Usage:
# $(call __embtk_mk_strcmp,str1,str2)
#
-__embtk_mk_strcmp=$(shell [ $(strip $(1)) = $(strip $(2)) ] && echo y)
+__embtk_mk_strcmp = $(shell [ $(strip $(1)) = $(strip $(2)) ] && echo y)
+
+#
+# __embtk_mk_pathexist
+# A macro to test if a path exists. It returns y if the path exists and nothing
+# if not.
+# Usage: $(call __embtk_mk_pathexist,/path/to/test)
+#
+__embtk_mk_pathexist = $(shell test -e $(1) && echo y)
+
+#
+# __embtk_mk_pathnotexist
+# A macro to test if a path does not exist. It returns y if the path does not
+# exist and nothing if it exists.
+# Usage: $(call __embtk_mk_pathnotexist,/path/to/test)
+#
+__embtk_mk_pathnotexist = $(shell test -e $(1) || echo y)
#Decompress message
#usage $(call EMBTK_DECOMPRESS_MSG,$(NAME_PACKAGE))