2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Variables
|
|
|
|
##########################################
|
|
|
|
|
2020-04-20 10:02:08 +03:00
|
|
|
LATEXMK=latexmk
|
|
|
|
|
2020-04-26 21:48:51 +03:00
|
|
|
PYGMENTIZE_FR=../../syntax_highlighting/fr/pygments/pygments/env/bin/pygmentize
|
|
|
|
PYGMENTIZE_EN=../../syntax_highlighting/en/pygments/pygments/env/bin/pygmentize
|
2020-04-20 10:02:08 +03:00
|
|
|
|
2020-12-10 20:11:43 +03:00
|
|
|
CATALA=dune exec --no-print-director ../../src/catala.exe -- $(CATALA_OPTS) --language=$(CATALA_LANG)
|
2020-04-20 20:37:16 +03:00
|
|
|
|
2020-04-23 15:10:38 +03:00
|
|
|
LEGIFRANCE_CATALA=dune exec ../../src/legifrance_catala.exe --
|
2020-04-22 13:50:33 +03:00
|
|
|
|
2020-04-22 12:51:17 +03:00
|
|
|
CATALA_EXE=../../_build/default/src/catala.exe
|
2020-04-20 20:37:16 +03:00
|
|
|
|
2020-04-26 21:48:51 +03:00
|
|
|
ifeq ($(CATALA_LANG),fr)
|
|
|
|
PYGMENTIZE=$(PYGMENTIZE_FR)
|
|
|
|
endif
|
|
|
|
ifeq ($(CATALA_LANG),en)
|
|
|
|
PYGMENTIZE=$(PYGMENTIZE_EN)
|
|
|
|
endif
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Targets
|
|
|
|
##########################################
|
|
|
|
|
2020-12-03 20:59:14 +03:00
|
|
|
%.run: %.catala_$(CATALA_LANG) $(CATALA_EXE)
|
2020-12-10 20:11:43 +03:00
|
|
|
@$(CATALA) Makefile $<
|
|
|
|
@$(CATALA) \
|
2020-12-03 20:59:14 +03:00
|
|
|
Interpret \
|
|
|
|
-s $(SCOPE) \
|
|
|
|
$<
|
|
|
|
|
2020-08-08 20:07:28 +03:00
|
|
|
%.tex: %.catala_$(CATALA_LANG) $(CATALA_EXE)
|
2020-12-10 20:11:43 +03:00
|
|
|
@$(CATALA) Makefile $<
|
2020-04-20 10:05:40 +03:00
|
|
|
$(CATALA) \
|
2020-04-29 10:55:49 +03:00
|
|
|
--wrap \
|
2020-04-20 10:05:40 +03:00
|
|
|
--pygmentize=$(PYGMENTIZE) \
|
2020-04-20 10:02:08 +03:00
|
|
|
LaTeX \
|
|
|
|
$<
|
|
|
|
|
2020-08-08 20:07:28 +03:00
|
|
|
%.html: %.catala_$(CATALA_LANG) $(CATALA_EXE)
|
2020-12-10 20:11:43 +03:00
|
|
|
@$(CATALA) Makefile $<
|
2020-04-29 10:55:49 +03:00
|
|
|
$(CATALA) \
|
|
|
|
--wrap \
|
2020-04-29 12:10:56 +03:00
|
|
|
--pygmentize=$(PYGMENTIZE) \
|
2020-04-29 10:55:49 +03:00
|
|
|
HTML \
|
|
|
|
$<
|
|
|
|
|
2020-04-20 10:02:08 +03:00
|
|
|
%.pdf: %.tex
|
|
|
|
cd $(@D) && $(LATEXMK) -g -pdf -halt-on-error -shell-escape $(%F)
|
|
|
|
|
2020-05-13 15:17:19 +03:00
|
|
|
##########################################
|
|
|
|
# Misceallenous
|
|
|
|
##########################################
|
|
|
|
|
2020-04-20 10:02:08 +03:00
|
|
|
clean:
|
2020-08-08 20:07:28 +03:00
|
|
|
$(LATEXMK) -f -C $(SRC:.catala_$(CATALA_LANG)=.tex)
|
2020-12-18 15:13:51 +03:00
|
|
|
rm -rf $(SRC:.catala_$(CATALA_LANG)=.tex) \
|
|
|
|
$(SRC:.catala_$(CATALA_LANG)=.d) \
|
|
|
|
_minted-$(SRC:.catala_$(CATALA_LANG)=) \
|
|
|
|
$(SRC:.catala_$(CATALA_LANG)=.html)
|
2020-04-20 10:02:08 +03:00
|
|
|
|
2020-08-08 20:07:28 +03:00
|
|
|
include $(wildcard $(SRC:.catala_$(CATALA_LANG)=.d))
|
2020-04-20 20:37:16 +03:00
|
|
|
|
|
|
|
.SECONDARY:
|