2020-08-07 18:37:28 +03:00
|
|
|
default: build
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Dependencies
|
|
|
|
##########################################
|
2020-04-20 09:35:22 +03:00
|
|
|
|
2020-08-07 18:37:28 +03:00
|
|
|
EXECUTABLES = man2html virtualenv python3 colordiff
|
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)))
|
|
|
|
|
2020-04-26 19:42:42 +03:00
|
|
|
install-dependencies-ocaml:
|
2020-04-17 14:02:15 +03:00
|
|
|
opam install \
|
2020-05-13 14:09:39 +03:00
|
|
|
ocamlformat \
|
2020-04-17 14:02:15 +03:00
|
|
|
ANSITerminal \
|
|
|
|
sedlex \
|
|
|
|
menhir \
|
|
|
|
menhirLib \
|
2020-04-26 21:16:03 +03:00
|
|
|
dune dune-build-info \
|
2020-04-30 13:15:26 +03:00
|
|
|
cmdliner obelisk \
|
2020-05-26 12:37:01 +03:00
|
|
|
re reason\
|
2020-08-03 17:41:51 +03:00
|
|
|
obelisk\
|
|
|
|
ocamlgraph
|
2020-04-26 19:42:42 +03:00
|
|
|
|
2020-05-13 15:20:15 +03:00
|
|
|
init-submodules:
|
2020-04-17 14:02:15 +03:00
|
|
|
git submodule update --init
|
|
|
|
|
2020-05-13 15:20:15 +03:00
|
|
|
install-dependencies: install-dependencies-ocaml init-submodules
|
|
|
|
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Catala compiler rules
|
|
|
|
##########################################
|
|
|
|
|
2020-04-20 09:35:22 +03:00
|
|
|
format:
|
2020-04-24 20:16:50 +03:00
|
|
|
dune build @fmt --auto-promote | true
|
2020-04-20 09:35:22 +03:00
|
|
|
|
2020-04-25 20:22:53 +03:00
|
|
|
build:
|
2020-09-12 18:03:42 +03:00
|
|
|
$(MAKE) -C src/catala/catala_surface parser_errors.ml
|
2020-04-25 20:22:53 +03:00
|
|
|
$(MAKE) format
|
2020-05-14 22:19:46 +03:00
|
|
|
dune build
|
2020-04-19 17:30:18 +03:00
|
|
|
|
2020-05-23 00:02:48 +03:00
|
|
|
doc: build
|
|
|
|
dune build @doc
|
|
|
|
|
2020-04-20 09:35:22 +03:00
|
|
|
install: build
|
2020-04-16 18:47:35 +03:00
|
|
|
dune build @install
|
|
|
|
|
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
|
|
|
|
PYGMENTS_DIR_FR=$(SYNTAX_HIGHLIGHTING_FR)/pygments
|
2020-04-26 21:48:51 +03:00
|
|
|
PYGMENTIZE_FR=$(PYGMENTS_DIR_FR)/pygments/env/bin/pygmentize
|
2020-04-27 10:57:13 +03:00
|
|
|
SYNTAX_HIGHLIGHTING_EN=${CURDIR}/syntax_highlighting/en
|
|
|
|
PYGMENTS_DIR_EN=$(SYNTAX_HIGHLIGHTING_EN)/pygments
|
2020-04-26 21:48:51 +03:00
|
|
|
PYGMENTIZE_EN=$(PYGMENTS_DIR_EN)/pygments/env/bin/pygmentize
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2020-05-13 15:37:09 +03:00
|
|
|
$(PYGMENTIZE_FR): $(SYNTAX_HIGHLIGHTING_FR)/set_up_pygments.sh $(PYGMENTS_DIR_FR)/catala_fr.py
|
2020-04-26 21:48:51 +03:00
|
|
|
chmod +x $<
|
|
|
|
$<
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2020-05-13 15:37:09 +03:00
|
|
|
$(PYGMENTIZE_EN): $(SYNTAX_HIGHLIGHTING_EN)/set_up_pygments.sh $(PYGMENTS_DIR_EN)/catala_en.py
|
2020-04-19 17:30:18 +03:00
|
|
|
chmod +x $<
|
|
|
|
$<
|
|
|
|
|
2020-04-26 21:48:51 +03:00
|
|
|
pygments: $(PYGMENTIZE_FR) $(PYGMENTIZE_EN)
|
|
|
|
|
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 $<
|
|
|
|
$<
|
|
|
|
|
2020-08-08 20:07:28 +03:00
|
|
|
atom_nv: ${CURDIR}/syntax_highlighting/nv/setup_atom.sh
|
|
|
|
chmod +x $<
|
|
|
|
$<
|
|
|
|
|
|
|
|
atom: atom_fr atom_en atom_nv
|
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 $<
|
|
|
|
$<
|
|
|
|
|
|
|
|
vscode_nv: ${CURDIR}/syntax_highlighting/nv/setup_vscode.sh
|
|
|
|
chmod +x $<
|
|
|
|
$<
|
|
|
|
|
|
|
|
vscode: vscode_fr vscode_en vscode_nv
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Examples-related rules
|
|
|
|
##########################################
|
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
|
2020-07-03 21:30:17 +03:00
|
|
|
CODE_GENERAL_IMPOTS_DIR=$(EXAMPLES_DIR)/code_general_impots
|
2020-05-25 20:07:55 +03:00
|
|
|
US_TAX_CODE_DIR=$(EXAMPLES_DIR)/us_tax_code
|
2020-05-17 19:51:00 +03:00
|
|
|
TUTORIAL_DIR=$(EXAMPLES_DIR)/tutorial
|
2020-04-20 10:02:08 +03:00
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
allocations_familiales: pygments build
|
2020-05-26 12:37:01 +03:00
|
|
|
$(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) $@.tex
|
2020-05-17 19:51:00 +03:00
|
|
|
$(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) $@.html
|
2020-04-25 15:21:26 +03:00
|
|
|
|
2020-07-03 21:30:17 +03:00
|
|
|
code_general_impots: pygments build
|
2020-07-03 23:15:54 +03:00
|
|
|
$(MAKE) -C $(CODE_GENERAL_IMPOTS_DIR) $@.tex
|
|
|
|
$(MAKE) -C $(CODE_GENERAL_IMPOTS_DIR) $@.html
|
2020-07-03 21:30:17 +03:00
|
|
|
|
2020-05-25 20:07:55 +03:00
|
|
|
us_tax_code: pygments build
|
2020-05-26 12:37:01 +03:00
|
|
|
$(MAKE) -C $(US_TAX_CODE_DIR) $@.tex
|
2020-05-25 20:07:55 +03:00
|
|
|
$(MAKE) -C $(US_TAX_CODE_DIR) $@.html
|
2020-05-17 19:51:00 +03:00
|
|
|
|
|
|
|
tutorial_en: pygments build
|
2020-05-26 12:37:01 +03:00
|
|
|
$(MAKE) -C $(TUTORIAL_DIR) $@.tex
|
2020-05-17 19:51:00 +03:00
|
|
|
$(MAKE) -C $(TUTORIAL_DIR) $@.html
|
2020-04-19 17:30:18 +03:00
|
|
|
|
2020-07-03 21:30:17 +03:00
|
|
|
all_examples: allocations_familiales code_general_impots us_tax_code tutorial_en
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2020-08-07 18:37:28 +03:00
|
|
|
##########################################
|
|
|
|
# Execute test suite
|
|
|
|
##########################################
|
|
|
|
|
|
|
|
.FORCE:
|
|
|
|
|
|
|
|
tests: build .FORCE
|
|
|
|
$(MAKE) -C tests
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Website assets
|
|
|
|
##########################################
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2020-09-12 18:03:42 +03:00
|
|
|
grammar.html: src/catala/catala_surface/parser.mly
|
2020-04-30 13:15:26 +03:00
|
|
|
obelisk html -o $@ $<
|
|
|
|
|
2020-05-05 18:04:53 +03:00
|
|
|
catala.html: src/catala/cli.ml
|
2020-05-17 19:51:00 +03:00
|
|
|
dune exec src/catala.exe -- --help=groff | man2html | sed -e '1,8d' \
|
|
|
|
| tac | sed "1,20d" | tac > $@
|
2020-05-05 18:04:53 +03:00
|
|
|
|
2020-10-04 14:02:50 +03:00
|
|
|
website-assets: doc all_examples grammar.html catala.html
|
2020-05-13 14:52:20 +03:00
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Misceallenous
|
|
|
|
##########################################
|
|
|
|
|
2020-08-07 18:37:28 +03:00
|
|
|
all: install-dependencies build doc tests all_examples website-assets
|
2020-05-13 15:17:19 +03:00
|
|
|
|
2020-04-20 09:35:22 +03:00
|
|
|
clean:
|
|
|
|
dune clean
|
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
|
|
|
|
$(MAKE) -C $(TUTORIAL_DIR) clean
|
|
|
|
$(MAKE) -C $(CODE_GENERAL_IMPOTS_DIR) clean
|
2020-04-19 17:30:18 +03:00
|
|
|
|
2020-04-13 19:57:24 +03:00
|
|
|
inspect:
|
2020-04-16 18:47:35 +03:00
|
|
|
gitinspector -f ml,mli,mly,iro,tex,catala,md,ir --grading
|
2020-04-20 20:37:16 +03:00
|
|
|
|
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
|
|
|
##########################################
|
2020-04-20 20:37:16 +03:00
|
|
|
.PHONY: inspect clean all all_examples english allocations_familiales pygments \
|
2020-05-13 15:37:09 +03:00
|
|
|
install build format install-dependencies install-dependencies-ocaml \
|
2020-10-04 14:02:50 +03:00
|
|
|
catala.html
|