Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for makefiles with VPATH #23

Open
jyn514 opened this issue Mar 25, 2019 · 0 comments
Open

Support for makefiles with VPATH #23

jyn514 opened this issue Mar 25, 2019 · 0 comments

Comments

@jyn514
Copy link

jyn514 commented Mar 25, 2019

Makefile2graph shows incorrect output for makefiles using VPATH. Example:

ake -nd --no-builtin-rules 
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Reading makefile 'Makefile'...
Updating makefiles....
 Considering target file 'Makefile'.
  Looking for an implicit rule for 'Makefile'.
  No implicit rule found for 'Makefile'.
  Finished prerequisites of target file 'Makefile'.
 No need to remake target 'Makefile'.
Updating goal targets....
Considering target file 'all'.
 File 'all' does not exist.
  Considering target file 'build/main'.
    Considering target file 'build/main.o'.
     Looking for an implicit rule for 'build/main.o'.
     Trying pattern rule with stem 'main'.
     Trying implicit prerequisite 'main.cpp'.
     Found prerequisite 'main.cpp' as VPATH 'src/main.cpp'
     Found an implicit rule for 'build/main.o'.
    No need to remake target 'build/main.o'.
   Finished prerequisites of target file 'build/main'.
   Prerequisite 'build/main.o' is older than target 'build/main'.
   Prerequisite 'build/response.o' is older than target 'build/main'.
   Prerequisite 'build/parse.o' is older than target 'build/main'.
   Prerequisite 'lib/libmagic.so' is older than target 'build/main'.
  No need to remake target 'build/main'.
 Finished prerequisites of target file 'all'.
Must remake target 'all'.
Successfully remade target file 'all'.
make: Nothing to be done for 'all'.

makefile2graph outputs

digraph G {
n2[label="all", color="red"];
n3[label="build/main", color="green"];
n4[label="build/main.o", color="green"];
n11[label="build/parse.o", color="green"];
n7[label="build/response.o", color="green"];
n14[label="lib/libmagic.so", color="green"];
n5[label="main.cpp", color="green"];
n12[label="parse.cpp", color="green"];
n10[label="parse.h", color="green"];
n8[label="response.cpp", color="green"];
n6[label="response.h", color="green"];
n13[label="src/parse.h", color="green"];
n9[label="src/response.h", color="green"];
n3 -> n2 ; 
n4 -> n3 ; 
n11 -> n3 ; 
n7 -> n3 ; 
n14 -> n3 ; 
n5 -> n4 ; 
n6 -> n4 ; 
n12 -> n11 ; 
n13 -> n11 ; 
n10 -> n7 ; 
n8 -> n7 ; 
n9 -> n7 ; 
}

At least half of those should start with src/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants