lint targets should depend on the lint script itself
authorJeff Donahue <jeff.donahue@gmail.com>
Tue, 5 Aug 2014 23:19:31 +0000 (16:19 -0700)
committerJeff Donahue <jeff.donahue@gmail.com>
Tue, 12 Aug 2014 19:43:41 +0000 (12:43 -0700)
Makefile

index 2c071c8..287120a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -62,6 +62,7 @@ NONGEN_CXX_SRCS := $(shell find \
        examples \
        tools \
        -name "*.cpp" -or -name "*.hpp" -or -name "*.cu" -or -name "*.cuh")
+LINT_SCRIPT := scripts/cpp_lint.py
 LINT_OUTPUT_DIR := $(BUILD_DIR)/.lint
 LINT_EXT := lint.txt
 LINT_OUTPUTS := $(addsuffix .$(LINT_EXT), $(addprefix $(LINT_OUTPUT_DIR)/, $(NONGEN_CXX_SRCS)))
@@ -322,9 +323,9 @@ $(EMPTY_LINT_REPORT): $(LINT_OUTPUTS) | $(BUILD_DIR)
          $(RM) $(NONEMPTY_LINT_REPORT); \
          echo "No lint errors!";
 
-$(LINT_OUTPUTS): $(LINT_OUTPUT_DIR)/%.lint.txt : % | $(LINT_OUTPUT_DIR)
+$(LINT_OUTPUTS): $(LINT_OUTPUT_DIR)/%.lint.txt : % $(LINT_SCRIPT) | $(LINT_OUTPUT_DIR)
        @ mkdir -p $(dir $@)
-       @ python ./scripts/cpp_lint.py $< 2>&1 \
+       @ python $(LINT_SCRIPT) $< 2>&1 \
                | grep -v "^Done processing " \
                | grep -v "^Total errors found: 0" \
                > $@ \