Re: any examples of GNU Makefile dependencies?

From: Dan Bonachea (bonachea_at_cs_dot_berkeley_dot_edu)
Date: Sat Nov 26 2005 - 18:41:57 PST

  • Next message: jcduell_at_lbl_dot_gov: "Re: any examples of GNU Makefile dependencies?"
    At 08:05 AM 11/26/2005, Steve Reinhardt wrote:
    >Hi all,
    >         I'm modifying a frequent subgraph code to use UPC.  It uses GNU make 
    > to build it.  I'm not finding any examples of how to automatically create 
    > dependencies for .upc files.  Does somebody have an example of that?  Thanks.
    >                                                         Steve
    
    Interesting question...
    
    We've never considered this specific need before in Berkeley UPC, but I 
    believe you can accomplish the required behavior using the upcc -Wp, option, 
    which passes arbitrary arguments to the preprocessor.
    
    So for example, you could do something like this to generate dependencies on a 
    BUPC install with gcc as the backend compiler:
    
    upcc -Wp,-M -E hello.upc
    
    Note that Berkeley UPC renames *.upc to *.c before preprocessing, so you may 
    need to replace "hello.c" with "hello.upc" in the output to get the proper 
    behavior. We also tack on an initial #line directive to every -E compilation. 
    You can take care of both problems with something like:
    
    upcc -Wp,-M -E hello.upc | perl -pe 's/^#\s*line.*$//;s/: (\S+).c/: $1.upc/'
    
    
    Hope this helps...
    Dan
    

  • Next message: jcduell_at_lbl_dot_gov: "Re: any examples of GNU Makefile dependencies?"