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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | crosstest/mem_intrin.cpp » ('j') | crosstest/mem_intrin_main.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Makefile.standalone
diff --git a/Makefile.standalone b/Makefile.standalone
index be60dc686993b2158d81e48e1e32ba4df8a65312..e5a4d8da757c986f568ea4f43d10b0ec2cedb55c 100644
--- a/Makefile.standalone
+++ b/Makefile.standalone
@@ -157,7 +157,7 @@ $(OBJDIR)/llvm2ice: $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LLVM_LDFLAGS) \
-Wl,-rpath=$(abspath $(LIBCXX_INSTALL_PATH)/lib)
-# TODO: Be more precise than "*.h" here and elsewhere.
+# TODO(stichnot): Be more precise than "*.h" here and elsewhere.
$(OBJS): $(OBJDIR)/%.o: src/%.cpp src/*.h src/*.def
$(CXX) -c $(CXXFLAGS) $< -o $@
@@ -197,24 +197,15 @@ check: check-lit check-unit
(cd crosstest; ./runtests.sh)
endif
-# TODO: Fix the use of wildcards.
-# Assumes clang-format is within $PATH.
format:
- clang-format -style=LLVM -i src/*.h src/*.cpp
-
-# Assumes clang-format-diff.py is within $PATH, and that the
-# clang-format it calls is also within $PATH. This may require adding
-# a component to $PATH, or creating symlinks within some existing
-# $PATH component. Uses the one in /usr/lib/clang-format/ if it
-# exists.
-ifeq (,$(wildcard /usr/lib/clang-format/clang-format-diff.py))
- CLANG_FORMAT_DIFF = clang-format-diff.py
-else
- CLANG_FORMAT_DIFF = /usr/lib/clang-format/clang-format-diff.py
-endif
+ $(LLVM_BIN_PATH)/clang-format -style=LLVM -i \
+ `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
+
format-diff:
git diff -U0 `git merge-base HEAD master` | \
- $(CLANG_FORMAT_DIFF) -p1 -style=LLVM -i
+ PATH=$(LLVM_BIN_PATH):$(PATH) \
+ $(LLVM_SRC_PATH)/../clang/tools/clang-format/clang-format-diff.py \
+ -p1 -style=LLVM -i
clean:
rm -rf llvm2ice *.o $(OBJDIR)
« 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