lindenb / makefile2graph

Creates a graph of dependencies from GNU-Make; Output is a graphiz-dot file or a Gexf-XML file.
MIT License
617 stars 63 forks source link

Escape " in target labels for dot output #21

Closed dholl closed 6 years ago

dholl commented 6 years ago

make was putting double quotes around some of my target labels, which were not being escaped when output to dot format, such as "/home/some_path/src/lnx//../.."/bin/lxbin should be output as

digraph G {
n72[label="\"/home/some_path/src/lnx//../..\"/bin/lxbin", color="red"];
...

Without this fix, the output from make2graph is:

digraph G {
n72[label=""/home/some_path/src/lnx//../.."/bin/lxbin", color="red"];
...

which causes dot to complain and not create any output:

Warning: <stdin>: syntax error in line 2 near '/'
lindenb commented 6 years ago

👍 thanks.