This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Template
- From: Matthias Oltmanns <Mathias dot Oltmanns dot Oltmanns at sysde dot eads dot net>
- To: Eduardo Cesar Cabrera Flores <eccf at super dot unam dot mx>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 31 Mar 2003 15:30:10 +0200
- Subject: Re: Template
- References: <Pine.BSO.4.33.0303281812080.4255-100000@mezcal.super.unam.mx>
Am Fre, 2003-03-28 um 19.15 schrieb Eduardo Cesar Cabrera Flores:
>
> compiling that way a template example the compiler compiles the whole
> program not only the main
>
> >g++ -o testCounter.o -c -frepo -fno-implicit-templates testCounter.cc
>
> >g++ -o testCounter testCounter.o
> >collect: recompiling testCounter.cc
> >collect: relinking
>
> i'm trying to compile with a makefile to compile only those files that
> were modified!
>
> Any idea how to do this with a makefile??
>
Hi Eduardo,
i'm not sure if you asking for "How to write a makefile". If so i would
suggest to read first info-pages via "info make".
The small example i send, used already two phases of building. First
compilation of (one) source file. In more real-life projects there are
more source files to compile. Note: you must not compile the template
definition files, even if they end with .cc (or .C). You should treat
template definition files as header files (included from your template
declaration files).
The second phase is linking the program, as indicated by the second run
of g++ in the example.
With some knowledge about makefiles it should be straigt forward to
compile your sources (with templates).
If i miss your point ... sorry. Don't heasetate to ask again.
cu
Matthias
> cafe
>
>
>
>
>
>
--
Matthias Oltmanns
Tel: 04421-1543-274
mail: Mathias dot Oltmanns dot Oltmanns at sysde dot eads dot net
- References:
- Template
- From: Eduardo Cesar Cabrera Flores