summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile10
1 files changed, 5 insertions, 5 deletions
diff --git a/makefile b/makefile
index 69cd138..274179b 100644
--- a/makefile
+++ b/makefile
@@ -5,7 +5,7 @@ HTML_MINIFIER_CMD=htmlmin
BASE_HTML=tmp/left.htm tmp/headers.htm
ALL_ARTICLES=$(wildcard articles/*.md)
ALL_ARTICLES_OUT=$(ALL_ARTICLES:.md=.html)
-ALL_ARTICLES_INTRO_OUT=$(addprefix articles/tmp/,$(notdir $(ALL_ARTICLES:.md=_intro.html)))
+ALL_ARTICLES_INTRO_OUT=$(addprefix articles/tmp/,$(shell cat articles_intro_out))
SCRIPT_JS=s/js/main.js
SHEET_CSS=s/css/style.css
@@ -22,7 +22,7 @@ all: $(ALL_ARTICLES_OUT) $(BASE_HTML) index.html contact/index.html $(SHEET_CSS)
# On compile le fichier md vers html (tmp/%.htm)
# On rajoute les headers (tmp/%_header.htm)
# On fini d'ajouter le squelette HTML (articles/%.html
-articles/%.html: articles/%.md $(BASE_HTML)
+articles/%.html: articles/%.md $(BASE_HTML) headers.m4 articles/article.m4
@echo "> Création des articles"
mkdir -p articles/tmp
cat $< | $(MD_CMD) > $(addprefix articles/tmp/,$(notdir $(@:.html=.htm)))
@@ -33,7 +33,7 @@ articles/%.html: articles/%.md $(BASE_HTML)
# On conserve le titre principale (dans tmp/%_intro.htm)
# On y ajoute les deux premiers paragraphe (tmp/%_intro.html)
#
-articles/tmp/%_intro.html: articles/%.html
+articles/tmp/%_intro.html: articles/%.html articles/intro.m4
@echo "> Création des introductions d'articles"
mkdir -p articles/tmp
@cat $< | $(CATCH_CMD) "h1" > $(@:.html=.htm)
@@ -43,7 +43,7 @@ articles/tmp/%_intro.html: articles/%.html
# > Création de la liste des introductions d'articles pour la page principale
# On assemble juste les introductions d'articles ensemble
-tmp/articles.htm: $(ALL_ARTICLES_INTRO_OUT)
+tmp/articles.htm: $(ALL_ARTICLES_INTRO_OUT) articles_intro_out
@echo "> Création de la liste des introductions d'articles"
mkdir -p tmp
cat $(ALL_ARTICLES_INTRO_OUT) > $@
@@ -61,7 +61,7 @@ index.html: index.m4 $(BASE_HTML) tmp/articles.htm
# On compile le markdown en html (contact.htm)
# On ajoute l'entĂȘte avec m4 (contact_header.html)
# On ajoute le reste du squelette avec m4 (contact.html)
-contact/index.html: contact/index.md
+contact/index.html: contact/index.md headers.m4 articles/article.m4
@echo "> Création de la page de contact"
$(MD_CMD) $< > $(@:.html=.htm)
m4 -D TITLE_TITLE="`grep h1 $(@:.html=.htm) | cut -d'>' -f 2 | cut -d'<' -f 1`" headers.m4 > $(basename $@)_header.html