kernel: add more SCTP related configuration symbols
[openwrt/openwrt.git] / rules.mk
index 34c86ca49cab3049438b365ea2f915c290e9f562..1ded3ba85510ba7af650c5d8bc915071d3b5eec1 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -81,6 +81,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
   REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))
   GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux
   DIR_SUFFIX:=_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi)
+  BIN_DIR:=$(BIN_DIR)$(if $(CONFIG_USE_UCLIBC),,-$(LIBC))
   BUILD_DIR:=$(BUILD_DIR_BASE)/target-$(ARCH)$(ARCH_SUFFIX)$(DIR_SUFFIX)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
   STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(ARCH)$(ARCH_SUFFIX)$(DIR_SUFFIX)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
   BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
@@ -286,6 +287,24 @@ define locked
                -c '$(subst ','\'',$(1))'
 endef
 
+# Recursively copy paths into another directory, purge dangling
+# symlinks before.
+# $(1) => File glob expression
+# $(2) => Destination directory
+define file_copy
+       for src_dir in $(sort $(foreach d,$(wildcard $(1)),$(dir $(d)))); do \
+               ( cd $$src_dir; find -type f -or -type d ) | \
+                       ( cd $(2); while :; do \
+                               read FILE; \
+                               [ -z "$$FILE" ] && break; \
+                               [ -L "$$FILE" ] || continue; \
+                               echo "Removing symlink $(2)/$$FILE"; \
+                               rm -f "$$FILE"; \
+                       done; ); \
+       done; \
+       $(CP) $(1) $(2)
+endef
+
 # file extension
 ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))