Merge branch 'koriakin/xc7nocarrymux' into xaig
[yosys.git] / kernel / driver.cc
index c539ba56976e691c039aabde3fddfeabd9943dbb..f273057dd765d4872efcfa3f38a4be92a93fceca 100644 (file)
@@ -295,6 +295,9 @@ int main(int argc, char **argv)
                printf("    -E <depsfile>\n");
                printf("        write a Makefile dependencies file with in- and output file names\n");
                printf("\n");
+               printf("    -g\n");
+               printf("        globally enable debug log messages\n");
+               printf("\n");
                printf("    -V\n");
                printf("        print version information and exit\n");
                printf("\n");
@@ -315,7 +318,7 @@ int main(int argc, char **argv)
        }
 
        int opt;
-       while ((opt = getopt(argc, argv, "MXAQTVSm:f:Hh:b:o:p:l:L:qv:tds:c:W:w:e:D:P:E:")) != -1)
+       while ((opt = getopt(argc, argv, "MXAQTVSgm:f:Hh:b:o:p:l:L:qv:tds:c:W:w:e:D:P:E:")) != -1)
        {
                switch (opt)
                {
@@ -340,6 +343,9 @@ int main(int argc, char **argv)
                case 'S':
                        passes_commands.push_back("synth");
                        break;
+               case 'g':
+                       log_force_debug++;
+                       break;
                case 'm':
                        plugin_filenames.push_back(optarg);
                        break;
@@ -523,13 +529,13 @@ int main(int argc, char **argv)
                        log_error("Can't open dependencies file for writing: %s\n", strerror(errno));
                bool first = true;
                for (auto fn : yosys_output_files) {
-                       fprintf(f, "%s%s", first ? "" : " ", fn.c_str());
+                       fprintf(f, "%s%s", first ? "" : " ", escape_filename_spaces(fn).c_str());
                        first = false;
                }
                fprintf(f, ":");
                for (auto fn : yosys_input_files) {
                        if (yosys_output_files.count(fn) == 0)
-                               fprintf(f, " %s", fn.c_str());
+                               fprintf(f, " %s", escape_filename_spaces(fn).c_str());
                }
                fprintf(f, "\n");
        }