From 0424bd4dbc8a6a22310e4081d2d5dc852a92ea4c Mon Sep 17 00:00:00 2001
From: Dean Camera <dean@fourwalledcubicle.com>
Date: Fri, 23 Mar 2012 22:12:16 +0000
Subject: [PATCH] Add automated link checking script to the Maintenance script
 makefile.

---
 Maintenance/makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Maintenance/makefile b/Maintenance/makefile
index 137b802a7f..5cce2bf1cf 100644
--- a/Maintenance/makefile
+++ b/Maintenance/makefile
@@ -36,6 +36,13 @@ check-documentation-placeholders:
 	fi;
 	@echo Done.
 
+# Test all generated documentation for any bad links
+check-documentation-links:
+	@for html_file in `find $(LUFA_ROOT) -name *.html`; do \
+		echo Checking $$html_file...; \
+		cat $$html_file | grep -v "doxygen.org" | grep -v "fourwalledcubicle.com" | wget -nv --referer=www.lufa-lib.org --user-agent="lufa-link-check-script" -B $(dir $$html_file) --spider --force-html --input-file=-; \
+	done;
+
 # Validate the working branch - compile all documentation, demos/projects/examples and run build tests
 validate-branch:
 	make -s -C $(LUFA_ROOT) doxygen