1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
\r
2 # Use of this source code is governed by a BSD-style license that can be
\r
3 # found in the LICENSE file.
\r
5 # This target generates a "last_change.h" header file in the generated files
\r
6 # directory that contains a define of the last revision of the source tree
\r
8 # #define LAST_CHANGE "123456"
\r
10 # The version is a string rather than an integer for extra flexibility (for
\r
11 # example, we may require git hashes in the future).
\r
13 # All you need to do is depend on this target, and then from your source code:
\r
14 # #include "build/util/last_change.h"
\r
15 action("last_change") {
\r
16 script = "//build/util/lastchange.py"
\r
18 # This script must be run before targets depending on us.
\r
21 # Rerun the script any time this file changes.
\r
22 source_prereqs = [ "//build/util/LASTCHANGE" ]
\r
24 output_header = "$target_gen_dir/last_change.h"
\r
25 outputs = [ output_header ]
\r
27 build_relative_src = rebase_path("//", root_build_dir)
\r
28 build_relative_outputs = rebase_path(output_header, root_build_dir)
\r
31 "--source-dir=$build_relative_src",
\r
32 "--header=$build_relative_outputs",
\r
33 "--version-macro=LAST_CHANGE",
\r