projects
/
openwrt
/
staging
/
chunkeey.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
731877c
)
Add macro for locking of recipe commands.
author
Michael Büsch
<mb@bu3sch.de>
Fri, 29 Oct 2010 14:53:16 +0000
(14:53 +0000)
committer
Michael Büsch
<mb@bu3sch.de>
Fri, 29 Oct 2010 14:53:16 +0000
(14:53 +0000)
SVN-Revision: 23708
rules.mk
patch
|
blob
|
history
diff --git
a/rules.mk
b/rules.mk
index 23445bfaeed6d7a2642a1cd55becec9895fa5d0e..007e5bc9b2f8176ddfcfbd0b880baf9b8ef9664a 100644
(file)
--- a/
rules.mk
+++ b/
rules.mk
@@
-249,6
+249,16
@@
define include_mk
$(eval -include $(if $(DUMP),,$(STAGING_DIR)/mk/$(strip $(1))))
endef
$(eval -include $(if $(DUMP),,$(STAGING_DIR)/mk/$(strip $(1))))
endef
+# Execute commands under flock
+# $(1) => The shell expression.
+# $(2) => The lock name. If not given, the global lock will be used.
+# $(3) => The filedescriptor used for the lock. Defaults to 1023.
+define locked
+ ( $(STAGING_DIR_HOST)/bin/flock -x $(if $(3),$(3),1023) && \
+ $(1) \
+ ) $(if $(3),$(strip $(3)),1023)>$(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock
+endef
+
# file extension
ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))
# file extension
ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))