Csound Csound-dev Csound-tekno Search About

[Csnd] Makefile strangeness [OT]

Date2009-11-09 18:01
FromTobiah
Subject[Csnd] Makefile strangeness [OT]
This makefile works as expected, but it always
automatically executes an:

       rm some.sco

for each score file made.  Does anyone know why Make would
do that?

What's strange is that it doesn't really hurt the build process.
I never touch the .sco files directly, although touching the
orchestra does cause the score to be generated again, which
for very large scores can be time consuming in itself.

Thanks,

Tobiah

#############

CSFLAGS = -dRW

all: master.wav
        echo

master.wav: slide.wav piano.wav
        echo

%.wav: %.orc %.sco orc_header
        csound $(CSFLAGS) $*.orc $*.sco -o $@

%.sco: %.py
        python $< > $@


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-09 23:32
FromAlan Peter Fitch
Subject[Csnd] Re: Makefile strangeness [OT]
Tobiah wrote:
> This makefile works as expected, but it always
> automatically executes an:
> 
>        rm some.sco
> 
> for each score file made.  Does anyone know why Make would
> do that?
> 
> What's strange is that it doesn't really hurt the build process.
> I never touch the .sco files directly, although touching the
> orchestra does cause the score to be generated again, which
> for very large scores can be time consuming in itself.
> 
> Thanks,
> 
> Tobiah
> 
> #############
> 
> CSFLAGS = -dRW
> 
> all: master.wav
>         echo
> 
> master.wav: slide.wav piano.wav
>         echo
> 
> %.wav: %.orc %.sco orc_header
>         csound $(CSFLAGS) $*.orc $*.sco -o $@
> 
> %.sco: %.py
>         python $< > $@
>
> 

I don't see an rm command in your Makefile, which seems odd.

Have you tried running with make -d ?

That should tell you exactly what is happening,

Or is it something to do with --keep-sorted-score??

regards
Alan

Date2009-11-10 00:49
FromTobiah
Subject[Csnd] Re: Re: Makefile strangeness [OT]
As it turns out, GNU Make has an idea of 'intermediate' files.  Make
realized that .sco files only exist if the .py score generators make them.
If the intermediate file does not exist when Make is run, then it keeps things
that way, and automatically removes them after their use.  This might have
made sense 20 years ago, when disk space actually mattered.  As it is, the
behavior is flawed in my opinion.  In my Makefile, touching an orchestra
means rebuilding the .wav file, which invokes the score generation program
only because Make has so helpfully removed my .sco file.  Lame.

I found out that adding the line:

.PRECIOUS: %.sco

solves the problem.

Sorry for not having googled extensively before asking the question.

Thanks,

Tobiah


On Mon, Nov 9, 2009 at 3:32 PM, Alan Peter Fitch  wrote:
> Tobiah wrote:
>> This makefile works as expected, but it always
>> automatically executes an:
>>
>>        rm some.sco
>>
>> for each score file made.  Does anyone know why Make would
>> do that?
>>
>> What's strange is that it doesn't really hurt the build process.
>> I never touch the .sco files directly, although touching the
>> orchestra does cause the score to be generated again, which
>> for very large scores can be time consuming in itself.
>>
>> Thanks,
>>
>> Tobiah
>>
>> #############
>>
>> CSFLAGS = -dRW
>>
>> all: master.wav
>>         echo
>>
>> master.wav: slide.wav piano.wav
>>         echo
>>
>> %.wav: %.orc %.sco orc_header
>>         csound $(CSFLAGS) $*.orc $*.sco -o $@
>>
>> %.sco: %.py
>>         python $< > $@
>>
>>
>
> I don't see an rm command in your Makefile, which seems odd.
>
> Have you tried running with make -d ?
>
> That should tell you exactly what is happening,
>
> Or is it something to do with --keep-sorted-score??
>
> regards
> Alan
>
>
> --
> Alan Fitch
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"