From f320b503b7eb4544e1aedf16d7c967be15cb0308 Mon Sep 17 00:00:00 2001 From: Emile Rolley Date: Fri, 1 Dec 2023 15:06:47 +0100 Subject: [PATCH] fix(build): correctly manage the aides_logement example --- Makefile | 1 + examples/Makefile.common.mk | 18 +++++++++--------- examples/aides_logement/Makefile | 2 +- generate_website_assets.sh | 4 ---- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index ddee197f..7812d27b 100644 --- a/Makefile +++ b/Makefile @@ -375,6 +375,7 @@ all: \ clean: dune clean rm -rf artifacts + $(MAKE) -C $(AIDES_LOGEMENT_DIR) clean $(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) clean $(MAKE) -C $(US_TAX_CODE_DIR) clean $(MAKE) -C $(TUTORIEL_FR_DIR) clean diff --git a/examples/Makefile.common.mk b/examples/Makefile.common.mk index d8b4a32d..746adcb6 100644 --- a/examples/Makefile.common.mk +++ b/examples/Makefile.common.mk @@ -18,27 +18,27 @@ help : ../Makefile.common.mk # Targets ########################################## -#> SCOPE= .run : Runs the interpeter for the scope of the file +#> SCOPE= .run : Runs the interpeter for the scope of the file %.run: %.catala_$(CATALA_LANG) @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< $(CATALA) Interpret $(CATALA_OPTS) \ -s $(SCOPE) \ $(CURR_DIR)$< -#> .ml : Compiles the file to OCaml +#> .ml : Compiles the file to OCaml %.ml: %.catala_$(CATALA_LANG) @$(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 : Compiles the file to OCaml + generates the API web %_api_web.ml: %.catala_$(CATALA_LANG) @$(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 +#> SCOPE= _api_web.ml : Generates the JSON schema %_schema.json: %.catala_$(CATALA_LANG) @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< $(CATALA) json_schema $(CATALA_OPTS) \ @@ -46,24 +46,24 @@ help : ../Makefile.common.mk -s $(SCOPE) \ $(CURR_DIR)$< -#> .py : Compiles the file to Python +#> .py : Compiles the file to Python %.py: %.catala_$(CATALA_LANG) @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< $(CATALA) Python $(CATALA_OPTS) \ $(CURR_DIR)$< -#> .tex : Weaves the file to LaTeX +#> .tex : Weaves the file to LaTeX %.tex: %.catala_$(CATALA_LANG) @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< $(CATALA) LaTeX $(CATALA_OPTS) \ --wrap \ $(CURR_DIR)$< -#> .pdf : Weaves the file to PDF (via XeLaTeX) +#> .pdf : Weaves the file to PDF (via XeLaTeX) %.pdf: %.tex cd $(@D) && $(LATEXMK) -g -xelatex -halt-on-error -shell-escape $(%F) -#> .html : Weaves the file to HTML +#> .html : Weaves the file to HTML %.html: %.catala_$(CATALA_LANG) @$(CATALA) Makefile $(CATALA_OPTS) $(CURR_DIR)$< $(CATALA) HTML $(CATALA_OPTS) \ @@ -81,7 +81,7 @@ help : ../Makefile.common.mk # Misceallenous ########################################## -#> clean : Removes intermediate files +#> clean : Removes intermediate files clean: $(LATEXMK) -f -C $(SRC:.catala_$(CATALA_LANG)=.tex) rm -rf $(SRC:.catala_$(CATALA_LANG)=.tex) \ diff --git a/examples/aides_logement/Makefile b/examples/aides_logement/Makefile index 7f77b274..ff6d22be 100644 --- a/examples/aides_logement/Makefile +++ b/examples/aides_logement/Makefile @@ -1,4 +1,4 @@ CATALA_LANG=fr -SRC=allocations_logement.catala_fr +SRC=aides_logement.catala_fr include ../Makefile.common.mk diff --git a/generate_website_assets.sh b/generate_website_assets.sh index 00555ede..6c40b3d0 100755 --- a/generate_website_assets.sh +++ b/generate_website_assets.sh @@ -9,12 +9,8 @@ if [ $# -ne 1 ]; then exit 1 fi -mkdir -p $1/playground - BUILD=_build/default -rsync -a $BUILD/_doc/_html/ $1/ocaml_docs/ --delete - rsync $BUILD/examples/allocations_familiales/allocations_familiales.html $1/ rsync $BUILD/examples/aides_logement/aides_logement.html $1/ rsync $BUILD/examples/us_tax_code/us_tax_code.html $1/