2020-04-20 09:35:22 +03:00
|
|
|
# Catala compiler rules
|
|
|
|
|
2020-04-26 19:42:42 +03:00
|
|
|
install-dependencies-ocaml:
|
2020-04-17 14:02:15 +03:00
|
|
|
opam install \
|
|
|
|
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-04-21 13:25:52 +03:00
|
|
|
tls cohttp lwt cohttp-lwt-unix yojson\
|
2020-04-26 13:20:09 +03:00
|
|
|
re reason
|
2020-04-26 19:42:42 +03:00
|
|
|
|
|
|
|
install-dependencies: install-dependencies-ocaml
|
2020-04-17 14:02:15 +03:00
|
|
|
git submodule update --init
|
|
|
|
|
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:
|
|
|
|
$(MAKE) -C src/catala/parsing parser_errors.ml
|
2020-04-19 17:30:18 +03:00
|
|
|
dune build
|
2020-04-25 20:22:53 +03:00
|
|
|
$(MAKE) format
|
2020-04-19 17:30:18 +03:00
|
|
|
|
2020-04-20 09:35:22 +03:00
|
|
|
install: build
|
2020-04-16 18:47:35 +03:00
|
|
|
dune build @install
|
|
|
|
|
2020-04-20 09:35:22 +03:00
|
|
|
# Pygments syntax highilghting rules
|
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-04-27 10:57:13 +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-04-27 10:57:13 +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 $<
|
|
|
|
$<
|
|
|
|
|
|
|
|
atom: atom_fr atom_en
|
|
|
|
|
2020-04-20 09:35:22 +03:00
|
|
|
# Examples-related rule
|
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-04-20 10:07:12 +03:00
|
|
|
ENGLISH_DUMMY_DIR=$(EXAMPLES_DIR)/dummy_english
|
2020-04-20 10:02:08 +03:00
|
|
|
|
2020-04-26 21:48:51 +03:00
|
|
|
allocations_familiales: $(PYGMENTIZE_FR) build
|
2020-04-20 10:02:08 +03:00
|
|
|
$(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) allocations_familiales.pdf
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2020-04-25 15:21:26 +03:00
|
|
|
allocations_familiales_expired: build
|
|
|
|
$(MAKE) -C $(ALLOCATIONS_FAMILIALES_DIR) allocations_familiales.expired
|
|
|
|
|
2020-04-26 21:48:51 +03:00
|
|
|
english: $(PYGMENTIZE_EN) build
|
2020-04-20 10:02:08 +03:00
|
|
|
$(MAKE) -C $(ENGLISH_DUMMY_DIR) english.pdf
|
2020-04-19 17:30:18 +03:00
|
|
|
|
2020-04-20 09:35:22 +03:00
|
|
|
all_examples: allocations_familiales english
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2020-04-20 09:35:22 +03:00
|
|
|
# Misceallenous
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2020-04-20 09:35:22 +03:00
|
|
|
all: install-dependencies install all_examples
|
2020-04-17 13:29:30 +03:00
|
|
|
|
2020-04-30 13:15:26 +03:00
|
|
|
grammar.html: src/catala/parsing/parser.mly
|
|
|
|
obelisk html -o $@ $<
|
|
|
|
|
2020-05-05 18:04:53 +03:00
|
|
|
catala.html: src/catala/cli.ml
|
|
|
|
dune exec src/catala.exe -- --help=groff | groff -T html > $@
|
|
|
|
|
2020-05-07 10:40:09 +03:00
|
|
|
legifrance_catala.html: src/legifrance_catala/main.ml
|
2020-05-05 18:04:53 +03:00
|
|
|
dune exec src/legifrance_catala.exe -- --help=groff | groff -T html > $@
|
|
|
|
|
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
|
|
|
|
$(MAKE) -C $(ENGLISH_DUMMY_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
|
|
|
|
|
|
|
# Special targets
|
|
|
|
|
|
|
|
.PHONY: inspect clean all all_examples english allocations_familiales pygments \
|
2020-04-26 19:42:42 +03:00
|
|
|
install build format install-dependencies install-dependencies-ocaml
|