1 ##===- tools/extra/test/Makefile ---------------------------*- Makefile -*-===##
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 ##===----------------------------------------------------------------------===##
10 CLANG_LEVEL := ../../..
11 include $(CLANG_LEVEL)/Makefile
13 # Test in all immediate subdirectories if unset.
15 TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
17 TESTDIRS ?= $(PROJ_SRC_DIR)
20 # 'lit' wants objdir paths, so it will pick up the lit.site.cfg.
21 TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
23 # Allow EXTRA_TESTDIRS to provide additional test directories.
24 TESTDIRS += $(EXTRA_TESTDIRS)
34 # Make sure any extra test suites can find the main site config.
35 LIT_ARGS := --param clang_site_config=$(PROJ_OBJ_DIR)/lit.site.cfg
42 @ echo '--- Running the Clang extra tools tests for $(TARGET_TRIPLE) ---'
43 @ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
44 $(LIT_ARGS) $(TESTARGS) $(TESTDIRS)
49 @echo "Making Clang extra tools' 'lit.site.cfg' file..."
50 @$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
51 @$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
52 @$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
53 @$(ECHOPATH) s=@LLVM_LIBS_DIR@=$(LibDir)=g >> lit.tmp
54 @$(ECHOPATH) s=@CLANG_TOOLS_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> lit.tmp
55 @$(ECHOPATH) s=@CLANG_TOOLS_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> lit.tmp
56 @$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
57 @sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
61 @ find . -name Output | xargs rm -fr
63 .PHONY: all report clean