From a9bbb87612ab25918b40bb7edd93cbd56c22a431 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 14 Jun 2023 12:02:57 -0400 Subject: [PATCH] build-aux/Makefile.am: Introduce .experimental files If a source file is paired with a `.experimental` file (for example, `foo.xml` has a silbing `foo.experimental` file), then it will be precompiled using `--emit xmlo-experimental` instead of `--emit xmlo`. Further, the contents of the experimental file may contain `#`-prefixed comments describing why it exists, as well as additional options to pass to `tamec`. For example, if this is an experimental file: ``` --foo --bar=baz ``` Then the tamec invocation will contain: tamec [...] --emit xmlo-experimental --foo --bar=baz -o foo.xmli This allows for package-level conditional compilation with new features so that I am able to focus on packages that will provide the most meaningful benefits to our team, whether they be performance or features. DEV-13162 --- build-aux/Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build-aux/Makefile.am b/build-aux/Makefile.am index deb580ea..a6a17d46 100644 --- a/build-aux/Makefile.am +++ b/build-aux/Makefile.am @@ -136,7 +136,12 @@ common: $(xmlo_common) program-ui: ui/package.strip.js ui/Program.js ui/html/index.phtml -# Handle an intermediate step as we transition to the new compiler +# Handle an intermediate step as we transition to the new compiler. +# If a source file is paired with an `*.experimental` file with the same +# stem, then it will trigger compilation using `xmlo-experimental`. The +# file may contain additional arguments to the pass to the compiler. +%.xmli: %.xml %.experimental + $(path_tame)/tamer/target/release/tamec --emit xmlo-experimental $$(grep -v '^#' $*.experimental) -o $@ $< %.xmli: %.xml $(path_tame)/tamer/target/release/tamec --emit xmlo -o $@ $<