2010-06-09 04:34:18 +08:00
|
|
|
CLANG_LEVEL := ..
|
|
|
|
include $(CLANG_LEVEL)/Makefile
|
2006-06-18 13:42:02 +08:00
|
|
|
|
2009-07-13 03:00:20 +08:00
|
|
|
# Test in all immediate subdirectories if unset.
|
2009-09-05 01:40:27 +08:00
|
|
|
ifdef TESTSUITE
|
|
|
|
TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
|
|
|
|
else
|
2009-07-25 23:26:08 +08:00
|
|
|
TESTDIRS ?= $(PROJ_SRC_DIR)
|
2009-09-05 01:40:27 +08:00
|
|
|
endif
|
2008-03-11 03:32:31 +08:00
|
|
|
|
2009-09-22 13:16:02 +08:00
|
|
|
# 'lit' wants objdir paths, so it will pick up the lit.site.cfg.
|
|
|
|
TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
|
2009-09-11 07:00:15 +08:00
|
|
|
|
2009-11-05 14:55:24 +08:00
|
|
|
# Allow EXTRA_TESTDIRS to provide additional test directories.
|
|
|
|
TESTDIRS += $(EXTRA_TESTDIRS)
|
|
|
|
|
2009-06-14 02:28:48 +08:00
|
|
|
ifndef TESTARGS
|
2008-04-07 06:32:01 +08:00
|
|
|
ifdef VERBOSE
|
2010-05-12 10:47:23 +08:00
|
|
|
TESTARGS = -v
|
2009-03-13 08:21:49 +08:00
|
|
|
else
|
2011-06-16 09:32:21 +08:00
|
|
|
TESTARGS = -s -v
|
2009-03-19 04:25:18 +08:00
|
|
|
endif
|
2008-04-07 06:32:01 +08:00
|
|
|
endif
|
|
|
|
|
2009-11-06 00:36:19 +08:00
|
|
|
# Make sure any extra test suites can find the main site config.
|
|
|
|
LIT_ARGS := --param clang_site_config=$(PROJ_OBJ_DIR)/lit.site.cfg
|
|
|
|
|
2009-07-12 02:34:43 +08:00
|
|
|
ifdef VG
|
2009-11-06 00:36:19 +08:00
|
|
|
LIT_ARGS += "--vg"
|
2009-07-12 02:34:43 +08:00
|
|
|
endif
|
|
|
|
|
2011-02-03 12:51:52 +08:00
|
|
|
all:: lit.site.cfg Unit/lit.site.cfg
|
2009-09-09 00:39:23 +08:00
|
|
|
@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
|
2009-09-29 22:54:28 +08:00
|
|
|
@ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
|
2009-11-06 00:36:19 +08:00
|
|
|
$(LIT_ARGS) $(TESTARGS) $(TESTDIRS)
|
2008-03-18 15:03:00 +08:00
|
|
|
|
2009-09-11 07:00:15 +08:00
|
|
|
FORCE:
|
|
|
|
|
|
|
|
lit.site.cfg: FORCE
|
2009-09-21 03:04:35 +08:00
|
|
|
@echo "Making Clang 'lit.site.cfg' file..."
|
2014-01-28 06:57:33 +08:00
|
|
|
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp
|
2011-03-09 06:17:40 +08:00
|
|
|
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_LIBS_DIR@=$(LibDir)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@CLANG_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@CLANG_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> lit.tmp
|
2013-12-18 23:08:56 +08:00
|
|
|
@$(ECHOPATH) s=@CLANG_TOOLS_DIR@=$(ToolDir)=g >> lit.tmp
|
2011-03-09 06:17:40 +08:00
|
|
|
@$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
|
2013-08-28 03:27:35 +08:00
|
|
|
@$(ECHOPATH) s=@ENABLE_CLANG_ARCMT@=$(ENABLE_CLANG_ARCMT)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@ENABLE_CLANG_REWRITER@=$(ENABLE_CLANG_REWRITER)=g >> lit.tmp
|
|
|
|
@$(ECHOPATH) s=@ENABLE_CLANG_STATIC_ANALYZER@=$(ENABLE_CLANG_STATIC_ANALYZER)=g >> lit.tmp
|
2014-01-08 21:00:32 +08:00
|
|
|
@$(ECHOPATH) s=@ENABLE_CLANG_EXAMPLES@=$(ENABLE_CLANG_EXAMPLES)=g >> lit.tmp
|
2014-01-09 04:06:24 +08:00
|
|
|
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> lit.tmp
|
2011-03-09 06:17:40 +08:00
|
|
|
@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
|
|
|
|
@-rm -f lit.tmp
|
2009-09-11 07:00:15 +08:00
|
|
|
|
2011-02-03 12:51:52 +08:00
|
|
|
Unit/lit.site.cfg: FORCE
|
|
|
|
@echo "Making Clang 'Unit/lit.site.cfg' file..."
|
|
|
|
@$(MKDIR) $(dir $@)
|
2014-01-28 06:57:33 +08:00
|
|
|
@$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > unit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> unit.tmp
|
2014-01-28 06:57:30 +08:00
|
|
|
@$(ECHOPATH) s=@LLVM_TOOLS_DIR@=$(ToolDir)=g >> unit.tmp
|
2011-03-09 06:17:40 +08:00
|
|
|
@$(ECHOPATH) s=@LLVM_LIBS_DIR@=$(LibDir)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@CLANG_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@CLANG_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@LLVM_BUILD_MODE@=$(BuildMode)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@ENABLE_SHARED@=$(ENABLE_SHARED)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@SHLIBDIR@=$(SharedLibDir)=g >> unit.tmp
|
|
|
|
@$(ECHOPATH) s=@SHLIBPATH_VAR@=$(SHLIBPATH_VAR)=g >> unit.tmp
|
|
|
|
@sed -f unit.tmp $(PROJ_SRC_DIR)/Unit/lit.site.cfg.in > $@
|
|
|
|
@-rm -f unit.tmp
|
2011-02-03 12:51:52 +08:00
|
|
|
|
2008-03-18 15:03:00 +08:00
|
|
|
clean::
|
2009-11-04 06:39:56 +08:00
|
|
|
@ find . -name Output | xargs rm -fr
|
2008-03-18 15:03:00 +08:00
|
|
|
|
2008-04-07 06:32:01 +08:00
|
|
|
.PHONY: all report clean
|