blob: 6ed13d6b88e1535b53f22386bbeae825254fd4ae [file] [log] [blame]
Chris Lattner1467e032007-07-16 04:35:52 +00001LEVEL = ../../..
2include $(LEVEL)/Makefile.common
Reid Spencer5f016e22007-07-11 17:01:13 +00003
Daniel Dunbar0126e5e2009-07-12 19:00:20 +00004# Test in all immediate subdirectories if unset.
Daniel Dunbar2f42d4a2009-09-04 17:40:27 +00005ifdef TESTSUITE
6TESTDIRS := $(TESTSUITE:%=$(PROJ_SRC_DIR)/%)
7else
Daniel Dunbar10aebbb2009-07-25 15:26:08 +00008TESTDIRS ?= $(PROJ_SRC_DIR)
Daniel Dunbar2f42d4a2009-09-04 17:40:27 +00009endif
Chris Lattner15bd7992008-03-10 19:32:31 +000010
Daniel Dunbar5e01e3c2009-09-22 05:16:02 +000011# 'lit' wants objdir paths, so it will pick up the lit.site.cfg.
12TESTDIRS := $(TESTDIRS:$(PROJ_SRC_DIR)%=$(PROJ_OBJ_DIR)%)
Daniel Dunbar58033312009-09-10 23:00:15 +000013
Daniel Dunbard5134b02009-06-13 18:28:48 +000014ifndef TESTARGS
Chris Lattner9d294b92008-04-06 22:32:01 +000015ifdef VERBOSE
Daniel Dunbard5134b02009-06-13 18:28:48 +000016TESTARGS = -v
Mike Stump039df912009-03-13 00:21:49 +000017else
Daniel Dunbard5134b02009-06-13 18:28:48 +000018TESTARGS = -s
Mike Stump9a2f1ac2009-03-18 20:25:18 +000019endif
Chris Lattner9d294b92008-04-06 22:32:01 +000020endif
21
Nuno Lopesa7afc452009-07-11 18:34:43 +000022ifdef VG
23 VGARG="--vg"
24else
25 VGARG=
26endif
27
Daniel Dunbar58033312009-09-10 23:00:15 +000028all:: lit.site.cfg
Daniel Dunbar724827f2009-09-08 16:39:23 +000029 @ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
30 @ $(LLVM_SRC_ROOT)/utils/lit/lit.py \
Daniel Dunbar67796472009-07-27 19:01:13 +000031 $(TESTARGS) $(TESTDIRS) $(VGARG)
Gabor Greif17feadf2008-03-18 07:03:00 +000032
Daniel Dunbar58033312009-09-10 23:00:15 +000033FORCE:
34
35lit.site.cfg: FORCE
Daniel Dunbar1b720a92009-09-20 19:04:35 +000036 @echo "Making Clang 'lit.site.cfg' file..."
37 @sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
38 -e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
Daniel Dunbar7af18d32009-09-17 19:55:53 +000039 -e "s#@LLVM_TOOLS_DIR@#$(ToolDir)#g" \
Daniel Dunbar1b720a92009-09-20 19:04:35 +000040 -e "s#@CLANG_SOURCE_DIR@#$(PROJ_SRC_DIR)/..#g" \
41 -e "s#@CLANG_BINARY_DIR@#$(PROJ_OBJ_DIR)/..#g" \
Daniel Dunbar7af18d32009-09-17 19:55:53 +000042 $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
Daniel Dunbar58033312009-09-10 23:00:15 +000043
Gabor Greif17feadf2008-03-18 07:03:00 +000044clean::
Gabor Greif5267d7c2008-03-20 14:28:22 +000045 @ rm -rf Output/
Gabor Greif17feadf2008-03-18 07:03:00 +000046
Chris Lattner9d294b92008-04-06 22:32:01 +000047.PHONY: all report clean