2021-03-19 19:36:09 +03:00
|
|
|
help : Makefile
|
|
|
|
@sed -n 's/^#> //p' $<
|
2020-08-07 18:37:28 +03:00
|
|
|
|
2021-04-03 20:31:33 +03:00
|
|
|
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
|
|
|
2023-02-28 19:26:49 +03:00
|
|
|
export DUNE_PROFILE ?= dev
|
2022-08-01 19:52:27 +03:00
|
|
|
|
2021-06-24 18:50:08 +03:00
|
|
|
# Export all variables to sub-make
|
|
|
|
export
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Dependencies
|
|
|
|
##########################################
|
2020-04-20 09:35:22 +03:00
|
|
|
|
2023-03-02 13:47:51 +03:00
|
|
|
EXECUTABLES = groff python3 colordiff node node npm ninja pandoc
|
2020-05-13 15:53:53 +03:00
|
|
|
K := $(foreach exec,$(EXECUTABLES),\
|
|
|
|
$(if $(shell which $(exec)),some string,$(warning [WARNING] No "$(exec)" executable found. \
|
|
|
|
Please install this executable for everything to work smoothly)))
|
|
|
|
|
2022-07-18 18:08:46 +03:00
|
|
|
OPAM = opam --cli=2.1
|
|
|
|
|
2022-03-09 19:00:53 +03:00
|
|
|
dependencies-ocaml:
|
2022-07-18 18:08:46 +03:00
|
|
|
$(OPAM) pin . --no-action
|
|
|
|
OPAMVAR_cataladevmode=1 $(OPAM) install . --with-doc --with-test --update-invariant --depext-only
|
|
|
|
OPAMVAR_cataladevmode=1 $(OPAM) install . --with-doc --with-test --update-invariant --deps-only
|
2020-04-26 19:42:42 +03:00
|
|
|
|
2022-03-09 19:00:53 +03:00
|
|
|
dependencies-ocaml-with-z3:
|
2022-07-18 18:08:46 +03:00
|
|
|
$(OPAM) pin . --no-action
|
|
|
|
OPAMVAR_cataladevmode=1 OPAMVAR_catalaz3mode=1 $(OPAM) install . --with-doc --with-test --update-invariant --depext-only
|
|
|
|
OPAMVAR_cataladevmode=1 OPAMVAR_catalaz3mode=1 $(OPAM) install . --with-doc --with-test --update-invariant --deps-only
|
2022-03-09 14:53:17 +03:00
|
|
|
|
2021-06-21 12:54:56 +03:00
|
|
|
dependencies-js:
|
|
|
|
$(MAKE) -C $(FRENCH_LAW_JS_LIB_DIR) dependencies
|
|
|
|
|
2023-03-02 13:47:51 +03:00
|
|
|
PY_VENV_DIR = _python_venv
|
|
|
|
|
|
|
|
PY_VENV_ACTIVATE = . $(PY_VENV_DIR)/bin/activate;
|
|
|
|
|
|
|
|
# Rebuild when requirements change
|
|
|
|
$(PY_VENV_DIR): $(PY_VENV_DIR)/stamp
|
|
|
|
|
|
|
|
$(PY_VENV_DIR)/stamp: \
|
|
|
|
runtimes/python/catala/pyproject.toml \
|
|
|
|
syntax_highlighting/en/pygments/pyproject.toml \
|
|
|
|
syntax_highlighting/fr/pygments/pyproject.toml \
|
|
|
|
syntax_highlighting/pl/pygments/pyproject.toml
|
|
|
|
test -d $(PY_VENV_DIR) || python3 -m venv $(PY_VENV_DIR)
|
2023-06-28 16:57:52 +03:00
|
|
|
$(PY_VENV_ACTIVATE) python3 -m pip install -U pip
|
2023-03-02 13:47:51 +03:00
|
|
|
$(PY_VENV_ACTIVATE) python3 -m pip install -U \
|
|
|
|
-e runtimes/python/catala \
|
|
|
|
-e syntax_highlighting/en/pygments \
|
|
|
|
-e syntax_highlighting/fr/pygments \
|
|
|
|
-e syntax_highlighting/pl/pygments
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
dependencies-python: $(PY_VENV_DIR)
|
|
|
|
|
2021-06-21 12:54:56 +03:00
|
|
|
#> dependencies : Install the Catala OCaml, JS and Git dependencies
|
2023-03-02 13:47:51 +03:00
|
|
|
dependencies: dependencies-ocaml dependencies-js dependencies-python
|
2020-05-13 15:20:15 +03:00
|
|
|
|
2023-03-02 13:47:51 +03:00
|
|
|
dependencies-with-z3: dependencies-ocaml-with-z3 dependencies-js dependencies-python
|
2020-05-13 15:20:15 +03:00
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Catala compiler rules
|
|
|
|
##########################################
|
|
|
|
|
2021-06-21 12:39:06 +03:00
|
|
|
COMPILER_DIR=compiler
|
2022-01-10 19:57:11 +03:00
|
|
|
BUILD_SYSTEM_DIR=build_system
|
2022-09-08 16:16:39 +03:00
|
|
|
CATALA_LEGIFRANCE_DIR=french_law/catala_legifrance
|
2021-06-21 12:39:06 +03:00
|
|
|
|
2022-01-26 17:25:58 +03:00
|
|
|
#> build_dev : Builds the Catala compiler, without formatting code
|
2022-05-11 15:45:54 +03:00
|
|
|
build_dev: parser-messages
|
2022-07-29 14:40:43 +03:00
|
|
|
dune build \
|
|
|
|
$(COMPILER_DIR)/catala.exe \
|
|
|
|
$(COMPILER_DIR)/plugins/ \
|
2022-09-06 18:25:57 +03:00
|
|
|
$(BUILD_SYSTEM_DIR)/clerk.exe \
|
2022-09-08 16:16:39 +03:00
|
|
|
$(CATALA_LEGIFRANCE_DIR)/catala_legifrance.exe
|
2022-09-06 18:25:57 +03:00
|
|
|
|
2022-09-23 18:30:54 +03:00
|
|
|
# Just the base compiler as needed to run the tests
|
|
|
|
compiler: parser-messages
|
|
|
|
dune build $(COMPILER_DIR)/catala.exe $(COMPILER_DIR)/plugins/ $(BUILD_SYSTEM_DIR)/clerk.exe
|
2022-01-14 13:25:37 +03:00
|
|
|
|
2021-03-05 21:16:56 +03:00
|
|
|
#> build : Builds the Catala compiler
|
2022-07-29 14:40:43 +03:00
|
|
|
build: parser-messages format build_dev
|
2020-04-19 17:30:18 +03:00
|
|
|
|
2021-11-12 12:07:13 +03:00
|
|
|
#> js_build : Builds the Web-compatible JS versions of the Catala compiler
|
2021-01-16 20:06:22 +03:00
|
|
|
js_build:
|
2022-08-01 19:52:27 +03:00
|
|
|
dune build $(COMPILER_DIR)/catala.bc.js
|
|
|
|
dune build $(COMPILER_DIR)/catala_web_interpreter.bc.js
|
2021-01-05 16:35:04 +03:00
|
|
|
|
2021-03-05 21:16:56 +03:00
|
|
|
#> doc : Generates the HTML OCaml documentation
|
2021-02-01 22:24:50 +03:00
|
|
|
doc:
|
2020-05-23 00:02:48 +03:00
|
|
|
dune build @doc
|
2020-12-14 20:09:38 +03:00
|
|
|
ln -sf $(PWD)/_build/default/_doc/_html/index.html doc/odoc.html
|
2020-05-23 00:02:48 +03:00
|
|
|
|
2020-12-14 20:09:38 +03:00
|
|
|
install:
|
2021-01-05 16:35:04 +03:00
|
|
|
dune build @install
|
2020-04-16 18:47:35 +03:00
|
|
|
|
2022-07-27 19:35:09 +03:00
|
|
|
#> runtimes : Builds the OCaml and js_of_ocaml runtimes
|
|
|
|
runtimes:
|
|
|
|
dune build runtimes/
|
|
|
|
|
2022-07-29 14:40:43 +03:00
|
|
|
#> plugins : Builds the compiler backend plugins
|
2022-07-27 19:35:09 +03:00
|
|
|
plugins: runtimes
|
2022-03-04 20:32:39 +03:00
|
|
|
dune build compiler/plugins/
|
|
|
|
|
2022-05-11 15:45:54 +03:00
|
|
|
##########################################
|
|
|
|
# Rules related to promoted files
|
|
|
|
##########################################
|
|
|
|
|
|
|
|
check-promoted:
|
|
|
|
dune build @update-parser-messages @fmt
|
|
|
|
|
|
|
|
compiler/surface/parser.messages: compiler/surface/tokens.mly compiler/surface/parser.mly
|
2022-08-01 16:37:06 +03:00
|
|
|
-dune build @update-parser-messages --auto-promote
|
2022-05-11 15:45:54 +03:00
|
|
|
parser-messages: compiler/surface/parser.messages
|
|
|
|
|
|
|
|
format:
|
2022-08-01 16:37:06 +03:00
|
|
|
-dune build @fmt --auto-promote 2>/dev/null
|
2022-05-11 15:45:54 +03:00
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
2020-08-19 00:16:27 +03:00
|
|
|
# Syntax highlighting rules
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
2020-03-08 05:30:37 +03:00
|
|
|
|
2020-04-27 10:57:13 +03:00
|
|
|
SYNTAX_HIGHLIGHTING_FR=${CURDIR}/syntax_highlighting/fr
|
|
|
|
SYNTAX_HIGHLIGHTING_EN=${CURDIR}/syntax_highlighting/en
|
2021-05-09 23:55:50 +03:00
|
|
|
SYNTAX_HIGHLIGHTING_PL=${CURDIR}/syntax_highlighting/pl
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2023-03-02 13:47:51 +03:00
|
|
|
pygmentize_%: $(PY_VENV_DIR)
|
|
|
|
$(PY_VENV_ACTIVATE) python3 -m pip install syntax_highlighting/$*/pygments
|
2021-05-09 23:55:50 +03:00
|
|
|
|
2021-03-05 21:16:56 +03:00
|
|
|
#> pygments : Extends your pygmentize executable with Catala lexers
|
2021-05-10 20:05:18 +03:00
|
|
|
pygments: pygmentize_fr pygmentize_en pygmentize_pl
|
2020-04-26 21:48:51 +03:00
|
|
|
|
2020-04-27 10:57:13 +03:00
|
|
|
atom_fr: ${CURDIR}/syntax_highlighting/fr/setup_atom.sh
|
2020-04-26 21:48:51 +03:00
|
|
|
chmod +x $<
|
|
|
|
$<
|
2020-04-20 09:35:22 +03:00
|
|
|
|
2020-04-27 10:57:13 +03:00
|
|
|
atom_en: ${CURDIR}/syntax_highlighting/en/setup_atom.sh
|
2020-04-26 21:59:04 +03:00
|
|
|
chmod +x $<
|
|
|
|
$<
|
|
|
|
|
2021-05-09 23:55:50 +03:00
|
|
|
atom_pl: ${CURDIR}/syntax_highlighting/pl/setup_atom.sh
|
|
|
|
chmod +x $<
|
|
|
|
$<
|
|
|
|
|
2021-03-05 21:16:56 +03:00
|
|
|
#> atom : Installs Catala syntax highlighting for Atom
|
2021-05-29 12:21:35 +03:00
|
|
|
atom: atom_fr atom_en atom_pl
|
2020-04-26 21:59:04 +03:00
|
|
|
|
2020-08-19 00:16:27 +03:00
|
|
|
vscode_fr: ${CURDIR}/syntax_highlighting/fr/setup_vscode.sh
|
|
|
|
chmod +x $<
|
|
|
|
$<
|
|
|
|
|
|
|
|
vscode_en: ${CURDIR}/syntax_highlighting/en/setup_vscode.sh
|
|
|
|
chmod +x $<
|
|
|
|
$<
|
|
|
|
|
2021-05-16 21:14:35 +03:00
|
|
|
# TODO
|
|
|
|
# vscode_pl: ${CURDIR}/syntax_highlighting/pl/setup_vscode.sh
|
|
|
|
# chmod +x $<
|
|
|
|
# $<
|
2021-05-09 23:55:50 +03:00
|
|
|
|
2021-03-05 21:16:56 +03:00
|
|
|
#> vscode : Installs Catala syntax highlighting for VSCode
|
2021-05-29 12:21:35 +03:00
|
|
|
vscode: vscode_fr vscode_en
|
2020-08-19 00:16:27 +03:00
|
|
|
|
2023-03-02 16:21:59 +03:00
|
|
|
##########################################
|
|
|
|
# Extra documentation
|
|
|
|
##########################################
|
|
|
|
|
|
|
|
syntax:
|
2023-03-14 19:24:29 +03:00
|
|
|
$(MAKE) -C doc/syntax
|
2023-03-02 16:21:59 +03:00
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
2021-06-25 11:50:49 +03:00
|
|
|
# Literate programming and examples
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2020-04-20 10:02:08 +03:00
|
|
|
EXAMPLES_DIR=examples
|
|
|
|
ALLOCATIONS_FAMILIALES_DIR=$(EXAMPLES_DIR)/allocations_familiales
|
2022-07-06 16:46:36 +03:00
|
|
|
AIDES_LOGEMENT_DIR=$(EXAMPLES_DIR)/aides_logement
|
2020-05-25 20:07:55 +03:00
|
|
|
US_TAX_CODE_DIR=$(EXAMPLES_DIR)/us_tax_code
|
2020-12-24 13:37:11 +03:00
|
|
|
TUTORIAL_EN_DIR=$(EXAMPLES_DIR)/tutorial_en
|
|
|
|
TUTORIEL_FR_DIR=$(EXAMPLES_DIR)/tutoriel_fr
|
2021-05-13 15:01:34 +03:00
|
|
|
POLISH_TAXES_DIR=$(EXAMPLES_DIR)/polish_taxes
|
2020-12-24 13:37:11 +03:00
|
|
|
|
2023-03-02 13:47:51 +03:00
|
|
|
literate_aides_logement: build $(PY_VENV_DIR)
|
2023-03-14 19:24:29 +03:00
|
|
|
$(MAKE) -C $(AIDES_LOGEMENT_DIR) aides_logement.tex
|
|
|
|
$(MAKE) -C $(AIDES_LOGEMENT_DIR) aides_logement.html
|
2022-07-06 16:46:36 +03:00
|
|
|
|
2021-03-02 20:27:39 +03:00
|
|
|
literate_allocations_familiales: build
|
2023-03-14 19:24:29 +03:00
|
|
|
$(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) allocations_familiales.tex
|
|
|
|
$(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) allocations_familiales.html
|
2020-04-25 15:21:26 +03:00
|
|
|
|
2021-03-02 20:27:39 +03:00
|
|
|
literate_us_tax_code: build
|
2023-03-14 19:24:29 +03:00
|
|
|
$(MAKE) -C $(US_TAX_CODE_DIR) us_tax_code.tex
|
|
|
|
$(MAKE) -C $(US_TAX_CODE_DIR) us_tax_code.html
|
2020-05-17 19:51:00 +03:00
|
|
|
|
2021-03-02 20:27:39 +03:00
|
|
|
literate_tutorial_en: build
|
2023-03-14 19:24:29 +03:00
|
|
|
$(MAKE) -C $(TUTORIAL_EN_DIR) tutorial_en.tex
|
|
|
|
$(MAKE) -C $(TUTORIAL_EN_DIR) tutorial_en.html
|
2020-12-24 13:37:11 +03:00
|
|
|
|
2021-03-02 20:27:39 +03:00
|
|
|
literate_tutoriel_fr: build
|
2023-03-14 19:24:29 +03:00
|
|
|
$(MAKE) -C $(TUTORIEL_FR_DIR) tutoriel_fr.tex
|
|
|
|
$(MAKE) -C $(TUTORIEL_FR_DIR) tutoriel_fr.html
|
2020-04-19 17:30:18 +03:00
|
|
|
|
2021-05-13 15:01:34 +03:00
|
|
|
literate_polish_taxes: build
|
2023-03-14 19:24:29 +03:00
|
|
|
$(MAKE) -C $(POLISH_TAXES_DIR) polish_taxes.tex
|
|
|
|
$(MAKE) -C $(POLISH_TAXES_DIR) polish_taxes.html
|
2021-05-13 15:01:34 +03:00
|
|
|
|
2021-03-11 16:41:14 +03:00
|
|
|
#> literate_examples : Builds the .tex and .html versions of the examples code. Needs pygments to be installed and patched with Catala.
|
2023-06-19 13:01:06 +03:00
|
|
|
literate_examples: literate_allocations_familiales \
|
2022-07-06 16:46:36 +03:00
|
|
|
literate_us_tax_code literate_tutorial_en literate_tutoriel_fr \
|
|
|
|
literate_polish_taxes literate_aides_logement
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2021-01-28 20:30:01 +03:00
|
|
|
##########################################
|
2021-02-01 22:09:16 +03:00
|
|
|
# French law library
|
2021-01-28 20:30:01 +03:00
|
|
|
##########################################
|
|
|
|
|
2021-06-25 11:50:49 +03:00
|
|
|
#-----------------------------------------
|
|
|
|
# OCaml
|
|
|
|
#-----------------------------------------
|
2021-06-22 15:00:42 +03:00
|
|
|
|
2022-08-01 16:37:06 +03:00
|
|
|
FRENCH_LAW_OCAML_LIB_DIR = french_law/ocaml
|
2021-01-30 20:00:49 +03:00
|
|
|
|
2022-08-01 16:37:06 +03:00
|
|
|
FRENCH_LAW_LIBRARY_OCAML = \
|
|
|
|
$(FRENCH_LAW_OCAML_LIB_DIR)/law_source/allocations_familiales_api_web.ml \
|
|
|
|
$(FRENCH_LAW_OCAML_LIB_DIR)/law_source/unit_tests/tests_allocations_familiales.ml \
|
|
|
|
$(FRENCH_LAW_OCAML_LIB_DIR)/law_source/aides_logement_api_web.ml
|
2022-07-22 13:34:46 +03:00
|
|
|
|
2022-08-01 16:37:06 +03:00
|
|
|
$(addprefix _build/default/,$(FRENCH_LAW_LIBRARY_OCAML)) :
|
2022-07-29 17:39:33 +03:00
|
|
|
dune build $@
|
2021-02-03 12:53:21 +03:00
|
|
|
|
2021-06-21 12:39:06 +03:00
|
|
|
#> generate_french_law_library_ocaml : Generates the French law library OCaml sources from Catala
|
2022-08-01 16:37:06 +03:00
|
|
|
generate_french_law_library_ocaml:
|
|
|
|
dune build $(FRENCH_LAW_LIBRARY_OCAML)
|
2021-02-03 12:53:21 +03:00
|
|
|
|
2021-06-21 12:39:06 +03:00
|
|
|
#> build_french_law_library_ocaml : Builds the OCaml French law library
|
2022-08-01 16:37:06 +03:00
|
|
|
build_french_law_library_ocaml:
|
2021-06-21 12:39:06 +03:00
|
|
|
dune build $(FRENCH_LAW_OCAML_LIB_DIR)/api.a
|
|
|
|
|
2022-08-01 16:37:06 +03:00
|
|
|
run_french_law_library_benchmark_ocaml:
|
2023-03-14 15:40:44 +03:00
|
|
|
dune exec $(FRENCH_LAW_OCAML_LIB_DIR)/bench.exe
|
2021-02-01 22:09:16 +03:00
|
|
|
|
2022-08-01 16:37:06 +03:00
|
|
|
run_french_law_library_ocaml_tests:
|
2021-06-25 01:47:12 +03:00
|
|
|
dune exec $(FRENCH_LAW_OCAML_LIB_DIR)/law_source/unit_tests/run_tests.exe
|
|
|
|
|
2022-07-29 14:40:43 +03:00
|
|
|
#-----------------------------------------
|
|
|
|
# JSON schemas
|
|
|
|
#-----------------------------------------
|
|
|
|
|
2022-08-01 16:37:06 +03:00
|
|
|
JSON_SCHEMAS = \
|
|
|
|
$(AIDES_LOGEMENT_DIR)/aides_logement_schema.json \
|
|
|
|
$(ALLOCATIONS_FAMILIALES_DIR)/allocations_familiales_schema.json
|
|
|
|
|
2022-07-29 19:56:49 +03:00
|
|
|
#> generate_french_law_json_schemas : Generates the French law library JSON schemas
|
2022-08-01 16:37:06 +03:00
|
|
|
$(addprefix _build/default/,$(JSON_SCHEMAS)):
|
|
|
|
dune build $@
|
|
|
|
|
|
|
|
generate_french_law_json_schemas:
|
|
|
|
dune build $(JSON_SCHEMAS)
|
|
|
|
|
2021-06-25 11:50:49 +03:00
|
|
|
#-----------------------------------------
|
|
|
|
# JS
|
|
|
|
#-----------------------------------------
|
|
|
|
|
|
|
|
FRENCH_LAW_JS_LIB_DIR=french_law/js
|
|
|
|
|
2021-06-21 12:39:06 +03:00
|
|
|
run_french_law_library_benchmark_js: build_french_law_library_js
|
2021-06-21 12:54:56 +03:00
|
|
|
$(MAKE) -C $(FRENCH_LAW_JS_LIB_DIR) bench
|
2021-03-05 21:16:56 +03:00
|
|
|
|
|
|
|
#> build_french_law_library_js : Builds the JS version of the OCaml French law library
|
2022-08-01 20:29:34 +03:00
|
|
|
build_french_law_library_js:
|
2023-05-05 14:23:27 +03:00
|
|
|
dune build $(FRENCH_LAW_JS_LIB_DIR)/src/french_law.js
|
2021-02-01 22:09:16 +03:00
|
|
|
|
2022-07-29 14:40:43 +03:00
|
|
|
#> build_french_law_library_web_api : Builds the web API of the French law library
|
|
|
|
build_french_law_library_web_api: build_french_law_library_js generate_french_law_json_schemas
|
2021-06-25 11:50:49 +03:00
|
|
|
|
|
|
|
#-----------------------------------------
|
|
|
|
# Python
|
|
|
|
#-----------------------------------------
|
|
|
|
|
|
|
|
FRENCH_LAW_PYTHON_LIB_DIR=french_law/python
|
|
|
|
|
2022-08-03 16:21:09 +03:00
|
|
|
FRENCH_LAW_LIBRARY_PYTHON = \
|
|
|
|
$(FRENCH_LAW_PYTHON_LIB_DIR)/src/allocations_familiales.py \
|
|
|
|
$(FRENCH_LAW_PYTHON_LIB_DIR)/src/aides_logement.py
|
|
|
|
|
|
|
|
$(FRENCH_LAW_LIBRARY_PYTHON):
|
|
|
|
dune build $@
|
2022-07-25 12:07:27 +03:00
|
|
|
|
2021-06-22 15:00:42 +03:00
|
|
|
#> generate_french_law_library_python : Generates the French law library Python sources from Catala
|
2022-08-03 16:21:09 +03:00
|
|
|
generate_french_law_library_python:
|
|
|
|
dune build $(FRENCH_LAW_LIBRARY_PYTHON)
|
2021-06-22 15:00:42 +03:00
|
|
|
|
2021-10-01 17:31:50 +03:00
|
|
|
#> type_french_law_library_python : Types the French law library Python sources with mypy
|
2023-03-02 13:47:51 +03:00
|
|
|
type_french_law_library_python: $(PY_VENV_DIR) generate_french_law_library_python
|
2023-03-14 19:24:29 +03:00
|
|
|
$(PY_VENV_ACTIVATE) $(MAKE) -C $(FRENCH_LAW_PYTHON_LIB_DIR) type
|
2023-03-02 13:47:51 +03:00
|
|
|
|
|
|
|
run_french_law_library_benchmark_python: $(PY_ENV_DIR) type_french_law_library_python
|
2023-03-14 19:24:29 +03:00
|
|
|
$(PY_VENV_ACTIVATE) $(MAKE) -C $(FRENCH_LAW_PYTHON_LIB_DIR) bench
|
2021-06-25 01:47:12 +03:00
|
|
|
|
2021-06-25 11:50:49 +03:00
|
|
|
##########################################
|
|
|
|
# High-level test and benchmarks commands
|
|
|
|
##########################################
|
|
|
|
|
2022-01-11 15:05:04 +03:00
|
|
|
CATALA_OPTS?=
|
2022-04-14 12:47:18 +03:00
|
|
|
CLERK_OPTS?=--makeflags="$(MAKEFLAGS)"
|
2022-01-11 14:51:34 +03:00
|
|
|
|
2022-12-22 22:42:56 +03:00
|
|
|
CATALA_BIN=_build/default/$(COMPILER_DIR)/catala.exe
|
|
|
|
CLERK_BIN=_build/default/$(BUILD_SYSTEM_DIR)/clerk.exe
|
|
|
|
CATALA_LEGIFRANCE_BIN=_build/default/$(CATALA_LEGIFRANCE_DIR)/catala_legifrance.exe
|
2022-01-11 14:51:34 +03:00
|
|
|
|
|
|
|
CLERK=$(CLERK_BIN) --exe $(CATALA_BIN) \
|
2022-01-11 15:05:04 +03:00
|
|
|
$(CLERK_OPTS) $(if $(CATALA_OPTS),--catala-opts=$(CATALA_OPTS),)
|
2022-01-11 14:51:34 +03:00
|
|
|
|
|
|
|
|
2021-06-25 11:50:49 +03:00
|
|
|
.FORCE:
|
|
|
|
|
2022-09-23 18:30:54 +03:00
|
|
|
test_suite: .FORCE compiler
|
|
|
|
@$(MAKE) -C tests pass_all_tests
|
2021-06-25 11:50:49 +03:00
|
|
|
|
2022-09-23 18:30:54 +03:00
|
|
|
test_examples: .FORCE compiler
|
|
|
|
@$(MAKE) -C examples pass_all_tests
|
2021-06-25 11:50:49 +03:00
|
|
|
|
|
|
|
#> tests : Run interpreter tests
|
2022-07-08 15:10:25 +03:00
|
|
|
tests: test_suite test_examples
|
2021-06-25 11:50:49 +03:00
|
|
|
|
|
|
|
#> tests_ocaml : Run OCaml unit tests for the Catala-generated code
|
|
|
|
tests_ocaml: run_french_law_library_ocaml_tests
|
|
|
|
|
|
|
|
#> bench_ocaml : Run OCaml benchmarks for the Catala-generated code
|
|
|
|
bench_ocaml: run_french_law_library_benchmark_ocaml
|
|
|
|
|
|
|
|
#> bench_js : Run JS benchmarks for the Catala-generated code
|
|
|
|
bench_js: run_french_law_library_benchmark_js
|
|
|
|
|
|
|
|
#> bench_python : Run Python benchmarks for the Catala-generated code
|
|
|
|
bench_python: run_french_law_library_benchmark_python
|
|
|
|
|
2022-07-11 17:03:47 +03:00
|
|
|
tests/%: .FORCE
|
|
|
|
@$(MAKE) -C tests $*
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Website assets
|
|
|
|
##########################################
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2022-12-22 22:42:56 +03:00
|
|
|
WEBSITE_ASSETS = grammar.html catala.html clerk.html catala_legifrance.html
|
2020-04-30 13:15:26 +03:00
|
|
|
|
2022-08-01 20:29:34 +03:00
|
|
|
$(addprefix _build/default/,$(WEBSITE_ASSETS)):
|
|
|
|
dune build $@
|
2020-05-05 18:04:53 +03:00
|
|
|
|
2023-03-14 15:40:44 +03:00
|
|
|
website-assets-base: build_french_law_library_web_api doc literate_examples build
|
2022-08-01 20:29:34 +03:00
|
|
|
dune build $(WEBSITE_ASSETS)
|
2020-05-13 14:52:20 +03:00
|
|
|
|
2023-03-14 15:40:44 +03:00
|
|
|
#> website-assets : Builds all the assets necessary for the Catala website
|
|
|
|
website-assets:
|
|
|
|
$(MAKE) DUNE_PROFILE=release website-assets-base
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Misceallenous
|
|
|
|
##########################################
|
|
|
|
|
2021-06-21 12:39:06 +03:00
|
|
|
#> all : Run all make commands
|
2021-06-24 19:17:54 +03:00
|
|
|
all: \
|
2022-07-22 12:22:54 +03:00
|
|
|
build js_build doc \
|
2021-06-24 19:30:54 +03:00
|
|
|
tests \
|
2022-07-27 19:35:09 +03:00
|
|
|
runtimes \
|
2022-03-04 20:32:39 +03:00
|
|
|
plugins \
|
2021-06-24 19:17:54 +03:00
|
|
|
generate_french_law_library_ocaml build_french_law_library_ocaml \
|
2021-06-24 19:30:54 +03:00
|
|
|
tests_ocaml bench_ocaml \
|
2021-06-24 19:17:54 +03:00
|
|
|
build_french_law_library_js \
|
2021-06-24 19:30:54 +03:00
|
|
|
bench_js \
|
2022-08-01 20:56:04 +03:00
|
|
|
generate_french_law_library_python type_french_law_library_python \
|
2022-07-22 12:22:54 +03:00
|
|
|
bench_python \
|
2023-03-14 15:40:44 +03:00
|
|
|
website-assets-base
|
2021-06-24 19:17:54 +03:00
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
|
2021-03-05 21:16:56 +03:00
|
|
|
#> clean : Clean build artifacts
|
2020-04-20 09:35:22 +03:00
|
|
|
clean:
|
|
|
|
dune clean
|
2022-08-01 20:56:04 +03:00
|
|
|
rm -rf artifacts
|
2020-04-20 10:02:08 +03:00
|
|
|
$(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) clean
|
2020-10-04 02:25:37 +03:00
|
|
|
$(MAKE) -C $(US_TAX_CODE_DIR) clean
|
2021-01-16 20:06:22 +03:00
|
|
|
$(MAKE) -C $(TUTORIEL_FR_DIR) clean
|
|
|
|
$(MAKE) -C $(TUTORIAL_EN_DIR) clean
|
2021-05-13 15:01:34 +03:00
|
|
|
$(MAKE) -C $(POLISH_TAXES_DIR) clean
|
2020-10-04 02:25:37 +03:00
|
|
|
$(MAKE) -C $(CODE_GENERAL_IMPOTS_DIR) clean
|
2020-04-19 17:30:18 +03:00
|
|
|
|
2020-04-13 19:57:24 +03:00
|
|
|
inspect:
|
2021-05-09 23:55:50 +03:00
|
|
|
gitinspector -f ml,mli,mly,iro,tex,catala,catala_en,catala_pl,catala_fr,md,fst,mld --grading
|
2020-04-20 20:37:16 +03:00
|
|
|
|
2022-01-11 14:51:34 +03:00
|
|
|
#> help_clerk : Display the clerk man page
|
|
|
|
help_clerk:
|
|
|
|
$(CLERK_BIN) --help
|
|
|
|
|
|
|
|
#> help_catala : Display the catala man page
|
|
|
|
help_catala:
|
|
|
|
$(CATALA_BIN) --help
|
|
|
|
|
2022-12-22 22:42:56 +03:00
|
|
|
#> help_catala_legifrance : Display the catala_legifrance man page
|
|
|
|
help_catala_legifrance:
|
|
|
|
$(CATALA_LEGIFRANCE_BIN) --help
|
|
|
|
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
2020-04-20 20:37:16 +03:00
|
|
|
# Special targets
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
2022-08-01 20:29:34 +03:00
|
|
|
.PHONY: inspect clean all literate_examples english allocations_familiales \
|
|
|
|
pygments install build_dev build doc format dependencies \
|
|
|
|
dependencies-ocaml catala.html help parser-messages plugins \
|
|
|
|
generate_french_law_json_schemas generate_french_law_library_python \
|
|
|
|
generate_french_law_library_ocaml \
|
|
|
|
run_french_law_library_benchmark_python \
|
|
|
|
run_french_law_library_benchmark_js run_french_law_library_ocaml_tests \
|
|
|
|
build_french_law_library_js build_french_law_library_web_api \
|
2023-03-14 15:40:44 +03:00
|
|
|
build_french_law_library_ocaml \
|
|
|
|
website-assets website-assets-base
|