1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00

Update rules.mk

This commit is contained in:
suyuan 2020-12-10 15:41:25 +08:00
parent 0dbc2f8345
commit aaab35a346

View file

@ -334,9 +334,9 @@ else
endif endif
RSTRIP= \ RSTRIP= \
export CROSS="$(TARGET_CROSS)" \ export CROSS="$(TARGET_CROSS)" \
$(if $(PKG_BUILD_ID),KEEP_BUILD_ID=1) \ $(if $(PKG_BUILD_ID),KEEP_BUILD_ID=1) \
$(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1) \ $(if $(CONFIG_KERNEL_KALLSYMS),NO_RENAME=1) \
$(if $(CONFIG_KERNEL_PROFILING),KEEP_SYMBOLS=1); \ $(if $(CONFIG_KERNEL_PROFILING),KEEP_SYMBOLS=1); \
NM="$(TARGET_CROSS)nm" \ NM="$(TARGET_CROSS)nm" \
STRIP="$(STRIP)" \ STRIP="$(STRIP)" \
STRIP_KMOD="$(SCRIPT_DIR)/strip-kmod.sh" \ STRIP_KMOD="$(SCRIPT_DIR)/strip-kmod.sh" \
@ -372,10 +372,10 @@ endef
# $(2) => The lock name. If not given, the global lock will be used. # $(2) => The lock name. If not given, the global lock will be used.
ifneq ($(wildcard $(STAGING_DIR_HOST)/bin/flock),) ifneq ($(wildcard $(STAGING_DIR_HOST)/bin/flock),)
define locked define locked
SHELL= \ SHELL= \
flock \ flock \
$(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock \ $(TMP_DIR)/.$(if $(2),$(strip $(2)),global).flock \
-c '$(subst ','\'',$(1))' -c '$(subst ','\'',$(1))'
endef endef
else else
locked=$(1) locked=$(1)
@ -386,25 +386,25 @@ endif
# $(1) => File glob expression # $(1) => File glob expression
# $(2) => Destination directory # $(2) => Destination directory
define file_copy define file_copy
for src_dir in $(sort $(foreach d,$(wildcard $(1)),$(dir $(d)))); do \ for src_dir in $(sort $(foreach d,$(wildcard $(1)),$(dir $(d)))); do \
( cd $$src_dir; find -type f -or -type d ) | \ ( cd $$src_dir; find -type f -or -type d ) | \
( cd $(2); while :; do \ ( cd $(2); while :; do \
read FILE; \ read FILE; \
[ -z "$$FILE" ] && break; \ [ -z "$$FILE" ] && break; \
[ -L "$$FILE" ] || continue; \ [ -L "$$FILE" ] || continue; \
echo "Removing symlink $(2)/$$FILE"; \ echo "Removing symlink $(2)/$$FILE"; \
rm -f "$$FILE"; \ rm -f "$$FILE"; \
done; ); \ done; ); \
done; \ done; \
$(CP) $(1) $(2) $(CP) $(1) $(2)
endef endef
# Calculate sha256sum of any plain file within a given directory # Calculate sha256sum of any plain file within a given directory
# $(1) => Input directory # $(1) => Input directory
# $(2) => If set, recurse into subdirectories # $(2) => If set, recurse into subdirectories
define sha256sums define sha256sums
(cd $(1); find . $(if $(2),,-maxdepth 1) -type f -not -name 'sha256sums' -printf "%P\n" | sort | \ (cd $(1); find . $(if $(2),,-maxdepth 1) -type f -not -name 'sha256sums' -printf "%P\n" | sort | \
xargs -r $(STAGING_DIR_HOST)/bin/mkhash -n sha256 | sed -ne 's!^\(.*\) \(.*\)$$!\1 *\2!p' > sha256sums) xargs -r $(STAGING_DIR_HOST)/bin/mkhash -n sha256 | sed -ne 's!^\(.*\) \(.*\)$$!\1 *\2!p' > sha256sums)
endef endef
# file extension # file extension
@ -415,18 +415,18 @@ FORCE: ;
.PHONY: FORCE .PHONY: FORCE
check: FORCE check: FORCE
@true @true
val.%: val.%:
@$(if $(filter undefined,$(origin $*)),\ @$(if $(filter undefined,$(origin $*)),\
echo "$* undefined" >&2, \ echo "$* undefined" >&2, \
echo '$(subst ','"'"',$($*))' \ echo '$(subst ','"'"',$($*))' \
) )
var.%: var.%:
@$(if $(filter undefined,$(origin $*)),\ @$(if $(filter undefined,$(origin $*)),\
echo "$* undefined" >&2, \ echo "$* undefined" >&2, \
echo "$*='"'$(subst ','"'\"'\"'"',$($*))'"'" \ echo "$*='"'$(subst ','"'\"'\"'"',$($*))'"'" \
) )
endif #__rules_inc endif #__rules_inc