
… sure, I’ll call it ‘two days’. I was going to say it was actually last night, but since the ‘October 2’ on the previous post was very early in the morning (AKA ‘quite late October 1’) I’ll call it two days.
Makefile refactoring is complete. 500 lines of Perl (with comments!) to take a tab-delimited text file and punch out an 1800+ line Makefile (with comments). As a machine-generated file I suppose comments aren’t strictly needed, but they do help when debugging the script and I like to see them.
Changes from the previous post:
- Added 8 more rules (35 -> 43).
- Preparing to move the denaming mapping to Excel workbooks for input rather than buried in XML files (easier to work with overall, I think).
- Added a step to copy the ‘source’ XML files (identifying what gets included where) to the output directory, making it possible for me to make file references relative to these files instead of to the XSLT folder.
- Added a few rules I’d previously overlooked (because I so rarely used them) in the base Makefile.
- Expanded and refined the substitutions (previously was system and system+domain, added system+set and set) so I could set pattern-specific variables.
- Replaced ‘ruleset’ intention (style of rule, what it applies to) to ‘precious’ (mark in Makefile that files with this extension are to be kept after compilation, even if they weren’t the final compiland).
- Makefile now is mostly environment setup — what the various tools are, defines the macros used in the rules, and so on — and Makefile-auto contains all the content-related variables and build rules.

Adding new rules is now much easier than it used to be. Implementing the code for the transformation might be time-consuming, but hooking up the plumbing now just takes a minute or two. Speaking of which, yet again my workflow evolves.
