Remove existing old link before creating a new one
[lede.git] / toolchain / kernel-headers / Makefile
index 90f8eb1a3c2aea57bb143d501ef79d47a6a73a19..fa7d349baadc7077543922b19c95abdbfa02b541 100644 (file)
@@ -57,7 +57,7 @@ ifneq ($(CONFIG_mips)$(CONFIG_mipsel),)
        $(CP) \
                $(HOST_BUILD_DIR)/arch/mips/include/asm/asm.h \
                $(HOST_BUILD_DIR)/arch/mips/include/asm/regdef.h \
-               $(if $(call kernel_patchver_ge,3.15.0),$(HOST_BUILD_DIR)/arch/mips/include/asm/asm-eva.h) \
+               $(HOST_BUILD_DIR)/arch/mips/include/asm/asm-eva.h \
                $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/
   endef
 endif
@@ -72,7 +72,8 @@ endef
 
 define Host/Prepare
        $(call Kernel/Prepare/Default)
-       ln -sf linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux
+       rm -f $(BUILD_DIR_TOOLCHAIN)/linux
+       ln -s linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux
        $(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile
 endef