You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would help if workflows can be chained at runtime, e.g. ocrd-make -f pre3.mk -f seg1.mk -f ocr4.mk -f post.mk, where each makefile would consume the last fileGrp of the previous – so each stage can be replaced by an alternative configuration independent of the others. This in turn would allow writing very concise small (sub-)configurations without repetition.
As for implementation, make allows passing multiple makefiles and reads them sequentially (w.r.t. first phase, i.e. expansion of immediate variables etc.), then combines them (second phase) and finally computes dependencies.
So we could by convention (for chainable configurations) allow defining a simply expanded variable (say) OUTPUT for the (phase's) output fileGrp name, and allow using INPUT for the (phase's) dynamic input fileGrp name. Internally then (i.e. in our Makefile that always needs to be included), we predefine INPUT := $(or $(OUTPUT),$(INPUT)) and .DEFAULT_GOAL := $(OUTPUT). For the very first phase (entry point), we then just have to pass INPUT – either in a separate (phase zero) non-rule config file or with an additional cmdline arg.
make -f pre3.mk -f seg1.mk -f ocr4.mk -f post.mk INPUT=ORIGINAL
Since this only requires these 2 additional lines and does not break existing makefiles, this is more of a documentation issue actually. (And probably, the old makefiles should be removed or updated or split into multi-stage configurations anyway.)
It would help if workflows can be chained at runtime, e.g.
ocrd-make -f pre3.mk -f seg1.mk -f ocr4.mk -f post.mk
, where each makefile would consume the last fileGrp of the previous – so each stage can be replaced by an alternative configuration independent of the others. This in turn would allow writing very concise small (sub-)configurations without repetition.As for implementation,
make
allows passing multiple makefiles and reads them sequentially (w.r.t. first phase, i.e. expansion of immediate variables etc.), then combines them (second phase) and finally computes dependencies.So we could by convention (for chainable configurations) allow defining a simply expanded variable (say)
OUTPUT
for the (phase's) output fileGrp name, and allow usingINPUT
for the (phase's) dynamic input fileGrp name. Internally then (i.e. in ourMakefile
that always needs to be included), we predefineINPUT := $(or $(OUTPUT),$(INPUT))
and.DEFAULT_GOAL := $(OUTPUT)
. For the very first phase (entry point), we then just have to passINPUT
– either in a separate (phase zero) non-rule config file or with an additional cmdline arg.For example
Since this only requires these 2 additional lines and does not break existing makefiles, this is more of a documentation issue actually. (And probably, the old makefiles should be removed or updated or split into multi-stage configurations anyway.)
@mikegerber would that fit your need as well?
The text was updated successfully, but these errors were encountered: