Bob Tennent wrote:
>  >|>... I wouldn't think that Windows users would  >|>have any interest
> in constructing mtxdoc.pdf from scratch.
>  >|
>  >|I've been responsible for creating extensive revisions of musixdoc,
> >|which is  >|a more complex document than mtxdoc, and I did all the work
> in  >|Windows. So I  >|have more than a passing interest in learning as
> much as I can about the  >|process. And one thing I've learned is that
> the process can be simpler and  >|the files required much less numerous
> if you just embed the musical  >|examples  >|in the document, much less
> breaking individual examples into more than one  >|file each.
> 
> Don: I wasn't thinking of you as the typical "Windows user". If you just
> want to learn about how Dirk sets up his compilation, that's fine. But
> you might want to ask Dirk why he set it up the way he did.

make (or derivatives) is the only logical system to use for the build system of 
code-based projects - the difference between make and a shell script is that 
make only rebuilds files which need to be rebuilt (so, for example, if you 
changed mtxdoc.tex, Dirk's Makefile would not rebuild all of the examples from 
the .mta and .mtb files and if you changed just one .mta or .mtb file then it 
would only rebuild the examples which depend on that specific file, not all of 
them). While the difference is irrelevant if you're building a project from 
scratch (i.e. for a deployment/installation script), that's very useful when 
you're actually working on it as you don't have to recompile absolutely 
everything each time you want to see a change.

> >|>And if this is considered important for some reason, a batch file
> >|>isn't the right way to do it.
> >|
> >|I'm puzzled why you would say that, partly because I don't think you
> >|mean "Why waste the effort on writing a batch script if you're only
> >|going to do the compilation once or twice". The response by David
> >|seems to show how to fill in the pieces.
> 
> 
> The problem with a batch script is that, like a Makefile, it's platform
> dependent.

Incorrect - GNU make is *extremely* cross-platform, by design - the caveat is 
that you have to write your Makefiles in a cross-platform way. Similarly, it's 
quite easy to write platform-dependent Lua scripts - it's what you write, not 
what you write it in that creates the problem.

> Instead of trying to emulate the Makefile in Windows, we
> should be replacing it by a platform-independent script in Lua. (This is
> similar to what's been done with musixflx: we no longer need to compile
> separate binaries for Window, Macs, Linux, Solaris, etc. because
> musixflx.lua will work everywhere.) I don't think every mtx user will
> want to re-build mtxdoc.pdf for themselves so this isn't high priority.
> And it's really Dirk's problem, because it's his document.

The only big (Windows) problem with the Makefile is the use of ln which, 
despite proper underlying support in Windows Vista onwards is an awkward 
command because it requires an elevated command prompt to use it. make is 
trivially easy to install - you install 
http://gnuwin32.sourceforge.net/downlinks/make.php and then 
http://gnuwin32.sourceforge.net/downlinks/coreutils.php as this gives you 
Windows versions of commands like cp (the equivalent of copy) and rm (the 
equivalent of del), etc. GNU make itself is just one .exe and two supporting 
.dlls (i.e. you do not have to install a monster like Cygwin in order to get 
it).

Although my personal preference is to install Unix utilities on Windows (as 
they're generally superior to the equivalent Windows commands), it's also 
possible to write your Makefile to detect Windows and adapt the commands it 
uses accordingly.

This is getting a bit off-topic - it's just that seeing a relatively new 
poster-child (Lua in this case) being over-touted to solve problems already 
dealt with by a much older and better-suited tool tends to hit a nerve! Lua is 
a very good idea for replacing shell scripts and auxiliary programs (i.e. 
musixflx, makeindex, etc.), but not build systems.


David

-------------------------------
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music

Reply via email to