]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix make check-format target
authorNeil Horman <nhorman@openssl.org>
Wed, 14 Jan 2026 13:15:36 +0000 (08:15 -0500)
committerNeil Horman <nhorman@openssl.org>
Fri, 16 Jan 2026 14:37:05 +0000 (09:37 -0500)
With our move to clang-format we no longer have a check-format script,
and so this make target is broken.

Fix it up to use clang-format-diff instead

Fixes #29594

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Fri Jan 16 14:37:09 2026
(Merged from https://github.com/openssl/openssl/pull/29634)

Configurations/unix-Makefile.tmpl

index b6a78107668d341eb3e082cd1894e96603da5d3b..3d8df76989b1563547351f85edebd66f90e0dde5 100644 (file)
@@ -1180,10 +1180,18 @@ lint: ## Evaluate C code via "splint"
            echo splint -DLINT -posixlib -preproc -D__gnuc_va_list=void \
           -I. -Iinclude -Iapps/include $(CRYPTOHEADERS) $(SSLHEADERS) $(SRCS) )
 
-.PHONY: check-format
-check-format: ## Evaluate C code according to OpenSSL coding standards
-       ( cd $(SRCDIR); $(PERL) util/check-format.pl \
-                       $(SRCS) \$(CRYPTOHEADERS) $(SSLHEADERS) )
+CLANG_FORMAT_DIFF = clang-format-diff
+
+.PHONY: check-format check-clang-format-diff-cmd
+check-clang-format-diff-cmd:
+       @if ! command -v "$(CLANG_FORMAT_DIFF)" >/dev/null; then \
+               echo "Unable to find ${CLANG_FORMAT_DIFF}";\
+               echo "Please set the CLANG_FORMAT_DIFF variable to your clang-format-diff command";\
+               exit 1;\
+       fi
+
+check-format: check-clang-format-diff-cmd ## Evaluate C code according to OpenSSL coding standards
+       ( cd $(SRCDIR); git diff -U0 --no-prefix --no-color | $(CLANG_FORMAT_DIFF) )
 
 generate_apps:
        ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \