This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fw: adding a path to include search path


Hi Darius,

>Is there also a way to get the directory where the makefile resides in the makefile itself??

Put these two lines in the makefile:

CC  := gcc -idirafter $(shell pwd)
CXX := g++ -idirafter $(shell pwd)

That assumes the current working directory is the directory where the makefile is located.  (Possibly not always the situation, I suppose.)

You may need to do some string manipulation work with $(MAKEFILE_LIST) variable, if the $(shell pwd) isn't enough.

HTH,
--Eljay



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]