Build tools.
    Frits van Bommel 
    fvbommel at REMwOVExCAPSs.nl
       
    Sat Oct 13 02:47:03 PDT 2007
    
    
  
Alexander Panek wrote:
> The easiest way to achieve the imports/dependencies is to parse the 
> output of `dmd -v file1.d file2.d', and grep for "^semantic <fileX>" + 
> following "^import".. just take a look yourself, I'm sure it's easier 
> than using the frontend itself.
Why would you look at the semantic lines instead of the import & file 
lines? They don't give you all files a module depends on and they only 
give module names (not filenames).
On the other hand, the import & file lines give you all imported modules 
(transitively) and all import()ed files, with the full filename for each 
given between brackets at the end of the line.
When I needed to automatically generate dependencies (from a makefile), 
I grepped the output for lines beginning with 'import' or 'file' when I 
passed '-c -o- -v' to the compiler (as well as the normal include flags 
etc.).
(-c makes sure this doesn't generate an executable and -o- stops 
generation of object files)
    
    
More information about the Digitalmars-d
mailing list