Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 122 lines (96 sloc) 3.049 kb
afed099 @ddunbar Makefile: Switch Clang Makefiles to always include the top-level Clan…
ddunbar authored
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
13 ifndef CLANG_LEVEL
14
15 IS_TOP_LEVEL := 1
16 CLANG_LEVEL := .
51d7777 @pcc Add the Clang tblgen backends to Clang, and flip the switch to cause
pcc authored
17 DIRS := utils/TableGen include lib tools runtime docs unittests
5f016e2 Stage two of getting CFE top correct.
Reid Spencer authored
18
297b083 @ddunbar Add examples dir, built with BUILD_EXAMPLES=1 (Makefiles, no CMake eq…
ddunbar authored
19 PARALLEL_DIRS :=
20
21 ifeq ($(BUILD_EXAMPLES),1)
22 PARALLEL_DIRS += examples
23 endif
afed099 @ddunbar Makefile: Switch Clang Makefiles to always include the top-level Clan…
ddunbar authored
24 endif
25
8da8f6b @atoker Define ENABLE_CLANG_EXAMPLES instead of relying on BUILD_EXAMPLES
atoker authored
26 ifeq ($(BUILD_EXAMPLES),1)
27 ENABLE_CLANG_EXAMPLES := 1
28 else
29 ENABLE_CLANG_EXAMPLES := 0
30 endif
31
c56bc31 add a libs-only target to the clang makefile, patch by Sunay Ismail
Chris Lattner authored
32 ifeq ($(MAKECMDGOALS),libs-only)
33 DIRS := $(filter-out tools docs, $(DIRS))
34 OPTIONAL_DIRS :=
35 endif
b7bafa9 @isanbard Use an environment variable instead of what's in the make cmd goals.
isanbard authored
36 ifeq ($(BUILD_CLANG_ONLY),YES)
2bf8980 @isanbard The top-level clang Makefile is #included into other Makefiles. (sigh…
isanbard authored
37 DIRS := $(filter-out docs unittests, $(DIRS))
615c3dd @isanbard Filter out tools and unittests which we don't want to build when we'r…
isanbard authored
38 OPTIONAL_DIRS :=
39 endif
c56bc31 add a libs-only target to the clang makefile, patch by Sunay Ismail
Chris Lattner authored
40
afed099 @ddunbar Makefile: Switch Clang Makefiles to always include the top-level Clan…
ddunbar authored
41 ###
42 # Common Makefile code, shared by all Clang Makefiles.
297b083 @ddunbar Add examples dir, built with BUILD_EXAMPLES=1 (Makefiles, no CMake eq…
ddunbar authored
43
afed099 @ddunbar Makefile: Switch Clang Makefiles to always include the top-level Clan…
ddunbar authored
44 # Set LLVM source root level.
45 LEVEL := $(CLANG_LEVEL)/../..
46
47 # Include LLVM common makefile.
5f016e2 Stage two of getting CFE top correct.
Reid Spencer authored
48 include $(LEVEL)/Makefile.common
49
6c7b42f @chapuni Makefile: Follow r118918, to add configuration "ENABLE_DOCS".
chapuni authored
50 ifneq ($(ENABLE_DOCS),1)
51 DIRS := $(filter-out docs, $(DIRS))
52 endif
53
c4dec1c @ddunbar Makefiles: Set Clang CPP compiler flags in a single location, instead…
ddunbar authored
54 # Set common Clang build flags.
55 CPP.Flags += -I$(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include -I$(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include
56 ifdef CLANG_VENDOR
57 CPP.Flags += -DCLANG_VENDOR='"$(CLANG_VENDOR) "'
58 endif
9a4a9c2 @ddunbar Basic: Add support for a build variable to set the repository path th…
ddunbar authored
59 ifdef CLANG_REPOSITORY_STRING
60 CPP.Flags += -DCLANG_REPOSITORY_STRING='"$(CLANG_REPOSITORY_STRING)"'
61 endif
c4dec1c @ddunbar Makefiles: Set Clang CPP compiler flags in a single location, instead…
ddunbar authored
62
61f69d9 @ddunbar Globally disable -fno-strict-aliasing, for reasons given in the comment.
ddunbar authored
63 # Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't
0574c78 Fix typo.
Eric Christopher authored
64 # work with it enabled with GCC), Clang/llvm-gcc don't support it yet, and newer
61f69d9 @ddunbar Globally disable -fno-strict-aliasing, for reasons given in the comment.
ddunbar authored
65 # GCC's have false positive warnings with it on Linux (which prove a pain to
66 # fix). For example:
67 # http://gcc.gnu.org/PR41874
68 # http://gcc.gnu.org/PR41838
69 #
70 # We can revisit this when LLVM/Clang support it.
71 CXX.Flags += -fno-strict-aliasing
72
6ee5b93 @pcc Clang-side build system infrastructure for multiple tblgens.
pcc authored
73 # Set up Clang's tblgen.
74 ifndef CLANG_TBLGEN
75 ifeq ($(LLVM_CROSS_COMPILING),1)
51d7777 @pcc Add the Clang tblgen backends to Clang, and flip the switch to cause
pcc authored
76 CLANG_TBLGEN := $(BuildLLVMToolDir)/clang-tblgen$(BUILD_EXEEXT)
6ee5b93 @pcc Clang-side build system infrastructure for multiple tblgens.
pcc authored
77 else
51d7777 @pcc Add the Clang tblgen backends to Clang, and flip the switch to cause
pcc authored
78 CLANG_TBLGEN := $(LLVMToolDir)/clang-tblgen$(EXEEXT)
6ee5b93 @pcc Clang-side build system infrastructure for multiple tblgens.
pcc authored
79 endif
80 endif
81 ClangTableGen = $(CLANG_TBLGEN) $(TableGen.Flags)
82
afed099 @ddunbar Makefile: Switch Clang Makefiles to always include the top-level Clan…
ddunbar authored
83 ###
84 # Clang Top Level specific stuff.
85
86 ifeq ($(IS_TOP_LEVEL),1)
87
adc981a Fix make test when configuring for a seperate build directory.
Mike Stump authored
88 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
a9829ae @ddunbar Improve updating of test/Makefile for out-of-dir builds.
ddunbar authored
89 $(RecursiveTargets)::
7a17889 @jyasskin Add gTest unittests to clang, and write the first one.
jyasskin authored
90 $(Verb) for dir in test unittests; do \
1456fec If you download clang and delete the test directory, you can end up
Douglas Gregor authored
91 if [ -f $(PROJ_SRC_DIR)/$${dir}/Makefile ] && [ ! -f $${dir}/Makefile ]; then \
7a17889 @jyasskin Add gTest unittests to clang, and write the first one.
jyasskin authored
92 $(MKDIR) $${dir}; \
93 $(CP) $(PROJ_SRC_DIR)/$${dir}/Makefile $${dir}/Makefile; \
94 fi \
95 done
adc981a Fix make test when configuring for a seperate build directory.
Mike Stump authored
96 endif
97
5f016e2 Stage two of getting CFE top correct.
Reid Spencer authored
98 test::
61736b4 @krajaratnam Fix 80 col violation
krajaratnam authored
99 @ $(MAKE) -C test
ab72ffe @ggreif Switch over to the parallelized makefile, but keep old serial
ggreif authored
100
101 report::
9d294b9 remove the old non-parallel test system. 'make' in clang/test now runs
Chris Lattner authored
102 @ $(MAKE) -C test report
5f016e2 Stage two of getting CFE top correct.
Reid Spencer authored
103
104 clean::
9d294b9 remove the old non-parallel test system. 'make' in clang/test now runs
Chris Lattner authored
105 @ $(MAKE) -C test clean
a510767 @ddunbar build: Add a generated Version.inc file instead of duplicating inform…
ddunbar authored
106
c56bc31 add a libs-only target to the clang makefile, patch by Sunay Ismail
Chris Lattner authored
107 libs-only: all
5267d7c @ggreif reduce chattyness of makefiles
ggreif authored
108
8ba82b3 Add tags; this is documented to work, just need the wiring to enable it.
Mike Stump authored
109 tags::
61736b4 @krajaratnam Fix 80 col violation
krajaratnam authored
110 $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \
111 grep -v /lib/Headers | grep -v /test/`
8ba82b3 Add tags; this is documented to work, just need the wiring to enable it.
Mike Stump authored
112
432eeec @ddunbar Add 'make cscope.files' top level target.
ddunbar authored
113 cscope.files:
073777f @ddunbar Move <root>/Driver into <root>/tools/clang-cc.
ddunbar authored
114 find tools lib include -name '*.cpp' \
432eeec @ddunbar Add 'make cscope.files' top level target.
ddunbar authored
115 -or -name '*.def' \
116 -or -name '*.td' \
117 -or -name '*.h' > cscope.files
118
119 .PHONY: test report clean cscope.files
afed099 @ddunbar Makefile: Switch Clang Makefiles to always include the top-level Clan…
ddunbar authored
120
121 endif
Something went wrong with that request. Please try again.