Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: Makefile.standalone

Issue 877003003: Subzero: Use a "known" version of clang-format. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix wildcards Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | crosstest/mem_intrin.cpp » ('j') | crosstest/mem_intrin_main.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 @$(OBJDIR)/llvm2ice --build-atts 150 @$(OBJDIR)/llvm2ice --build-atts
151 151
152 .PHONY: all make_symlink 152 .PHONY: all make_symlink
153 153
154 # TODO(kschimpf): Fix python scripts to directly get build attributes 154 # TODO(kschimpf): Fix python scripts to directly get build attributes
155 # rather than generating $(OBJDIR)/llvm2ice.build_atts. 155 # rather than generating $(OBJDIR)/llvm2ice.build_atts.
156 $(OBJDIR)/llvm2ice: $(OBJS) 156 $(OBJDIR)/llvm2ice: $(OBJS)
157 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \ 157 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \
158 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) 158 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
159 159
160 # TODO: Be more precise than "*.h" here and elsewhere. 160 # TODO(stichnot): Be more precise than "*.h" here and elsewhere.
161 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def 161 $(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def
162 $(CXX) -c $(CXXFLAGS) $< -o $@ 162 $(CXX) -c $(CXXFLAGS) $< -o $@
163 163
164 $(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS) 164 $(OBJDIR)/run_unittests: $(UNITTEST_OBJS) $(UNITTEST_LIB_OBJS)
165 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -lgtest -lgtest_main -ldl \ 165 $(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) -lgtest -lgtest_main -ldl \
166 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib) 166 -Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
167 167
168 $(UNITTEST_OBJS): $(OBJDIR)/unittest/%.o: unittest/%.cpp 168 $(UNITTEST_OBJS): $(OBJDIR)/unittest/%.o: unittest/%.cpp
169 $(CXX) -c $(CXXFLAGS) \ 169 $(CXX) -c $(CXXFLAGS) \
170 -Isrc/ \ 170 -Isrc/ \
(...skipping 19 matching lines...) Expand all
190 $(OBJDIR)/run_unittests 190 $(OBJDIR)/run_unittests
191 191
192 ifdef MINIMAL 192 ifdef MINIMAL
193 check: check-lit check-unit 193 check: check-lit check-unit
194 @echo "Crosstests ignored, minimal build" 194 @echo "Crosstests ignored, minimal build"
195 else 195 else
196 check: check-lit check-unit 196 check: check-lit check-unit
197 (cd crosstest; ./runtests.sh) 197 (cd crosstest; ./runtests.sh)
198 endif 198 endif
199 199
200 # TODO: Fix the use of wildcards.
201 # Assumes clang-format is within $PATH.
202 format: 200 format:
203 » clang-format -style=LLVM -i src/*.h src/*.cpp 201 » $(LLVM_BIN_PATH)/clang-format -style=LLVM -i \
202 » `find . -name "*.c" -o -name "*.cpp" -o -name "*.h"`
jvoung (off chromium) 2015/01/27 18:08:11 Would clang-format know what to do with .def files
Jim Stichnoth 2015/01/27 19:24:11 Actually, clang-format is precisely the reason why
204 203
205 # Assumes clang-format-diff.py is within $PATH, and that the
206 # clang-format it calls is also within $PATH. This may require adding
207 # a component to $PATH, or creating symlinks within some existing
208 # $PATH component. Uses the one in /usr/lib/clang-format/ if it
209 # exists.
210 ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py))
211 CLANG_FORMAT_DIFF = clang-format-diff.py
212 else
213 CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py
214 endif
215 format-diff: 204 format-diff:
216 git diff -U0 `git merge-base HEAD master` | \ 205 git diff -U0 `git merge-base HEAD master` | \
217 » $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i 206 » PATH=$(LLVM_BIN_PATH):$(PATH) \
207 » $(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \
208 » -p1 -style=LLVM -i
218 209
219 clean: 210 clean:
220 rm -rf llvm2ice *.o $(OBJDIR) 211 rm -rf llvm2ice *.o $(OBJDIR)
221 212
222 clean-all: clean 213 clean-all: clean
223 rm -rf build/ 214 rm -rf build/
OLDNEW
« no previous file with comments | « no previous file | crosstest/mem_intrin.cpp » ('j') | crosstest/mem_intrin_main.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698