X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=rules.mk;h=d3521649a52da662301b3f29eafc6486fe60e3b5;hb=27a7d97c151caabf83780fdab06342d07ec6558f;hp=7d3516bc4272e1186dde2ceb89145cde7c5ad19d;hpb=36d3a76afb32eda306753361abf13c3d4c41e555;p=openwrt.git diff --git a/rules.mk b/rules.mk index 7d3516bc42..d3521649a5 100644 --- a/rules.mk +++ b/rules.mk @@ -47,6 +47,8 @@ else FPIC:=-fpic endif +HOST_FPIC:=-fPIC + ARCH_SUFFIX:= ifneq ($(findstring -mips32r2,$(TARGET_OPTIMIZATION)),) ARCH_SUFFIX:=_r2 @@ -247,6 +249,16 @@ define include_mk $(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. +define locked + SHELL= \ + $(STAGING_DIR_HOST)/bin/flock \ + $(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock \ + -c '$(subst ','\'',$(1))' +endef + # file extension ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))