--- a/misc/uncrustify.mk
+++ b/misc/uncrustify.mk
@@ -22,6 +22,7 @@
 
 clean:
 	$(RM) $(FILES:=.uncrustify) $(FILES:=.uncrustifyT) $(FILES:=.diff)
+	$(RM) $(UNCRUSTIFY_CFG)-file-header
 
 .SECONDARY:
 
@@ -53,4 +54,10 @@
 	cmp -s $(UNCRUSTIFY_CFG).tmp $(UNCRUSTIFY_CFG) || cp $(UNCRUSTIFY_CFG).tmp $(UNCRUSTIFY_CFG)
 	$(RM) $(UNCRUSTIFY_CFG).tmp
 
+uncrustify-file-header: $(UNCRUSTIFY_CFG)-file-header
+	$(MAKE) -f $(lastword $(MAKEFILE_LIST)) uncrustify-test uncrustify-diff UNCRUSTIFY_CFG=$(UNCRUSTIFY_CFG)-file-header
+
+$(UNCRUSTIFY_CFG)-file-header: $(UNCRUSTIFY_CFG)
+	sed -e '/cmt_insert_file_header/s/""/misc\/fileheader.txt/' $< > $@
+
 .PHONY: all clean viewdiff uncrustify-test uncrustify-diff uncrustify-apply update-uncrustify-cfg