1 ##===- 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 # If CLANG_LEVEL is not set, then we are the top-level Makefile. Otherwise, we
11 # are being included from a subdirectory makefile.
17 DIRS
:= include lib tools runtime docs
21 ifeq ($(BUILD_EXAMPLES
),1)
22 PARALLEL_DIRS
+= examples
26 ifeq ($(MAKECMDGOALS
),libs-only
)
27 DIRS
:= $(filter-out tools docs
, $(DIRS
))
32 # Common Makefile code, shared by all Clang Makefiles.
34 # Set LLVM source root level.
35 LEVEL
:= $(CLANG_LEVEL
)/..
/..
37 # Include LLVM common makefile.
38 include $(LEVEL
)/Makefile.common
40 ifneq ($(ENABLE_DOCS
),1)
41 DIRS
:= $(filter-out docs
, $(DIRS
))
44 # Set common Clang build flags.
45 CPP.Flags
+= -I
$(PROJ_SRC_DIR
)/$(CLANG_LEVEL
)/include -I
$(PROJ_OBJ_DIR
)/$(CLANG_LEVEL
)/include
47 CPP.Flags
+= -DCLANG_VENDOR
='"$(CLANG_VENDOR) "'
50 # Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
51 # work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer
52 # GCC's have false positive warnings with it on Linux (which prove a pain to
54 # http://gcc.gnu.org/PR41874
55 # http://gcc.gnu.org/PR41838
57 # We can revisit this when LLVM/Clang support it.
58 CXX.Flags
+= -fno-strict-aliasing
61 # Clang Top Level specific stuff.
63 ifeq ($(IS_TOP_LEVEL
),1)
65 ifneq ($(PROJ_SRC_ROOT
),$(PROJ_OBJ_ROOT
))
67 $(Verb
) if
[ ! -f
test/Makefile
]; then \
69 $(CP
) $(PROJ_SRC_DIR
)/test/Makefile
test/Makefile
; \
77 @
$(MAKE
) -C
test report
80 @
$(MAKE
) -C
test clean
85 $(Verb
) etags
`find . -type f -name '*.h' -or -name '*.cpp' | \
86 grep -v /lib/Headers | grep -v /test/`
89 find tools lib
include -name
'*.cpp' \
92 -or
-name
'*.h' > cscope.files
94 .PHONY
: test report
clean cscope.files