The latex rule mechanisms make sure all .tex files are up to date before trying to make any real targets. Sometimes, this might be good, because the make rules might change and we might need to make something we didn't think we needed to (although this is not absolutely clear). Other times, it is bad, because when we can't make .tex files, we are unable to view files that have nothing to do with them. An extreme case is source files, which cannot be viewed in a directory with broken rules to make .tex files.
Anonymous
we have $(WW_THIS_PROJECT_SOURCE_FILES) now (https://sourceforge.net/p/workingwiki/feature-requests/54), so we should use that to distinguish .tex source files from .tex files that are intermediate targets. Or maybe rewrite the makefile some other way so that it doesn't need to.
working on this. Considering renaming the $(tex_d_files) variable to $(WW_TEX_D_FILES). That would break any existing projects that modify that variable. Is that an issue?
Dushoff says no so I think we're safe.
OK, it's changed in $(RESOURCES)/makefile-before and -after. WW now only makes .d files for .tex files that are source files (and are in the main project directory). Projects can change that behavior by changing $(WW_TEX_D_FILES).
I don't know if that actually addresses this bug report, though.
See also https://sourceforge.net/p/workingwiki/bugs/133/, which is very similar to this ticket.
From JD, reposted from https://sourceforge.net/p/workingwiki/bugs/86 to here by me:
In response to that: yes, it's because the .post.d wasn't being included. I've proposed a fix by editing that page.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I'm confused, because my indirect way of making manuscript.post.d fixed the problem with manuscript.post.pdf, so it presumably created manuscript.post.d.
In any case, while I don't understand why yours works and mine doesn't, I do agree that, given the possible jump-starting problems, yours is just as good, and therefore we can just do it that way.
JD
In regard to the main problem, which is that you can't make anything when you can't make one of the .d files, I wonder if there's a way to put some kind of failsafe into the process of making .d files itself. Something like:
so that when the .d can't be made, because the prerequisite can't be made, the inner make fails but the outer make moves along happily.
If that isn't enough because make needs the .d to exist, we could use
or something.
This is related to (but slicker than) my suggestion of a two-step make long ago.
I don't know which is slicker, but yes it does seem related, good point.
Still, though, I think it would probably be best to adopt the "advanced" strategy from http://mad-scientist.net/make/autodep.html: have the .d files made as a side effect of compiling the .tex file, and don't provide a rule to make them directly. Then everything will behave when the .tex is broken, except for actually trying to use the .tex.
See also https://sourceforge.net/p/workingwiki/bugs/261: Nested LaTeX dependencies
Last edit: Lee Worden 2013-03-13
I should really do it the way http://mad-scientist.net/make/autodep.html says, but it's confusing!
Copied over from #261:
Hmm, if we use chained rules like
(in manuscript.d)
(in content.d)
together with
(in $(RESOURCES)/makefile-after)
and abstract.tex is to be made from a .dmu file that doesn't work, then what happens? Make won't be able to make abstract.d and content.d, so the whole project will break and be unable to make anything. This is the problem of
We can get make to run by not using content.d and abstract.d (by not including them in $(WW_TEX_D_FILES)), but then the pdf file won't depend on the .dmu. But if we do include them, breaking the DMU code breaks the whole project.
So this is an argument for eliminating the %.d : %.tex, and if we switch to not using chaining:
we'll avoid the can't make problem, but we'll still have it if we try to make manuscript.pdf from manuscript.dmu. This is not actually an argument against or for chaining, but against having make update the .d files automatically. So it belongs in bug #48, not here. I'll copy it over there.
Related
Bugs:
#261Bugs:
#48Upon reading the mad scientist link more carefully, understanding it better, and making a working prototype latex version of it in a test directory, I'm pretty convinced it's the way to go. The design pattern looks like this:
I welcome comments and criticisms before I make it so.
I mean, before I commit to making it so.
JD - do you want time to review this, or shall I go ahead?
One big concern would be: what happens if a .tex file goes away? Maybe use existing .tex.d files that are associated with existing .tex files?
Otherwise it sounds very good, modulo the question of whether there's an easy way to make the recursively flattened file.
BTW, I suggest calling them base.tex.d, rather than base.tex or base.ww_tex_dependency_rule. If you know what I mean.
JD and I have resolved the concern about removed .tex files on the phone: ms.tex.d only tells how to make ms.pdf and related products, so having it remain after ms.tex is removed seems okay. I'll go ahead and make the changes.
ps. the flattened list of dependencies turned out to be easy to do - you'll see the while loop in makefile-before once I've checked it in. I wrote and tested it in the Toronto airport when I was early for my flight back to SF.
The new make rules need more complete testing before committing them. There is a ticket somewhere on here with a whole list of good tests for making sure .tex files compile right. I need to find those and check all of them. Right now I just noticed that it chokes when there's a .tex and .bib but the .tex.d hasn't been created yet - it knows how to compile the .tex but not how to make the .bbl.
I found the tests - they're on [#86]. Embarking on testing now.
Related
Bugs:
#86OK