aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Roth <gaumless@gmail.com>2024-06-18 14:44:36 -0600
committerFelix Held <felix-coreboot@felixheld.de>2024-06-27 14:04:22 +0000
commitd5658fd7c02d590fad8d6556872143dc1e7b6ccf (patch)
tree0a69a06e6db05a6bb0638bd2d39ef71f28d9a6cb
parent754fa0ebc678bf6c8ab503006ecc0a61ae093569 (diff)
Makefile: Add cleanall-symlink target
This target looks for symbolic links in the coreboot directory, excluding the 3rdparty and crossgcc directories, which both typically have numerous symbolic links, and deletes anything that is found. All possible links are verified as symbolic links before being removed. Any removed links show where they were linked from in case they need to be restored. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: I8a56e7c628701e4a0471833443b08ab2bcceb27e Reviewed-on: https://review.coreboot.org/c/coreboot/+/83123 Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Eric Lai <ericllai@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--Makefile13
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f7be19c8e6..60570a0571 100644
--- a/Makefile
+++ b/Makefile
@@ -524,6 +524,16 @@ clean-symlink:
for link in $$EXISTING_SYMLINKS; do \
echo -e "\tUNLINK $$link"; \
rm "$$link"; \
+
+cleanall-symlink:
+ echo "Deleting all symbolic links in the coreboot tree (excluding 3rdparty & crossgcc)"; \
+ EXISTING_SYMLINKS="$$(find $(top) -type l | grep -v "3rdparty\|crossgcc" )"; \
+ for link in $${EXISTING_SYMLINKS}; do \
+ if [ -L "$${link}" ]; then \
+ REALDIR="$$(realpath "$${link}")"; \
+ echo " UNLINK $${link} (linked from $${REALDIR})"; \
+ rm "$${link}"; \
+ fi; \
done
clean-for-update:
@@ -553,4 +563,5 @@ distclean: clean clean-ctags clean-cscope distclean-payloads distclean-utils
rm -f abuild*.xml junit.xml* util/lint/junit.xml
.PHONY: $(PHONY) clean clean-for-update clean-cscope cscope distclean sphinx sphinx-lint
-.PHONY: ctags-project cscope-project clean-ctags symlink clean-symlink
+.PHONY: ctags-project cscope-project clean-ctags
+.PHONY: symlink clean-symlink cleanall-symlink