From f71e1a8ddb5a41dddb0dea92aefe694e26d4c174 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 13 Jan 2014 19:36:38 +0000 Subject: [PATCH] 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. --- gdb/ChangeLog | 5 +++++ gdb/Makefile.in | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6cdafccb19..18ed4d3c2d 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 824b26b8b2..9811cbed43 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