Chromium Code Reviews| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 IceTargetLoweringX8632.cpp \ | 93 IceTargetLoweringX8632.cpp \ |
| 94 IceTimerTree.cpp \ | 94 IceTimerTree.cpp \ |
| 95 IceTranslator.cpp \ | 95 IceTranslator.cpp \ |
| 96 IceTypeConverter.cpp \ | 96 IceTypeConverter.cpp \ |
| 97 IceTypes.cpp \ | 97 IceTypes.cpp \ |
| 98 llvm2ice.cpp \ | 98 llvm2ice.cpp \ |
| 99 PNaClTranslator.cpp | 99 PNaClTranslator.cpp |
| 100 | 100 |
| 101 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) | 101 OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) |
| 102 | 102 |
| 103 | |
| 104 MINOBJDIR=$(OBJDIR)/min | |
| 105 | |
| 106 MINOBJS=$(patsubst %.cpp, $(MINOBJDIR)/%.o, $(SRCS)) | |
| 107 | |
| 108 MIN_CXXFLAGS = -DBUILD_MIN_LLVM | |
|
Jim Stichnoth
2014/10/13 16:03:58
LLVM?
Maybe something like SZ_MINIMAL?
jvoung (off chromium)
2014/10/13 17:05:08
SHAVED_ICE
just kidding
Karl
2014/10/14 22:54:12
Done.
| |
| 109 | |
| 103 # Keep all the first target so it's the default. | 110 # Keep all the first target so it's the default. |
| 104 all: $(OBJDIR)/llvm2ice make_symlink | 111 all: $(OBJDIR)/llvm2ice $(MINOBJDIR)/llvm2ice make_symlink |
| 105 | 112 |
| 106 make_symlink: $(OBJDIR)/llvm2ice | 113 make_symlink: $(OBJDIR)/llvm2ice $(MINOBJDIR)/llvm2ice |
|
Jim Stichnoth
2014/10/13 16:03:58
I'm not thrilled about the build time doubling. W
jvoung (off chromium)
2014/10/13 17:05:08
If it helps, lit's llvm/utils/lit/lit/TestRunner.p
Karl
2014/10/14 22:54:12
Made code dependent of command-line flag: "MINIMAL
| |
| 107 rm -f llvm2ice | 114 rm -f llvm2ice |
| 108 ln -s $(OBJDIR)/llvm2ice | 115 ln -s $(OBJDIR)/llvm2ice |
| 116 rm -f minllvm2ice | |
| 117 ln -s $(MINOBJDIR)/llvm2ice minllvm2ice | |
| 109 | 118 |
| 110 .PHONY: all make_symlink | 119 .PHONY: all make_symlink |
| 111 | 120 |
| 112 $(OBJDIR)/llvm2ice: $(OBJS) | 121 $(OBJDIR)/llvm2ice: $(OBJS) |
| 113 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ | 122 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ |
| 114 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | 123 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) |
| 115 | 124 |
| 116 # TODO: Be more precise than "*.h" here and elsewhere. | 125 # TODO: Be more precise than "*.h" here and elsewhere. |
| 117 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def | 126 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def |
| 118 $(CXX) -c $(CXXFLAGS) $< -o $@ | 127 $(CXX) -c $(CXXFLAGS) $< -o $@ |
| 119 | 128 |
| 120 $(OBJS): | $(OBJDIR) | 129 $(OBJS): | $(OBJDIR) |
| 121 | 130 |
| 122 $(OBJDIR): | 131 $(OBJDIR): |
| 123 @mkdir -p $@ | 132 @mkdir -p $@ |
| 124 | 133 |
| 134 $(MINOBJDIR)/llvm2ice: $(MINOBJS) | |
| 135 $(CXX) $(MIN_CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -ldl \ | |
| 136 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) | |
| 137 | |
| 138 $(MINOBJS): $(MINOBJDIR)/%.o: src/%.cpp src/*.h src/*.def | |
| 139 $(CXX) -c $(MIN_CXXFLAGS) $(CXXFLAGS) $< -o $@ | |
| 140 | |
| 141 $(MINOBJS): | $(MINOBJDIR) | |
| 142 | |
| 143 $(MINOBJDIR): $(OBJDIR) | |
| 144 @mkdir -p $@ | |
| 145 | |
| 125 check-lit: llvm2ice make_symlink | 146 check-lit: llvm2ice make_symlink |
| 126 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ | 147 LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ |
| 127 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit | 148 $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit |
| 128 | 149 |
| 129 check: check-lit | 150 check: check-lit |
| 130 (cd crosstest; ./runtests.sh) | 151 (cd crosstest; ./runtests.sh) |
| 131 | 152 |
| 132 # TODO: Fix the use of wildcards. | 153 # TODO: Fix the use of wildcards. |
| 133 # Assumes clang-format is within $PATH. | 154 # Assumes clang-format is within $PATH. |
| 134 format: | 155 format: |
| 135 clang-format -style=LLVM -i src/*.h src/*.cpp | 156 clang-format -style=LLVM -i src/*.h src/*.cpp |
| 136 | 157 |
| 137 # Assumes clang-format-diff.py is within $PATH, and that the | 158 # Assumes clang-format-diff.py is within $PATH, and that the |
| 138 # clang-format it calls is also within $PATH. This may require adding | 159 # clang-format it calls is also within $PATH. This may require adding |
| 139 # a component to $PATH, or creating symlinks within some existing | 160 # a component to $PATH, or creating symlinks within some existing |
| 140 # $PATH component. Uses the one in /usr/lib/clang-format/ if it | 161 # $PATH component. Uses the one in /usr/lib/clang-format/ if it |
| 141 # exists. | 162 # exists. |
| 142 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py)) | 163 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py)) |
| 143 CLANG_FORMAT_DIFF = clang-format-diff.py | 164 CLANG_FORMAT_DIFF = clang-format-diff.py |
| 144 else | 165 else |
| 145 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py | 166 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py |
| 146 endif | 167 endif |
| 147 format-diff: | 168 format-diff: |
| 148 git diff -U0 `git merge-base HEAD master` | \ | 169 git diff -U0 `git merge-base HEAD master` | \ |
| 149 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i | 170 $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i |
| 150 | 171 |
| 151 clean: | 172 clean: |
| 152 » rm -rf llvm2ice *.o build/ | 173 » rm -rf llvm2ice minllvm2ice *.o build/ |
| OLD | NEW |