From 691d81ba723705f8b5981e981b7c939af2ca5866 Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Fri, 16 Jun 2023 16:24:57 +0200 Subject: [PATCH] Makefiles: fix catala arguments order the command name now needs to be first --- examples/Makefile.common.mk | 39 +++++++++++++++---------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/examples/Makefile.common.mk b/examples/Makefile.common.mk index 6e6f4cda..d8b4a32d 100644 --- a/examples/Makefile.common.mk +++ b/examples/Makefile.common.mk @@ -6,8 +6,8 @@ LATEXMK?=latexmk CURR_DIR=examples/$(shell basename $(shell pwd))/ -CATALA=cd ../../; _build/default/compiler/catala.exe \ - $(CATALA_OPTS) --language=$(CATALA_LANG) +CATALA=cd ../../; _build/default/compiler/catala.exe +CATALA_OPTS := $(CATALA_OPTS) --language=$(CATALA_LANG) PLUGIN_DIR=_build/default/compiler/plugins @@ -20,49 +20,43 @@ help : ../Makefile.common.mk #> SCOPE= .run : Runs the interpeter for the scope of the file %.run: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $(CURR_DIR)$< - $(CATALA) \ - Interpret \ + @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< + $(CATALA) Interpret $(CATALA_OPTS) \ -s $(SCOPE) \ $(CURR_DIR)$< #> .ml : Compiles the file to OCaml %.ml: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $(CURR_DIR)$< - $(CATALA) \ - OCaml \ + @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< + $(CATALA) OCaml $(CATALA_OPTS) \ $(CURR_DIR)$< #> _api_web.ml : Compiles the file to OCaml + generates the API web %_api_web.ml: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $(CURR_DIR)$< - $(CATALA) \ - api_web \ + @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< + $(CATALA) api_web $(CATALA_OPTS) \ --plugin-dir=$(PLUGIN_DIR) \ $(CURR_DIR)$< #> SCOPE= _api_web.ml : Generates the JSON schema %_schema.json: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $(CURR_DIR)$< - $(CATALA) \ - json_schema \ + @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< + $(CATALA) json_schema $(CATALA_OPTS) \ --plugin-dir=$(PLUGIN_DIR) \ -s $(SCOPE) \ $(CURR_DIR)$< #> .py : Compiles the file to Python %.py: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $(CURR_DIR)$< - $(CATALA) \ - Python \ + @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< + $(CATALA) Python $(CATALA_OPTS) \ $(CURR_DIR)$< #> .tex : Weaves the file to LaTeX %.tex: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $(CURR_DIR)$< - $(CATALA) \ + @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< + $(CATALA) LaTeX $(CATALA_OPTS) \ --wrap \ - LaTeX \ $(CURR_DIR)$< #> .pdf : Weaves the file to PDF (via XeLaTeX) @@ -71,10 +65,9 @@ help : ../Makefile.common.mk #> .html : Weaves the file to HTML %.html: %.catala_$(CATALA_LANG) - @$(CATALA) Makefile $(CURR_DIR)$< - $(CATALA) \ + @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< + $(CATALA) HTML $(CATALA_OPTS) \ --wrap \ - HTML \ $(CURR_DIR)$< %.spellok: %.catala_$(CATALA_LANG) ../whitelist.$(CATALA_LANG)