lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about autocompile bash script


From: Yann
Subject: Re: Question about autocompile bash script
Date: Tue, 10 Sep 2013 12:19:14 +0200

Hello all :)

Just my 2cts contribution : I also had the same kind of requirement
(for an hymnbook project), only difference is I use a mercurial
repository instead of dropbox. When pushing changes to the repository,
it launches a command in bash (with a hook) running make in every
directory where a makefile exists.

The command for this is quite simple and just :
find <path_to_directory> -type f -name 'Makefile' -execdir make \;

Then I have a series of makefiles tailored to do what I want. Most of
the dependencies are deduced directly from the \include directives in
the main files (plus some other fixed depending on hymn template).
File structure is also scattered (different versions with common
parts, lyrics, melody, chords, voices...)

So what happens is that every time changes are pushed on the server,
make is called for each song, but exits quickly when no changes are
found and only launches lilypond if necessary.

I can give those makefiles if one is interested.

Yann


> Message: 7
> Date: Tue, 10 Sep 2013 11:22:24 +0200
> From: immanuel litzroth <address@hidden>
> To: Jacques Menu <address@hidden>
> Cc: ArnoldTheresius <address@hidden>, lilypond-user
>         <address@hidden>
> Subject: Re: Question about autocompile bash script
> Message-ID:
>         <address@hidden>
> Content-Type: text/plain; charset="iso-8859-1"
>
> If there were some kind of make-dep for lilypond it could even generate
> these dependencies
> automaticaly, like it happens for C (the compiler generates dependencies
> when passed the
> correct flags). This should not be too hard to brew up?
> Immanuel
>
>
> On Tue, Sep 10, 2013 at 10:47 AM, Jacques Menu <address@hidden>wrote:
>
> > Hello Carl,
> >
> > An approach could be to create a makefile containing:
> >         - the rules to compile LP files to PDF (fixed part);
> >         - the dependencies among LP files reflecting the presence of
> > \include in them (variable part).
> >
> > Producing the makefile could be done by a script when your dropbox
> > changes, and you could then call "make" to compile whatever needs to be.
> >
> > JM
> >
> > Le 10 sept. 2013 ? 10:04:54, ArnoldTheresius <address@hidden> a
> > ?crit :
> >
> > > Carl Peterson-2 wrote
> > >> Question for those who are familiar with linux bash shell scripting...
> > >>
> > >> ...
> > >>
> > >> The question I have is whether it is possible to set up a similar script
> > >> to
> > >> "trace" a file's inclusion in other lilypond files and then compile
> > >> whenever an upstream file is loaded. My template/framework for hymn
> > >> settings uses discrete levels of file inclusions.
> > >> ...
> > >> Thanks,
> > >> Carl
> > >>
> > >> _______________________________________________
> > >> lilypond-user mailing list
> > >
> > >> lilypond-user@
> > >
> > >> https://lists.gnu.org/mailman/listinfo/lilypond-user
> > >
> > > I allready made a C program for Windows, which does a limited 'follow the
> > > \include files' to examine the file dates. Finally it starts lilypond
> > > (command line) if one of the source files found is newer than the
> > resulting
> > > PDF, otherwise it prompts for the question 'compile or not?'.
> > > This program is limited to
> > > - only files (source and result) in the current working directory are
> > > examined
> > > - the \include command must be the only one in the line (white space only
> > > allowed at the left), exactly one space to the string start '"' character
> > > - \include commands inside a comment block ( '%{' to '%}' ) will be
> > > examined, too.
> > >
> > > Unfortunately, this program is specialized for my use. I did try (but not
> > > complete) to implement some special features. There is very little
> > > documentation in the source code.
> > > Only if you have some experiance in C programming the source code can
> > help -
> > > but an experianced C programmer might be faster to build his own
> > 'ly-newer'
> > > command line program form scratch than by extending my program.
> > >
> > > Feel free to ask for the C source code, if you are still interested.
> > >
> > > ArnoldTheresius
> > >
> > >
> > >



reply via email to

[Prev in Thread] Current Thread [Next in Thread]