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

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: Add a clang-format blacklist. Fix formatting "errors". 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') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Makefile.standalone
diff --git a/Makefile.standalone b/Makefile.standalone
index be60dc686993b2158d81e48e1e32ba4df8a65312..1b24d11846259d8a900641af70bfabd2ecbadae6 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,18 @@ check: check-lit check-unit
(cd crosstest; ./runtests.sh)
endif
-# TODO: Fix the use of wildcards.
-# Assumes clang-format is within $PATH.
+FORMAT_BLACKLIST =
+# Add one of the following lines for each source file to ignore.
+FORMAT_BLACKLIST += ! -name IceParseInstsTest.cpp
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 . -regex '.*\.\(c\|h\|cpp\)' $(FORMAT_BLACKLIST)`
+
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698