| 312 | } |
| 313 | |
| 314 | static void makeMatchcompiler(std::ostream& fout, const std::string& toolsPrefix, std::string args) |
| 315 | { |
| 316 | if (!args.empty()) |
| 317 | args = " " + args; |
| 318 | |
| 319 | // avoid undefined variable |
| 320 | fout << "ifndef MATCHCOMPILER\n" |
| 321 | << " MATCHCOMPILER=\n" |
| 322 | << "endif\n"; |
| 323 | // TODO: bail out when matchcompiler.py fails (i.e. invalid PYTHON_INTERPRETER specified) |
| 324 | // TODO: handle "PYTHON_INTERPRETER=" |
| 325 | // use match compiler.. |
| 326 | fout << "# use match compiler\n"; |
| 327 | fout << "ifeq ($(MATCHCOMPILER),yes)\n" |
| 328 | << " # Find available Python interpreter\n" |
| 329 | << " ifeq ($(PYTHON_INTERPRETER),)\n" |
| 330 | << " PYTHON_INTERPRETER := $(shell which python3)\n" |
| 331 | << " endif\n" |
| 332 | << " ifeq ($(PYTHON_INTERPRETER),)\n" |
| 333 | << " PYTHON_INTERPRETER := $(shell which python)\n" |
| 334 | << " endif\n" |
| 335 | << " ifeq ($(PYTHON_INTERPRETER),)\n" |
| 336 | << " $(error Did not find a Python interpreter)\n" |
| 337 | << " endif\n" |
| 338 | << " ifdef VERIFY\n" |
| 339 | << " matchcompiler_S := $(shell $(PYTHON_INTERPRETER) " << toolsPrefix << "tools/matchcompiler.py" << args << " --verify)\n" |
| 340 | << " else\n" |
| 341 | << " matchcompiler_S := $(shell $(PYTHON_INTERPRETER) " << toolsPrefix << "tools/matchcompiler.py" << args << ")\n" |
| 342 | << " endif\n" |
| 343 | << " libcppdir:=build\n" |
| 344 | << "else ifeq ($(MATCHCOMPILER),)\n" |
| 345 | << " libcppdir:=lib\n" |
| 346 | << "else\n" |
| 347 | << " $(error invalid MATCHCOMPILER value '$(MATCHCOMPILER)')\n" |
| 348 | << "endif\n\n"; |
| 349 | } |
| 350 | |
| 351 | static void write_ossfuzz_makefile(std::vector<std::string> libfiles_prio, std::vector<std::string> extfiles) |
| 352 | { |
no test coverage detected