Start with an approximation ofdefine; instead of \ at line-ends escaping the newline as space, a \n there keep the newlines instead! No need for define for simple cases (of a few lines only).
It's a shame that only the (otherwise infamously crippled*) NMAKE has this fantastically useful feature. GNU make has its multiline macros created with define, which is also very nice, but it still won't spare you the tedium of actually creating & (optionally) deleting intermediate work files.
* Well, it has a whole bunch of half-features, which, had their promise been followed through, could make NMAKE a very serious tool even today: it has its clever and powerful batch mode, its fantastic inline files, or small handy things like the !message directive etc., but, e.g.:
supports macros in macro names, but then they can't be dereferenced using macros (which is hilariously stupid, I have to add)
supports wildcards in paths, but only in rule definitions, not during preprocessing
can still run arbitrary shell commands during preprocessing (Perhaps to delegate path globbing to external commands?...), but can't capture their output, only their exit code (Umm, nope...)
inference rules can have paths (yay!), but can't have patterns (boo!)
has inline files, but their contents can't be assigned to macros (so if you need them in multiple rules, go copy-paste...)
Start with an approximation of
define
; instead of\
at line-ends escaping the newline as space, a\n
there keep the newlines instead! No need fordefine
for simple cases (of a few lines only).It's a shame that only the (otherwise infamously crippled*) NMAKE has this fantastically useful feature. GNU make has its multiline macros created with
define
, which is also very nice, but it still won't spare you the tedium of actually creating & (optionally) deleting intermediate work files.* Well, it has a whole bunch of half-features, which, had their promise been followed through, could make NMAKE a very serious tool even today: it has its clever and powerful batch mode, its fantastic inline files, or small handy things like the
!message
directive etc., but, e.g.: