From 58194307c1a45f6a20f5ed421c97309a9e007e46 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 11 Apr 2011 22:37:39 +0000 Subject: build: Add support for a SHOW_DIAGNOSTICS build variable. If enabled, this will attempt to use the CC_LOG_DIAGNOSTICS feature I dropped into Clang to print a log of all the diagnostics generated during an individual build (from the top-level). Not sure if this will actually be useful, but for now it is handy for testing the option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129312 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index dbb759dd5fc..7dad07b6f05 100644 --- a/Makefile +++ b/Makefile @@ -168,6 +168,15 @@ install-clang: install install-clang-c: install install-libs: install +# If SHOW_DIAGNOSTICS is enabled, clear the diagnostics file first. +ifeq ($(SHOW_DIAGNOSTICS),1) +clean-diagnostics: + $(Verb) rm -f $(LLVM_OBJ_ROOT)/$(BuildMode)/diags +.PHONY: clean-diagnostics + +all-local:: clean-diagnostics +endif + #------------------------------------------------------------------------ # Make sure the generated headers are up-to-date. This must be kept in # sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac @@ -198,6 +207,12 @@ ifneq ($(ENABLE_OPTIMIZED),1) $(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to $(Echo) '*****' make an optimized build. Alternatively you can $(Echo) '*****' configure with --enable-optimized. +ifeq ($(SHOW_DIAGNOSTICS),1) + $(Verb) if test -s $(LLVM_OBJ_ROOT)/$(BuildMode)/diags; then \ + $(LLVM_SRC_ROOT)/utils/show-diagnostics \ + $(LLVM_OBJ_ROOT)/$(BuildMode)/diags; \ + fi +endif endif endif -- cgit v1.2.3