Build directory and make depend

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?

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

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

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

Hello,

We have added these options to our 14.1 release.

thanks,
dave