From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10757 invoked by alias); 5 Dec 2007 10:24:17 -0000 Received: (qmail 10742 invoked by uid 22791); 5 Dec 2007 10:24:14 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.185) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 05 Dec 2007 10:24:07 +0000 Received: by nf-out-0910.google.com with SMTP id h3so4513570nfh for ; Wed, 05 Dec 2007 02:24:05 -0800 (PST) Received: by 10.86.87.5 with SMTP id k5mr315682fgb.1196850244867; Wed, 05 Dec 2007 02:24:04 -0800 (PST) Received: by 10.86.95.4 with HTTP; Wed, 5 Dec 2007 02:24:04 -0800 (PST) Message-ID: <8bc817ee0712050224m6f02caadx7ebcacbf09562ab8@mail.gmail.com> Date: Wed, 05 Dec 2007 10:24:00 -0000 From: "Tom Browder" To: mahmoodn Subject: Re: reduce compilation times? Cc: gcc-help@gcc.gnu.org In-Reply-To: <14166678.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13967871.post@talk.nabble.com> <18251.60312.968806.16303@zebedee.pink> <14104659.post@talk.nabble.com> <18260.11064.24473.345973@zebedee.pink> <14148752.post@talk.nabble.com> <8bc817ee0712040418k5ad1f313oeb0bbae689b2f27e@mail.gmail.com> <14166678.post@talk.nabble.com> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-12/txt/msg00110.txt.bz2 On Dec 5, 2007 1:44 AM, mahmoodn 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 $(CXX) -c $< foo.h.gch: foo.h $(CXX) -c $< -Tom Tom Browder Niceville, Florida USA