64 lines
2.2 KiB
Makefile
64 lines
2.2 KiB
Makefile
|
# TODO : Ajouter les filtres nécessaires pour obtenir un bon rendu. On peut imaginer un fichier dans $(STYLESHEET_DIR) qui indique les différents filtres à appliquer : un petit script dans le make récupère ces noms de fichiers et en fait des arguments de ligne de commande commençant par --filter.
|
|||
|
|
|||
|
INPUT_DATA_DIR = ../Tests-Data
|
|||
|
BIBLIO_FILE = $(INPUT_DATA_DIR)/BIBLIO_CSL-Tests.json
|
|||
|
INPUT_FILE = $(INPUT_DATA_DIR)/CSL-Tests.md
|
|||
|
STYLESHEET_DIR = _CSL-dev
|
|||
|
VALIDATION_FILE_SUFFIX = _CSL-Validation.html
|
|||
|
OUTPUT_FILE_SUFFIX = _CSL-Tests.html
|
|||
|
CSL_FILE_SUFFIX = .csl
|
|||
|
JSON_BIBLIO_UTILITIES_DIR = /home/bdumont/Logiciels/Pandoc-utilities/FileModifiers-Pandoc
|
|||
|
VALIDATION_PROV_FILE = $(PROV_PREFIX)$(JOURNAL)$(VALIDATION_FILE_SUFFIX)
|
|||
|
CSL_FILE = ../$(JOURNAL)$(STYLESHEET_DIR)/$(JOURNAL)$(CSL_FILE_SUFFIX)
|
|||
|
VALIDATION_FILE = ../$(JOURNAL)$(STYLESHEET_DIR)/$(JOURNAL)$(VALIDATION_FILE_SUFFIX)
|
|||
|
OUTPUT_FILE = ../$(JOURNAL)$(STYLESHEET_DIR)/$(JOURNAL)$(OUTPUT_FILE_SUFFIX)
|
|||
|
FILTERS_FILE_FIRST = ../$(JOURNAL)$(STYLESHEET_DIR)/$(JOURNAL)_filters-first.txt
|
|||
|
FILTERS_LIST_FIRST != ./get-filters.sh $(FILTERS_FILE_FIRST)
|
|||
|
FILTERS_FILE_LAST = ../$(JOURNAL)$(STYLESHEET_DIR)/$(JOURNAL)_filters-last.txt
|
|||
|
FILTERS_LIST_LAST != ./get-filters.sh $(FILTERS_FILE_LAST)
|
|||
|
PANDOC_OPTIONS = -s \
|
|||
|
$(FILTERS_LIST_FIRST) \
|
|||
|
-C \
|
|||
|
--bibliography=$(BIBLIO_FILE) \
|
|||
|
--csl=$(CSL_FILE) \
|
|||
|
$(FILTERS_LIST_LAST)
|
|||
|
PROV_PREFIX = PROV_
|
|||
|
HTML-VIEWER = palemoon
|
|||
|
|
|||
|
test : $(CSL_FILE) \
|
|||
|
$(VALIDATION_FILE) \
|
|||
|
$(BIBLIO_FILE) \
|
|||
|
$(INPUT_FILE)
|
|||
|
pandoc $(PANDOC_OPTIONS) \
|
|||
|
$(INPUT_FILE) \
|
|||
|
-o $(OUTPUT_FILE)
|
|||
|
echo "Résultat de la comparaison"
|
|||
|
echo "============="
|
|||
|
diff -s -C 0 \
|
|||
|
$(OUTPUT_FILE) \
|
|||
|
$(VALIDATION_FILE)
|
|||
|
echo "============="
|
|||
|
|
|||
|
validation-prov: $(VALIDATION_PROV_FILE)
|
|||
|
$(HTML-VIEWER) $(VALIDATION_PROV_FILE)
|
|||
|
|
|||
|
$(VALIDATION_PROV_FILE): $(BIBLIO_FILE) $(CSL_FILE) $(INPUT_FILE)
|
|||
|
pandoc $(PANDOC_OPTIONS) \
|
|||
|
$(INPUT_FILE) \
|
|||
|
-o $(VALIDATION_PROV_FILE)
|
|||
|
|
|||
|
$(INPUT_FILE): $(BIBLIO_FILE)
|
|||
|
./generer-md-pour-citeproc.sh $(BIBLIO_FILE) $(INPUT_FILE)
|
|||
|
|
|||
|
$(BIBLIO_FILE): .biblio.stamp
|
|||
|
touch .biblio.stamp
|
|||
|
|
|||
|
.biblio.stamp:
|
|||
|
$(JSON_BIBLIO_UTILITIES_DIR)/correct-json $(BIBLIO_FILE)
|
|||
|
|
|||
|
install: $(VALIDATION_PROV_FILE)
|
|||
|
mv $(VALIDATION_PROV_FILE) $(VALIDATION_FILE)
|
|||
|
|
|||
|
clean:
|
|||
|
rm ../*$(STYLESHEET_DIR)/*$(OUTPUT_FILE_SUFFIX)
|