PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Build directory and make depend

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
tttttttttt



Joined: 08 May 2012
Posts: 3

PostPosted: Thu Jun 14, 2012 1:46 am    Post subject: Build directory and make depend Reply with quote

Is there an option to either a) make pgcc -M include a $(BUILDDIR) prefix for each target?, or b) make it print the standard include path, so one can easily just use 'makedepend' in makefiles?
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6142
Location: The Portland Group Inc.

PostPosted: Thu Jun 14, 2012 9:37 am    Post subject: Reply with quote

Quote:
or b) make it print the standard include path, so one can easily just use 'makedepend' in makefiles?
I'm not sure what you mean by "standard include path". Do you mean how do I add the full path to my header files?

The "-M" flag will print the path where it found the header file. If it's a system file, then it will print the full path the file. If it's found via the "-I" then the path will be the same as this path. So if you have "-Iinclude", the files will be listed as "include/myheader.h". If it's "-I/full/path/include", then the files will be listed as "/full/path/include/myheader.h". After the ful lpath is used, you can then do a find and replace to change "/full/path" to "$(BUILDDIR)".

Hope this helps,
Mat
Back to top
View user's profile
tttttttttt



Joined: 08 May 2012
Posts: 3

PostPosted: Thu Jun 14, 2012 9:43 am    Post subject: Reply with quote

pgcc -M foo.c will write dependencies of the form

foo.o: foo.c bar.h

But I prefer that the object files go in a build directory, so my build command is

pgcc -c foo.c -o $(BUILDDIR)/foo.o

Therefore I would like a dependency of the form

$(BUILDDIR)/foo.o: foo.c bar.h
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6142
Location: The Portland Group Inc.

PostPosted: Thu Jun 14, 2012 10:13 am    Post subject: Reply with quote

Aaah. You're looking for cpp's -MT option. Sorry no we don't support that option, but I just added a feature request (TPR#18772) to add the -MT and -MQ options. In the mean time, can you use cpp?

- Mat
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 440

PostPosted: Fri Jan 24, 2014 5:58 pm    Post subject: TPR 18772 - Feature Rqst: Add cpp's "-MT" and &quo Reply with quote

Hello,

We have added these options to our 14.1 release.

thanks,
dave
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group