reduce duplicate -I flags passed to the compiler, cleaning up the VERBOSE
authorChris Lattner <sabre@nondot.org>
Mon, 28 Jan 2008 04:18:41 +0000 (04:18 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 28 Jan 2008 04:18:41 +0000 (04:18 +0000)
output.  Patch contributed by Sam Bishop!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46432 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.rules

index 0f2be6503b870ac7e3c176add9cf7903b7aca7e7..a9421c6e13e52168a891c43fd06bd3e1957ec6e9 100644 (file)
@@ -454,12 +454,11 @@ endif
 LD.Flags      += -L$(LibDir) -L$(LLVMLibDir) 
 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
 # All -I flags should go here, so that they don't confuse llvm-config.
 LD.Flags      += -L$(LibDir) -L$(LLVMLibDir) 
 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
 # All -I flags should go here, so that they don't confuse llvm-config.
-CPP.Flags     += -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \
-                -I$(PROJ_OBJ_ROOT)/include \
-                -I$(PROJ_SRC_ROOT)/include \
-                -I$(LLVM_OBJ_ROOT)/include \
-                -I$(LLVM_SRC_ROOT)/include \
-                $(CPP.BaseFlags)
+CPP.Flags     += $(patsubst %,-I%/include,$(sort \
+                $(PROJ_OBJ_DIR) $(PROJ_SRC_DIR) \
+                $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \
+                $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \
+                $(CPP.BaseFlags)
 
 Compile.C     = $(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c
 LTCompile.C   = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.C)
 
 Compile.C     = $(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c
 LTCompile.C   = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.C)