Shinichiro Hamaji | 1d545aa | 2015-06-23 15:29:13 +0900 | [diff] [blame] | 1 | // Copyright 2015 Google Inc. All rights reserved |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Fumitoshi Ukai | 744bb2b | 2015-06-25 00:10:52 +0900 | [diff] [blame] | 15 | // +build ignore |
| 16 | |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 17 | #include <limits.h> |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 18 | #include <stdio.h> |
| 19 | #include <string.h> |
Shinichiro Hamaji | 087cecd | 2015-07-06 19:51:58 +0900 | [diff] [blame] | 20 | #include <stdlib.h> |
Shinichiro Hamaji | a4bb774 | 2015-07-31 11:27:30 +0900 | [diff] [blame] | 21 | #include <time.h> |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 22 | #include <unistd.h> |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 23 | |
| 24 | #include "ast.h" |
| 25 | #include "dep.h" |
| 26 | #include "eval.h" |
| 27 | #include "exec.h" |
| 28 | #include "file.h" |
| 29 | #include "file_cache.h" |
| 30 | #include "fileutil.h" |
Shinichiro Hamaji | 5f57a99 | 2015-06-30 19:39:39 +0900 | [diff] [blame] | 31 | #include "find.h" |
Shinichiro Hamaji | 08808d3 | 2015-06-26 08:02:45 +0900 | [diff] [blame] | 32 | #include "flags.h" |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 33 | #include "func.h" |
| 34 | #include "log.h" |
Shinichiro Hamaji | 5f86e1a | 2015-06-29 14:25:39 +0900 | [diff] [blame] | 35 | #include "ninja.h" |
Shinichiro Hamaji | 42b625f | 2015-06-16 23:07:21 +0900 | [diff] [blame] | 36 | #include "parser.h" |
Shinichiro Hamaji | 0d8e79b | 2015-06-30 03:29:35 +0900 | [diff] [blame] | 37 | #include "stats.h" |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 38 | #include "string_piece.h" |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 39 | #include "stringprintf.h" |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 40 | #include "strutil.h" |
Shinichiro Hamaji | e799275 | 2015-06-29 18:38:35 +0900 | [diff] [blame] | 41 | #include "symtab.h" |
Shinichiro Hamaji | cbd34cd | 2015-07-05 02:53:04 +0900 | [diff] [blame] | 42 | #include "timeutil.h" |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 43 | #include "var.h" |
| 44 | |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 45 | static void Init() { |
| 46 | InitSymtab(); |
| 47 | InitFuncTable(); |
| 48 | InitDepNodePool(); |
Shinichiro Hamaji | 42b625f | 2015-06-16 23:07:21 +0900 | [diff] [blame] | 49 | InitParser(); |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 50 | |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 51 | if (g_flags.makefile == NULL) { |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 52 | if (Exists("GNUmakefile")) { |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 53 | g_flags.makefile = "GNUmakefile"; |
Shinichiro Hamaji | 03e03af | 2015-07-13 20:43:39 -0700 | [diff] [blame] | 54 | #if !defined(__APPLE__) |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 55 | } else if (Exists("makefile")) { |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 56 | g_flags.makefile = "makefile"; |
Shinichiro Hamaji | 03e03af | 2015-07-13 20:43:39 -0700 | [diff] [blame] | 57 | #endif |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 58 | } else if (Exists("Makefile")) { |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 59 | g_flags.makefile = "Makefile"; |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | static void Quit() { |
Shinichiro Hamaji | 0d8e79b | 2015-06-30 03:29:35 +0900 | [diff] [blame] | 65 | ReportAllStats(); |
| 66 | |
Shinichiro Hamaji | 42b625f | 2015-06-16 23:07:21 +0900 | [diff] [blame] | 67 | QuitParser(); |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 68 | QuitDepNodePool(); |
| 69 | QuitFuncTable(); |
| 70 | QuitSymtab(); |
| 71 | } |
| 72 | |
Shinichiro Hamaji | e799275 | 2015-06-29 18:38:35 +0900 | [diff] [blame] | 73 | static void ReadBootstrapMakefile(const vector<Symbol>& targets, |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 74 | vector<AST*>* asts) { |
| 75 | string bootstrap = ( |
Shinichiro Hamaji | 91d1249 | 2015-09-04 09:54:48 +0900 | [diff] [blame] | 76 | "CC?=cc\n" |
Shinichiro Hamaji | d749b93 | 2015-07-13 20:51:15 -0700 | [diff] [blame] | 77 | #if defined(__APPLE__) |
Shinichiro Hamaji | 91d1249 | 2015-09-04 09:54:48 +0900 | [diff] [blame] | 78 | "CXX?=c++\n" |
Shinichiro Hamaji | d749b93 | 2015-07-13 20:51:15 -0700 | [diff] [blame] | 79 | #else |
Shinichiro Hamaji | 91d1249 | 2015-09-04 09:54:48 +0900 | [diff] [blame] | 80 | "CXX?=g++\n" |
Shinichiro Hamaji | d749b93 | 2015-07-13 20:51:15 -0700 | [diff] [blame] | 81 | #endif |
Shinichiro Hamaji | 91d1249 | 2015-09-04 09:54:48 +0900 | [diff] [blame] | 82 | "AR?=ar\n" |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 83 | // Pretend to be GNU make 3.81, for compatibility. |
Shinichiro Hamaji | 91d1249 | 2015-09-04 09:54:48 +0900 | [diff] [blame] | 84 | "MAKE_VERSION?=3.81\n" |
Shinichiro Hamaji | cdcd419 | 2015-09-04 10:06:30 +0900 | [diff] [blame] | 85 | "KATI?=ckati\n" |
Shinichiro Hamaji | 91d1249 | 2015-09-04 09:54:48 +0900 | [diff] [blame] | 86 | // Overwrite $SHELL environment variable. |
| 87 | "SHELL=/bin/sh\n" |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 88 | // TODO: Add more builtin vars. |
| 89 | |
| 90 | // http://www.gnu.org/software/make/manual/make.html#Catalogue-of-Rules |
| 91 | // The document above is actually not correct. See default.c: |
| 92 | // http://git.savannah.gnu.org/cgit/make.git/tree/default.c?id=4.1 |
| 93 | ".c.o:\n" |
| 94 | "\t$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $<\n" |
| 95 | ".cc.o:\n" |
| 96 | "\t$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $<\n" |
| 97 | // TODO: Add more builtin rules. |
| 98 | ); |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 99 | if (g_flags.generate_ninja) { |
Shinichiro Hamaji | b6a0454 | 2015-09-09 17:37:41 +0900 | [diff] [blame] | 100 | bootstrap += StringPrintf("MAKE?=make -j%d\n", |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 101 | g_flags.num_jobs < 1 ? 1 : g_flags.num_jobs / 2); |
Shinichiro Hamaji | b6a0454 | 2015-09-09 17:37:41 +0900 | [diff] [blame] | 102 | } else { |
| 103 | bootstrap += StringPrintf("MAKE?=%s\n", |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 104 | JoinStrings(g_flags.subkati_args, " ").c_str()); |
Shinichiro Hamaji | b6a0454 | 2015-09-09 17:37:41 +0900 | [diff] [blame] | 105 | } |
Shinichiro Hamaji | cdcd419 | 2015-09-04 10:06:30 +0900 | [diff] [blame] | 106 | bootstrap += StringPrintf("MAKECMDGOALS?=%s\n", |
Shinichiro Hamaji | e799275 | 2015-06-29 18:38:35 +0900 | [diff] [blame] | 107 | JoinSymbols(targets, " ").c_str()); |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 108 | |
| 109 | char cwd[PATH_MAX]; |
| 110 | if (!getcwd(cwd, PATH_MAX)) { |
| 111 | fprintf(stderr, "getcwd failed\n"); |
| 112 | CHECK(false); |
| 113 | } |
| 114 | bootstrap += StringPrintf("CURDIR:=%s\n", cwd); |
Shinichiro Hamaji | e799275 | 2015-06-29 18:38:35 +0900 | [diff] [blame] | 115 | Parse(Intern(bootstrap).str(), Loc("*bootstrap*", 0), asts); |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 116 | } |
| 117 | |
Shinichiro Hamaji | f62e9a7 | 2015-06-26 04:18:21 +0900 | [diff] [blame] | 118 | static void SetVar(StringPiece l, VarOrigin origin, Vars* vars) { |
Shinichiro Hamaji | 9db4cb8 | 2015-06-22 16:51:04 +0900 | [diff] [blame] | 119 | size_t found = l.find('='); |
| 120 | CHECK(found != string::npos); |
Shinichiro Hamaji | e799275 | 2015-06-29 18:38:35 +0900 | [diff] [blame] | 121 | Symbol lhs = Intern(l.substr(0, found)); |
Shinichiro Hamaji | 9db4cb8 | 2015-06-22 16:51:04 +0900 | [diff] [blame] | 122 | StringPiece rhs = l.substr(found + 1); |
Shinichiro Hamaji | 81699be | 2015-06-22 18:07:38 +0900 | [diff] [blame] | 123 | vars->Assign(lhs, |
| 124 | new RecursiveVar(NewLiteral(rhs.data()), origin, rhs.data())); |
Shinichiro Hamaji | 9db4cb8 | 2015-06-22 16:51:04 +0900 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | extern "C" char** environ; |
Shinichiro Hamaji | 9db4cb8 | 2015-06-22 16:51:04 +0900 | [diff] [blame] | 128 | |
Shinichiro Hamaji | e799275 | 2015-06-29 18:38:35 +0900 | [diff] [blame] | 129 | static int Run(const vector<Symbol>& targets, |
Shinichiro Hamaji | 998ccf7 | 2015-07-18 12:37:02 +0900 | [diff] [blame] | 130 | const vector<StringPiece>& cl_vars, |
| 131 | const string& orig_args) { |
Shinichiro Hamaji | 90db541 | 2015-08-13 15:03:52 +0900 | [diff] [blame] | 132 | double start_time = GetTime(); |
| 133 | |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 134 | if (g_flags.generate_ninja && (g_flags.regen || g_flags.dump_kati_stamp)) { |
Shinichiro Hamaji | f9e1524 | 2015-07-31 12:50:06 +0900 | [diff] [blame] | 135 | ScopedTimeReporter tr("regen check time"); |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 136 | if (!NeedsRegen(g_flags.ninja_suffix, g_flags.ninja_dir, |
| 137 | g_flags.regen_ignoring_kati_binary, |
| 138 | g_flags.dump_kati_stamp, |
Dan Willemsen | 8741741 | 2015-08-24 17:57:12 -0700 | [diff] [blame] | 139 | start_time, orig_args)) { |
Shinichiro Hamaji | f6df334 | 2015-08-11 14:59:36 +0900 | [diff] [blame] | 140 | printf("No need to regenerate ninja file\n"); |
| 141 | return 0; |
| 142 | } |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 143 | if (g_flags.dump_kati_stamp) { |
Shinichiro Hamaji | f6df334 | 2015-08-11 14:59:36 +0900 | [diff] [blame] | 144 | printf("Need to regenerate ninja file\n"); |
Shinichiro Hamaji | a4bb774 | 2015-07-31 11:27:30 +0900 | [diff] [blame] | 145 | return 0; |
| 146 | } |
Shinichiro Hamaji | a09ed28 | 2015-07-31 12:21:54 +0900 | [diff] [blame] | 147 | ClearGlobCache(); |
Shinichiro Hamaji | a4bb774 | 2015-07-31 11:27:30 +0900 | [diff] [blame] | 148 | } |
| 149 | |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 150 | MakefileCacheManager* cache_mgr = NewMakefileCacheManager(); |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 151 | |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 152 | Vars* vars = new Vars(); |
Shinichiro Hamaji | 91d1249 | 2015-09-04 09:54:48 +0900 | [diff] [blame] | 153 | for (char** p = environ; *p; p++) { |
| 154 | SetVar(*p, VarOrigin::ENVIRONMENT, vars); |
| 155 | } |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 156 | Evaluator* ev = new Evaluator(vars); |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 157 | |
| 158 | vector<AST*> bootstrap_asts; |
| 159 | ReadBootstrapMakefile(targets, &bootstrap_asts); |
| 160 | ev->set_is_bootstrap(true); |
| 161 | for (AST* ast : bootstrap_asts) { |
| 162 | LOG("%s", ast->DebugString().c_str()); |
| 163 | ast->Eval(ev); |
| 164 | } |
| 165 | ev->set_is_bootstrap(false); |
| 166 | |
Shinichiro Hamaji | 91d1249 | 2015-09-04 09:54:48 +0900 | [diff] [blame] | 167 | for (StringPiece l : cl_vars) { |
| 168 | SetVar(l, VarOrigin::COMMAND_LINE, ev->mutable_vars()); |
| 169 | } |
| 170 | |
Shinichiro Hamaji | e799275 | 2015-06-29 18:38:35 +0900 | [diff] [blame] | 171 | vars->Assign(Intern("MAKEFILE_LIST"), |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 172 | new SimpleVar(StringPrintf(" %s", g_flags.makefile), |
Shinichiro Hamaji | 5081c71 | 2015-08-14 16:49:20 +0900 | [diff] [blame] | 173 | VarOrigin::FILE)); |
Shinichiro Hamaji | b74b890 | 2015-06-22 18:22:30 +0900 | [diff] [blame] | 174 | |
Shinichiro Hamaji | 54e52dd | 2015-06-27 17:14:06 +0900 | [diff] [blame] | 175 | { |
| 176 | ScopedTimeReporter tr("eval time"); |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 177 | Makefile* mk = cache_mgr->ReadMakefile(g_flags.makefile); |
Shinichiro Hamaji | 54e52dd | 2015-06-27 17:14:06 +0900 | [diff] [blame] | 178 | for (AST* ast : mk->asts()) { |
| 179 | LOG("%s", ast->DebugString().c_str()); |
| 180 | ast->Eval(ev); |
| 181 | } |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 182 | } |
| 183 | |
Shinichiro Hamaji | a06bee9 | 2015-08-05 17:13:05 +0900 | [diff] [blame] | 184 | for (ParseErrorAST* err : GetParseErrors()) { |
| 185 | WARN("%s:%d: warning for parse error in an unevaluated line: %s", |
| 186 | LOCF(err->loc()), err->msg.c_str()); |
| 187 | } |
| 188 | |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 189 | vector<DepNode*> nodes; |
Shinichiro Hamaji | 54e52dd | 2015-06-27 17:14:06 +0900 | [diff] [blame] | 190 | { |
| 191 | ScopedTimeReporter tr("make dep time"); |
| 192 | MakeDep(ev, ev->rules(), ev->rule_vars(), targets, &nodes); |
| 193 | } |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 194 | |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 195 | if (g_flags.is_syntax_check_only) |
Shinichiro Hamaji | ed883ef | 2015-07-31 13:15:04 +0900 | [diff] [blame] | 196 | return 0; |
| 197 | |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 198 | if (g_flags.generate_ninja) { |
Shinichiro Hamaji | ed883ef | 2015-07-31 13:15:04 +0900 | [diff] [blame] | 199 | ScopedTimeReporter tr("generate ninja time"); |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 200 | GenerateNinja(g_flags.ninja_suffix, g_flags.ninja_dir, |
| 201 | nodes, ev, !targets.empty(), |
Shinichiro Hamaji | ed883ef | 2015-07-31 13:15:04 +0900 | [diff] [blame] | 202 | orig_args, start_time); |
| 203 | return 0; |
| 204 | } |
| 205 | |
Shinichiro Hamaji | 45a0c76 | 2015-06-26 06:47:10 +0900 | [diff] [blame] | 206 | for (const auto& p : ev->exports()) { |
Shinichiro Hamaji | e799275 | 2015-06-29 18:38:35 +0900 | [diff] [blame] | 207 | const Symbol name = p.first; |
Shinichiro Hamaji | 45a0c76 | 2015-06-26 06:47:10 +0900 | [diff] [blame] | 208 | if (p.second) { |
| 209 | Var* v = ev->LookupVar(name); |
Shinichiro Hamaji | fb415ad | 2015-08-14 17:19:34 +0900 | [diff] [blame] | 210 | const string&& value = v->Eval(ev); |
| 211 | LOG("setenv(%s, %s)", name.c_str(), value.c_str()); |
| 212 | setenv(name.c_str(), value.c_str(), 1); |
Shinichiro Hamaji | 45a0c76 | 2015-06-26 06:47:10 +0900 | [diff] [blame] | 213 | } else { |
| 214 | LOG("unsetenv(%s)", name.c_str()); |
| 215 | unsetenv(name.c_str()); |
| 216 | } |
| 217 | } |
| 218 | |
Shinichiro Hamaji | 54e52dd | 2015-06-27 17:14:06 +0900 | [diff] [blame] | 219 | { |
| 220 | ScopedTimeReporter tr("exec time"); |
| 221 | Exec(nodes, ev); |
| 222 | } |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 223 | |
Shinichiro Hamaji | 0e74c54 | 2015-06-22 16:17:08 +0900 | [diff] [blame] | 224 | for (AST* ast : bootstrap_asts) |
| 225 | delete ast; |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 226 | delete ev; |
| 227 | delete vars; |
| 228 | delete cache_mgr; |
| 229 | |
Shinichiro Hamaji | 64cd806 | 2015-06-27 16:58:36 +0900 | [diff] [blame] | 230 | return 0; |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | int main(int argc, char* argv[]) { |
| 234 | Init(); |
Shinichiro Hamaji | 998ccf7 | 2015-07-18 12:37:02 +0900 | [diff] [blame] | 235 | string orig_args; |
| 236 | for (int i = 0; i < argc; i++) { |
| 237 | if (i) |
| 238 | orig_args += ' '; |
| 239 | orig_args += argv[i]; |
| 240 | } |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 241 | g_flags.Parse(argc, argv); |
| 242 | if (g_flags.makefile == NULL) |
Shinichiro Hamaji | e4ee8ea | 2015-08-15 01:22:23 +0900 | [diff] [blame] | 243 | ERROR("*** No targets specified and no makefile found."); |
Shinichiro Hamaji | 5f57a99 | 2015-06-30 19:39:39 +0900 | [diff] [blame] | 244 | // This depends on command line flags. |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 245 | if (g_flags.use_find_emulator) |
Shinichiro Hamaji | 4e950e6 | 2015-07-02 02:59:55 +0900 | [diff] [blame] | 246 | InitFindEmulator(); |
Shinichiro Hamaji | 003d06e | 2015-09-09 18:22:04 +0900 | [diff] [blame^] | 247 | int r = Run(g_flags.targets, g_flags.cl_vars, orig_args); |
Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame] | 248 | Quit(); |
| 249 | return r; |
| 250 | } |