On Fri, 28 Apr 2000, Martin Sander wrote:
> Laurent Martelli wrote:
> >
> > >>>>> "Harti" == Harti Brandt <[EMAIL PROTECTED]> writes:
> > Harti> Well, do it the UNIX-way: don't invent the wheel, if there
> > Harti> are already dozens out there. I use:
> >
> > Harti> gcc -E -P -nostdinc -x c -traditional
> >
> > Of course !!! How come I did not think about it ? ;-\
> >
>
> I am awfully sorry, but I do _not_ understand this line. May I, please,
> get some explanation (for the poor)?
>
> Thanks in advance
No problem:
gcc - is the GNU C compiler (if you know C, then you know, that C files
are pre-processed with the preprocessor - and that's what we
need)
-E tells the compiler to run ONLY the pre-processor
-P tells the pre-processor not to emit '# line' lines (these tell later
compiler stages, the line numbers of the original file. These are
needed for error messages and debugging information)
-nostdinc tells gcc to forget the standard include paths like
/usr/include
-x c tells the compiler to assume, that input files are C-files
independend of their extension
-traditional changes the syntax in some places (most notably parameter
substitution in strings)
So you can do the following:
gcc .... -DTEMPO=120 -DOBOE score.ply >score.ly
and in score.ply you may have:
# ifndef TEMPO
# define TEMPO 100
# endif
....
# ifdef OBOE
\score {
% score block for oboe
\midi {
tempo = TEMPO;
}
}
# endif
# ifdef RIDGE
\score {
% score block for ridge
}
# endif
...
harti
PS: if you are running Windooze... well, there are gcc's for windooze i
suppose.
--
harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private
[EMAIL PROTECTED], [EMAIL PROTECTED]