From: Pedro Alves Date: Mon, 13 Jan 2014 19:36:38 +0000 (+0000) Subject: New "make check-headers" rule. X-Git-Tag: gdb-7.8-branchpoint~1536 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f71e1a8ddb5a41dddb0dea92aefe694e26d4c174;p=thirdparty%2Fbinutils-gdb.git New "make check-headers" rule. Tries to compile each header in isolation, thus ensuring headers are self-contained. Defaults to checking all $HFILES_NO_SRCDIR headers. Do: make check-headers CHECK_HEADERS="header.h list.h" to check specific headers. gdb/ 2014-01-13 Pedro Alves * Makefile.in (CHECK_HEADERS): New variable. (check-headers:): New rule. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6cdafccb19b..18ed4d3c2de 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-01-13 Pedro Alves + + * Makefile.in (CHECK_HEADERS): New variable. + (check-headers:): New rule. + 2014-01-13 Tom Tromey * cli/cli-setshow.c (do_set_command): Update. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 824b26b8b21..9811cbed43a 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1050,6 +1050,28 @@ check//%: force "$$target"; \ else true; fi +# The set of headers checked by 'check-headers' by default. +CHECK_HEADERS = $(HFILES_NO_SRCDIR) + +# Try to compile each header in isolation, thus ensuring headers are +# self-contained. +# +# Defaults to checking all $HFILES_NO_SRCDIR headers. +# +# Do: +# +# make check-headers CHECK_HEADERS="header.h list.h" +# +# to check specific headers. +# +check-headers: + @echo Checking headers. + for i in $(CHECK_HEADERS) ; do \ + $(CC) -x c -c -fsyntax-only $(INTERNAL_CFLAGS) \ + -include defs.h $(srcdir)/$$i ; \ + done +.PHONY: check-headers + info install-info clean-info dvi pdf install-pdf html install-html: force @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do