From 94189dbe098782b6bb5e55443f60359764e11fff Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Mon, 28 Feb 2011 14:18:57 +0100 Subject: [PATCH] =?UTF-8?q?S=C3=A9paration=20fichier=20index.html=20et=20f?= =?UTF-8?q?ichier=20css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index 67d71fe..a5b54a6 100644 --- a/makefile +++ b/makefile @@ -18,19 +18,18 @@ CSS_NOM = defaut.css TITRE = Titre par défaut ACCUEIL = Accueil - $(TITRE) ## utiles pour le makefile +dependances_index = entete.html enqueue.html PROG_ECHO = `which echo` ## facultatives #MENU = menu.html # création de tous les fichiers -all: test index +all: test index.html # divers tests sur l'existence des dossiers/fichiers # création si besoin test: @$(PROG_ECHO) -e "Lancement des tests…" - @test -f entete.html || exit - @test -f enqueue.html || exit @test -d img || mkdir img @test -d categ || mkdir categ @test -d style || mkdir style @@ -41,16 +40,21 @@ test: @test -d $(DESTINATION)/image || mkdir $(DESTINATION)/image @$(PROG_ECHO) -e "\t…terminé." +# création du fichier CSS +css: + @$(PROG_ECHO) -e "Création du fichier CSS…" + @cp style/$(CSS_DEFAUT) $(DESTINATION)/$(CSS_NOM) + $(if $(MENU), @patch -u -p0 $(DESTINATION)/$(CSS_NOM) style/$(CSS_PATCH_AJOUT_MENU)) + @$(PROG_ECHO) -e "\t…terminée." + # création de la page d'index -index: +index.html: css $(dependances_index) @$(PROG_ECHO) -e "Création de la page de garde…" $(if $(MENU), @cat entete.html menu.html enqueue.html > $(INDEX), @cat entete.html enqueue.html > $(INDEX)) @$(PROG_ECHO) -e "\t…terminée." @$(PROG_ECHO) -e "Modification du contenu…" @sed -i "s/TITRE_PORTEAIL/$(TITRE)/g" $(INDEX) @sed -i "s/ACCUEIL_PORTEAIL/$(ACCUEIL)/g" $(INDEX) - @cp style/$(CSS_DEFAUT) $(DESTINATION)/$(CSS_NOM) - $(if $(MENU), @patch -u -p0 $(DESTINATION)/$(CSS_NOM) style/$(CSS_PATCH_AJOUT_MENU)) @sed -i "s#CSS_DEFAUT#./$(CSS_NOM)#g" $(INDEX) @$(PROG_ECHO) -e "\t…terminée."