Set root folder for linter.

This CL sets the root folder to be used by the linter when determining
header guards.

Bug: tint:23
Change-Id: I52ce8d3cd67e9882d4ea8a2c9cbd2d5d5650d5b7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/17205
Reviewed-by: David Neto <dneto@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2392cc8..7c4db92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,7 @@
 
 find_package(Doxygen)
 if(DOXYGEN_FOUND)
-  add_custom_target(tint_docs ALL
+  add_custom_target(tint-docs ALL
       COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
       COMMENT "Generating API documentation"
@@ -159,3 +159,14 @@
   add_subdirectory(fuzz)
 endif()
 
+add_custom_target(tint-lint
+  COMMAND ./tools/lint
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  COMMENT "Running linter"
+  VERBATIM)
+
+add_custom_target(tint-format
+  COMMAND ./tools/format
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  COMMENT "Running formatter"
+  VERBATIM)
diff --git a/tools/lint b/tools/lint
index 0afb012..35d88d4 100755
--- a/tools/lint
+++ b/tools/lint
@@ -15,5 +15,5 @@
 
 set -e  # fail on error
 
-./third_party/cpplint/cpplint/cpplint.py `find src -type f`
-./third_party/cpplint/cpplint/cpplint.py `find samples -type f`
+./third_party/cpplint/cpplint/cpplint.py --root=. `find src -type f`
+./third_party/cpplint/cpplint/cpplint.py --root=. `find samples -type f`