>CXX = g++ >foo.o : foo.cc foo.h.gch ><tab>$(CXX) -c $< >foo.h.gch: foo.h ><tab>$(CXX) -c $< Interesting... So these lines should create foo.h.gch? I will work on it Tom Browder wrote: > > On Dec 5, 2007 1:44 AM, mahmoodn <nt_mahmood@xxxxxxxxx> wrote: >> >> For example look at this paragraph in that link: >> >> >To create a precompiled header file, simply compile it as you would any >> other file, if necessary using the -x option to make >the driver treat it >> as >> a C or C++ header file. You will probably want to use a tool like make to >> keep the precompiled header >up-to-date when the headers it contains >> change. >> >> I can not understand it. My little understanding is, I just use normal >> "make" for the first time. Then the compiler would create some >> precompiled >> headers. After doing this, I could not find ant gch file for precompiled >> header. > > No, it won't do it automaticalyy. You have to modify your Makefile a > little. Say we have foo.cc and its header, foo.h, then something like > this in the Makefile should work: > > CXX = g++ > > foo.o : foo.cc foo.h.gch > <tab>$(CXX) -c $< > > foo.h.gch: foo.h > <tab>$(CXX) -c $< > > -Tom > > Tom Browder > Niceville, Florida > USA > > -- View this message in context: http://www.nabble.com/reduce-compilation-times--tf4880765.html#a14168961 Sent from the gcc - Help mailing list archive at Nabble.com.