Template
Matthias Oltmanns
Mathias.Oltmanns.Oltmanns@sysde.eads.net
Mon Mar 31 15:07:00 GMT 2003
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.Oltmanns.Oltmanns@sysde.eads.net
More information about the Gcc-help
mailing list