OLD | NEW |
1 # The following variables will likely need to be modified, depending on where | 1 # The following variables will likely need to be modified, depending on where |
2 # and how you built LLVM & Clang. They can be overridden in a command-line | 2 # and how you built LLVM & Clang. They can be overridden in a command-line |
3 # invocation of make, like: | 3 # invocation of make, like: |
4 # | 4 # |
5 # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ | 5 # make LLVM_SRC_PATH=<path> LLVM_BIN_PATH=<path> \ |
6 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... | 6 # LIBCXX_INSTALL_PATH=<path> CLANG_PATH=<path> ... |
7 # | 7 # |
8 | 8 |
9 # LLVM_SRC_PATH is the path to the root of the checked out source code. This | 9 # LLVM_SRC_PATH is the path to the root of the checked out source code. This |
10 # directory should contain the configure script, the include/ and lib/ | 10 # directory should contain the configure script, the include/ and lib/ |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 # It's recommended that CXX matches the compiler you used to build LLVM itself. | 79 # It's recommended that CXX matches the compiler you used to build LLVM itself. |
80 CCACHE := `command -v ccache` | 80 CCACHE := `command -v ccache` |
81 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ | 81 CXX := CCACHE_CPP2=yes $(CCACHE) $(CLANG_PATH)/clang++ |
82 | 82 |
83 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ | 83 CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \ |
84 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \ | 84 -fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \ |
85 $(HOST_FLAGS) -Wno-error=unused-parameter \ | 85 $(HOST_FLAGS) -Wno-error=unused-parameter \ |
86 -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 | 86 -I$(LIBCXX_INSTALL_PATH)/include/c++/v1 |
87 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib | 87 LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib |
88 | 88 |
89 SRCS= \ | 89 SRCS = \ |
90 assembler.cpp \ | 90 assembler.cpp \ |
91 assembler_ia32.cpp \ | 91 assembler_ia32.cpp \ |
92 IceCfg.cpp \ | 92 IceCfg.cpp \ |
93 IceCfgNode.cpp \ | 93 IceCfgNode.cpp \ |
94 IceConverter.cpp \ | |
95 IceGlobalContext.cpp \ | 94 IceGlobalContext.cpp \ |
96 IceGlobalInits.cpp \ | 95 IceGlobalInits.cpp \ |
97 IceInst.cpp \ | 96 IceInst.cpp \ |
98 IceInstX8632.cpp \ | 97 IceInstX8632.cpp \ |
99 IceIntrinsics.cpp \ | 98 IceIntrinsics.cpp \ |
100 IceLiveness.cpp \ | 99 IceLiveness.cpp \ |
101 IceMemoryRegion.cpp \ | 100 IceMemoryRegion.cpp \ |
102 IceOperand.cpp \ | 101 IceOperand.cpp \ |
103 IceRegAlloc.cpp \ | 102 IceRegAlloc.cpp \ |
104 IceRNG.cpp \ | 103 IceRNG.cpp \ |
105 IceTargetLowering.cpp \ | 104 IceTargetLowering.cpp \ |
106 IceTargetLoweringX8632.cpp \ | 105 IceTargetLoweringX8632.cpp \ |
107 IceTimerTree.cpp \ | 106 IceTimerTree.cpp \ |
108 IceTranslator.cpp \ | 107 IceTranslator.cpp \ |
109 IceTypeConverter.cpp \ | 108 IceTypeConverter.cpp \ |
110 IceTypes.cpp \ | 109 IceTypes.cpp \ |
111 llvm2ice.cpp \ | 110 llvm2ice.cpp \ |
112 PNaClTranslator.cpp | 111 PNaClTranslator.cpp |
113 | 112 |
| 113 ifndef MINIMAL |
| 114 SRCS += IceConverter.cpp |
| 115 endif |
| 116 |
114 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) | 117 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
115 | 118 |
116 # Keep all the first target so it's the default. | 119 # Keep all the first target so it's the default. |
117 all: $(OBJDIR)/llvm2ice make_symlink | 120 all: $(OBJDIR)/llvm2ice make_symlink |
118 | 121 |
119 # Creates symbolic link so that testing is easier. Also runs | 122 # Creates symbolic link so that testing is easier. Also runs |
120 # llvm2ice to verify that the defines flags have valid values, | 123 # llvm2ice to verify that the defines flags have valid values, |
121 # as well as describe the corresponding build attributes. | 124 # as well as describe the corresponding build attributes. |
122 make_symlink: $(OBJDIR)/llvm2ice | 125 make_symlink: $(OBJDIR)/llvm2ice |
123 rm -rf llvm2ice | 126 rm -rf llvm2ice |
(...skipping 15 matching lines...) Expand all Loading... |
139 | 142 |
140 $(OBJS): | $(OBJDIR) | 143 $(OBJS): | $(OBJDIR) |
141 | 144 |
142 $(OBJDIR): | 145 $(OBJDIR): |
143 @mkdir -p $@ | 146 @mkdir -p $@ |
144 | 147 |
145 check-lit: llvm2ice make_symlink | 148 check-lit: llvm2ice make_symlink |
146 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ | 149 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ |
147 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit | 150 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit |
148 | 151 |
| 152 ifdef MINIMAL |
| 153 check: check-lit |
| 154 @echo "Crosstests ignored, minimal build" |
| 155 else |
149 check: check-lit | 156 check: check-lit |
150 (cd crosstest; ./runtests.sh) | 157 (cd crosstest; ./runtests.sh) |
| 158 endif |
151 | 159 |
152 # TODO: Fix the use of wildcards. | 160 # TODO: Fix the use of wildcards. |
153 # Assumes clang-format is within $PATH. | 161 # Assumes clang-format is within $PATH. |
154 format: | 162 format: |
155 clang-format -style=LLVM -i src/*.h src/*.cpp | 163 clang-format -style=LLVM -i src/*.h src/*.cpp |
156 | 164 |
157 # Assumes clang-format-diff.py is within $PATH, and that the | 165 # Assumes clang-format-diff.py is within $PATH, and that the |
158 # clang-format it calls is also within $PATH. This may require adding | 166 # clang-format it calls is also within $PATH. This may require adding |
159 # a component to $PATH, or creating symlinks within some existing | 167 # a component to $PATH, or creating symlinks within some existing |
160 # $PATH component. Uses the one in /usr/lib/clang-format/ if it | 168 # $PATH component. Uses the one in /usr/lib/clang-format/ if it |
161 # exists. | 169 # exists. |
162 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py)) | 170 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py)) |
163 CLANG_FORMAT_DIFF = clang-format-diff.py | 171 CLANG_FORMAT_DIFF = clang-format-diff.py |
164 else | 172 else |
165 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py | 173 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py |
166 endif | 174 endif |
167 format-diff: | 175 format-diff: |
168 git diff -U0 `git merge-base HEAD master` | \ | 176 git diff -U0 `git merge-base HEAD master` | \ |
169 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i | 177 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i |
170 | 178 |
171 clean: | 179 clean: |
172 rm -rf llvm2ice *.o $(OBJDIR) | 180 rm -rf llvm2ice *.o $(OBJDIR) |
173 | 181 |
174 clean-all: clean | 182 clean-all: clean |
175 rm -rf build/ | 183 rm -rf build/ |
OLD | NEW |