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) |