manibuilder: Use `test_build.sh'

Use `test_build.sh' to test builds with both Make and Meson, and to
compare the results. To succeed, the $(MESONARGS) have to mimic the
behavior of `CONFIG_EVERYTHING=yes'.

In the long run, we might want to use the version shipped with mani-
builder instead of the tested flashprog version. Otherwise, we won't
be able to test older revisions of flashprog with newer manibuilder.

Change-Id: Ife327e2f3e2fa9acbbfd1fa51ec0aa3c3f2489b8
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/144
diff --git a/util/manibuilder/Makefile b/util/manibuilder/Makefile
index fe5cdcf..f779356 100644
--- a/util/manibuilder/Makefile
+++ b/util/manibuilder/Makefile
@@ -5,6 +5,8 @@
 CC := ccache cc
 MAKECMD := make
 MAKEARGS := CONFIG_EVERYTHING=yes
+MESONCMD := meson
+MESONARGS := -D programmer=all -D classic_cli_print_wiki=enabled --auto-features enabled
 
 spc :=
 spc := $(spc) $(spc)
@@ -62,11 +64,11 @@
 		--name mani_$(call ident,$*) mani/$* \
 		"git fetch $(TEST_REMOTE) $(TEST_REVISION) && \
 		 git checkout FETCH_HEAD && \
-		 export $(ENV_VARS) && \
-		 $(MAKECMD) clean && $(MAKECMD) -j$${CPUS:-1} CC='$(CC)' \
-		 $(if $(STRIP),STRIP='$(STRIP)') \
-		 $(if $(LIBS_BASE),LIBS_BASE='$(LIBS_BASE)') \
-		 $(MAKEARGS)" \
+		 export CC='$(CC)' STRIP='$(STRIP)' LIBS_BASE='$(LIBS_BASE)' && \
+		 export MAKECMD='$(MAKECMD)' MAKEARGS='$(subst ',\\\",$(MAKEARGS))' && \
+		 export MESONCMD='$(MESONCMD)' MESONARGS='$(subst ',\\\",$(MESONARGS))' && \
+		 export CPUS=$${CPUS:-1} $(ENV_VARS) && \
+		 ./test_build.sh" \
 		$(if $(QUIET_TEST),>/dev/null 2>&1) \
 			|| { RET=$$?; echo $*: $${RET}; exit $${RET}; }