Re: Reusable source code
- From: Niklas Holsti <niklas.holsti@xxxxxxxxxxxxxxx>
- Date: Tue, 07 Sep 2010 13:54:13 +0300
James Dow Allen wrote:
On Sep 7, 1:17 pm, Nick <3-nos...@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:You'll end up with sub-directories and fancy make files
ln sallysort.h qspecif.h
cc -O -c -o sallysort.o qvariant.c
Much simpler than many makefiles.
Well yes, but you won't be able to run a parallel make if there are several instances of qvariant. I think it would be better to use an instance-specific subdirectory, say sallysort/qspecif.h, and a -I option on the "cc".
Alternatively, use a macro processor (perhaps even the C preprocessor) to generate sallysort.c from qvariant.c and sallysort.h, then compile.
That said, I do think that James' suggestion can be useful to configure and reuse C source code, or code in other languages (where it may be necessary to separate the macro expansion step from the compilation step).
niklas holsti tidorum fi
. @ .
- Prev by Date: Re: Reusable source code
- Next by Date: Re: Reusable source code
- Previous by thread: Re: Reusable source code
- Next by thread: Re: Reusable source code