diff options
-rwxr-xr-x | bootstrap.py | 7 | ||||
-rw-r--r-- | misc/ninja.vim | 9 | ||||
-rw-r--r-- | src/build.cc | 14 | ||||
-rw-r--r-- | src/build.h | 2 | ||||
-rw-r--r-- | src/depfile_parser.h | 5 | ||||
-rw-r--r-- | src/explain.h | 5 | ||||
-rw-r--r-- | src/lexer.h | 4 | ||||
-rw-r--r-- | src/metrics.h | 5 |
8 files changed, 30 insertions, 21 deletions
diff --git a/bootstrap.py b/bootstrap.py index 1df423d..ad6f1eb 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -27,10 +27,9 @@ parser.add_option('--verbose', action='store_true', (options, conf_args) = parser.parse_args() def run(*args, **kwargs): - try: - subprocess.check_call(*args, **kwargs) - except subprocess.CalledProcessError, e: - sys.exit(e.returncode) + returncode = subprocess.call(*args, **kwargs) + if returncode != 0: + sys.exit(returncode) # Compute system-specific CFLAGS/LDFLAGS as used in both in the below # g++ call as well as in the later configure.py. diff --git a/misc/ninja.vim b/misc/ninja.vim index 24fc9b4..51a95c2 100644 --- a/misc/ninja.vim +++ b/misc/ninja.vim @@ -1,10 +1,10 @@ " ninja build file syntax. " Language: ninja build file as described at " http://martine.github.com/ninja/manual.html -" Version: 1.0 -" Last Change: 2011/12/31 +" Version: 1.2 +" Last Change: 2012/06/01 " Maintainer: Nicolas Weber <nicolasweber@gmx.de> -" Version 1.0 of this script is in the upstream vim repository and will be +" Version 1.2 of this script is in the upstream vim repository and will be " included in the next vim release. If you change this, please send your change " upstream. @@ -18,6 +18,8 @@ endif syn case match +syn match ninjaComment /#.*/ contains=@Spell + " Toplevel statements are the ones listed here and " toplevel variable assignments (ident '=' value). " lexer.in.cc, ReadToken() and parsers.cc, Parse() @@ -56,6 +58,7 @@ syn match ninjaVar "\${[a-zA-Z0-9_.-]\+}" " order-only dependency || syn match ninjaOperator "\(=\|:\||\|||\)\ze\s" +hi def link ninjaComment Comment hi def link ninjaKeyword Keyword hi def link ninjaRuleCommand Statement hi def link ninjaWrapLineOperator ninjaOperator diff --git a/src/build.cc b/src/build.cc index 157442d..65aa6a9 100644 --- a/src/build.cc +++ b/src/build.cc @@ -16,6 +16,7 @@ #include <assert.h> #include <stdio.h> +#include <stdlib.h> #ifdef _WIN32 #include <windows.h> @@ -23,7 +24,6 @@ #include <unistd.h> #include <sys/ioctl.h> #include <sys/time.h> -#include <sys/termios.h> #endif #include "build_log.h" @@ -36,7 +36,6 @@ BuildStatus::BuildStatus(const BuildConfig& config) : config_(config), start_time_millis_(GetTimeMillis()), - last_update_millis_(start_time_millis_), started_edges_(0), finished_edges_(0), total_edges_(0), have_blank_line_(true), progress_status_format_(NULL) { #ifndef _WIN32 @@ -85,7 +84,6 @@ void BuildStatus::BuildEdgeFinished(Edge* edge, RunningEdgeMap::iterator i = running_edges_.find(edge); *start_time = i->second; *end_time = (int)(now - start_time_millis_); - int total_time = end_time - start_time; running_edges_.erase(i); if (config_.verbosity == BuildConfig::QUIET) @@ -94,15 +92,7 @@ void BuildStatus::BuildEdgeFinished(Edge* edge, if (smart_terminal_) PrintStatus(edge); - if (success && output.empty()) { - if (!smart_terminal_) { - if (total_time > 5*1000) { - printf("%.1f%% %d/%d\n", finished_edges_ * 100 / (float)total_edges_, - finished_edges_, total_edges_); - last_update_millis_ = now; - } - } - } else { + if (!success || !output.empty()) { if (smart_terminal_) printf("\n"); diff --git a/src/build.h b/src/build.h index 5dcdb5b..451c534 100644 --- a/src/build.h +++ b/src/build.h @@ -175,8 +175,6 @@ struct BuildStatus { /// Time the build started. int64_t start_time_millis_; - /// Time we last printed an update. - int64_t last_update_millis_; int started_edges_, finished_edges_, total_edges_; diff --git a/src/depfile_parser.h b/src/depfile_parser.h index c900956..1e6ebb5 100644 --- a/src/depfile_parser.h +++ b/src/depfile_parser.h @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifndef NINJA_DEPFILE_PARSER_H_ +#define NINJA_DEPFILE_PARSER_H_ + #include <string> #include <vector> using namespace std; @@ -28,3 +31,5 @@ struct DepfileParser { StringPiece out_; vector<StringPiece> ins_; }; + +#endif // NINJA_DEPFILE_PARSER_H_ diff --git a/src/explain.h b/src/explain.h index 021f0d4..d4f6a6c 100644 --- a/src/explain.h +++ b/src/explain.h @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifndef NINJA_EXPLAIN_H_ +#define NINJA_EXPLAIN_H_ + #include <stdio.h> #define EXPLAIN(fmt, ...) { \ @@ -20,3 +23,5 @@ } extern bool g_explaining; + +#endif // NINJA_EXPLAIN_H_ diff --git a/src/lexer.h b/src/lexer.h index 75c1b2f..19008d7 100644 --- a/src/lexer.h +++ b/src/lexer.h @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifndef NINJA_LEXER_H_ +#define NINJA_LEXER_H_ + #include "string_piece.h" // Windows may #define ERROR. @@ -95,3 +98,4 @@ private: const char* last_token_; }; +#endif // NINJA_LEXER_H_ diff --git a/src/metrics.h b/src/metrics.h index 74f5f8f..af6e9a2 100644 --- a/src/metrics.h +++ b/src/metrics.h @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifndef NINJA_METRICS_H_ +#define NINJA_METRICS_H_ + #include <string> #include <vector> using namespace std; @@ -62,3 +65,5 @@ private: ScopedMetric metrics_h_scoped(metrics_h_metric); extern Metrics* g_metrics; + +#endif // NINJA_METRICS_H_ |