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-04-20 19:47:31 +03:00
|
|
|
CATALA_LANG?=fr
|
|
|
|
|
2020-04-21 13:25:52 +03:00
|
|
|
CATALA=dune exec ../../src/catala.exe -- --debug --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-22 13:50:33 +03:00
|
|
|
LEGIFRANCE_CATALA_EXE=../../_build/default/src/legifrance_catala.exe
|
|
|
|
|
|
|
|
CLIENT_ID?=$(shell cat ../../legifrance_oauth_id.txt)
|
|
|
|
CLIENT_SECRET?=$(shell cat ../../legifrance_oauth_secret.txt)
|
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-04-20 20:37:16 +03:00
|
|
|
%.tex: %.catala $(CATALA_EXE)
|
|
|
|
$(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-04-29 10:55:49 +03:00
|
|
|
%.html: %.catala $(CATALA_EXE)
|
|
|
|
$(CATALA) Makefile $<
|
|
|
|
$(CATALA) \
|
|
|
|
--wrap \
|
2020-04-29 12:10:56 +03:00
|
|
|
--pygmentize=$(PYGMENTIZE) \
|
2020-04-29 10:55:49 +03:00
|
|
|
HTML \
|
|
|
|
$<
|
|
|
|
|
2020-04-22 13:50:33 +03:00
|
|
|
%.expired: %.catala $(CATALA_EXE) $(LEGIFRANCE_CATALA_EXE)
|
|
|
|
$(LEGIFRANCE_CATALA) $< $(CLIENT_ID) $(CLIENT_SECRET)
|
|
|
|
|
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:
|
|
|
|
$(LATEXMK) -f -C $(SRC:.catala=.tex)
|
|
|
|
rm -rf $(SRC:.catala=.tex) $(SRC:.catala=.d) _minted-$(SRC:.catala=)
|
|
|
|
|
|
|
|
include $(wildcard $(SRC:.catala=.d))
|
2020-04-20 20:37:16 +03:00
|
|
|
|
|
|
|
.SECONDARY:
|