Makefile revision afed099bd2e759efd4bb63fdc525d3445f94cc13
1##===- Makefile --------------------------------------------*- Makefile -*-===##
2#
3#                     The LLVM Compiler Infrastructure
4#
5# This file is distributed under the University of Illinois Open Source
6# License. See LICENSE.TXT for details.
7#
8##===----------------------------------------------------------------------===##
9
10# If CLANG_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
11# are being included from a subdirectory makefile.
12
13ifndef CLANG_LEVEL
14
15IS_TOP_LEVEL := 1
16CLANG_LEVEL := .
17DIRS := include lib tools docs
18
19PARALLEL_DIRS :=
20
21ifeq ($(BUILD_EXAMPLES),1)
22  PARALLEL_DIRS += examples
23endif
24endif
25
26###
27# Common Makefile code, shared by all Clang Makefiles.
28
29# Set LLVM source root level.
30LEVEL := $(CLANG_LEVEL)/../..
31
32# Include LLVM common makefile.
33include $(LEVEL)/Makefile.common
34
35###
36# Clang Top Level specific stuff.
37
38ifeq ($(IS_TOP_LEVEL),1)
39
40ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
41$(RecursiveTargets)::
42	$(Verb) if [ ! -f test/Makefile ]; then \
43	  $(MKDIR) test; \
44	  $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \
45	fi
46endif
47
48test::
49	@ $(MAKE) -C test
50
51report::
52	@ $(MAKE) -C test report
53
54clean::
55	@ $(MAKE) -C test clean
56
57tags::
58	$(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
59	  grep -v /lib/Headers | grep -v /test/`
60
61cscope.files:
62	find tools lib include -name '*.cpp' \
63	                    -or -name '*.def' \
64	                    -or -name '*.td' \
65	                    -or -name '*.h' > cscope.files
66
67.PHONY: test report clean cscope.files
68
69endif
70