[MàJ] Changements dans le fichier de configuration :

* Ajout de INTRO_ADDR pour l'adresse exacte du fichier d'introduction
  * INTRO est désormais uniquement le nom du fichier
  * DESTINATION -> CIBLE
  * categ -> CATEGORIES
  * Adaptation du Makefile en fonction des changements effectués
  * Mise à jour de la documentation
This commit is contained in:
Olivier DOSSMANN
2012-02-20 16:42:29 +01:00
parent 0904ebabcd
commit 60306fdb2a
3 changed files with 43 additions and 39 deletions

View File

@ -29,7 +29,7 @@
include configrc
## autre configurations
dependances_index = $(entete) $(enqueue) $(contenu_fin)
SOURCE = $(categ)/*.$(ext)
SOURCE = $(CATEGORIES)/*.$(ext)
# programmes
PROG_ECHO = `which echo`
PROG_TEST = `which test`
@ -93,39 +93,39 @@ test:
$(if $(error_find), @$(PROG_ECHO) -e "\t\tfind : MANQUANT." ; exit 1)
$(if $(error_sort), @$(PROG_ECHO) -e "\t\tsort : MANQUANT." ; exit 1)
$(if $(error_wc), @$(PROG_ECHO) -e "\t\twc : MANQUANT." ; exit 1)
@$(PROG_ECHO) -e "\t…existence des dossiers img, categ et style"
@$(PROG_ECHO) -e "\t…existence des dossiers 'img', '$(CATEGORIES)' et 'style'"
@$(PROG_TEST) -d img || mkdir img
@$(PROG_TEST) -d $(categ) || mkdir $(categ)
@$(PROG_TEST) -d $(CATEGORIES) || mkdir $(CATEGORIES)
@$(PROG_TEST) -d style || mkdir style
@$(PROG_ECHO) -e "\t…option introduction dans la page"
$(if $(INTRO), @$(PROG_TEST) -f $(INTRO) || exit 1)
$(if $(INTRO), @$(PROG_TEST) -f $(INTRO_ADDR) || exit 1)
$(if $(INTRO), @$(PROG_ECHO) -e "\t\t-> activée", @$(PROG_ECHO) -e "\t\t-> désactivée")
@$(PROG_ECHO) -e "\t…option ajout d'un menu (vérification de l'existence)"
$(if $(MENU), @$(PROG_TEST) -f $(MENU) || exit 1)
$(if $(MENU), @$(PROG_ECHO) -e "\t\t-> activée", @$(PROG_ECHO) -e "\t\t-> désactivée")
@$(PROG_ECHO) -e "\t…création de la destination"
@$(PROG_TEST) -d $(DESTINATION) || mkdir $(DESTINATION)
@$(PROG_TEST) -d $(CIBLE) || mkdir $(CIBLE)
@$(PROG_ECHO) -e "\t…création du dossier '$(dest_image)'"
@$(PROG_TEST) -d $(DESTINATION)/$(dest_image) || mkdir $(DESTINATION)/$(dest_image)
@$(PROG_TEST) -d $(CIBLE)/$(dest_image) || mkdir $(CIBLE)/$(dest_image)
@$(PROG_ECHO) -e " …terminé."
# création du fichier CSS
$(DESTINATION)/$(CSS_NOM): $(dependances_css)
$(CIBLE)/$(CSS_NOM): $(dependances_css)
@$(PROG_ECHO) -e "Création du fichier CSS…"
$(if $(MENU), @$(PROG_CP) style/$(CSS_AVEC_MENU) $(DESTINATION)/$(CSS_NOM), @$(PROG_CP) style/$(CSS_SANS_MENU) $(DESTINATION)/$(CSS_NOM))
$(if $(MENU), @$(PROG_CP) style/$(CSS_AVEC_MENU) $(CIBLE)/$(CSS_NOM), @$(PROG_CP) style/$(CSS_SANS_MENU) $(CIBLE)/$(CSS_NOM))
@$(PROG_ECHO) -e " …terminée."
# création du fichier CSS de couleur
$(DESTINATION)/$(STYLE): style/$(STYLE)
$(CIBLE)/$(STYLE): style/$(STYLE)
@$(PROG_ECHO) -e "Création du fichier CSS pour les couleurs…"
@$(PROG_CP) style/$(STYLE) $(DESTINATION)/$(STYLE)
@$(PROG_CP) style/$(STYLE) $(CIBLE)/$(STYLE)
@$(PROG_ECHO) -e " …terminée."
# création du fichier $(contenu)
$(contenu): $(script_contenu) $(SOURCE) $(image_defaut)
@$(PROG_SED) -i "s/DEBUG=1/DEBUG=0/g" $(script_contenu)
@$(PROG_ECHO) -e "Création du contenu avec les valeurs suivantes : "
@$(PROG_ECHO) -e "\t\t- Dossier catégorie : $(categ)"
@$(PROG_ECHO) -e "\t\t- Dossier catégorie : $(CATEGORIES)"
@$(PROG_ECHO) -e "\t\t- Destination temporaire du contenu : $(contenu)"
@$(PROG_ECHO) -e "\t\t- Extension des fichiers à lire : $(ext)"
@$(PROG_ECHO) -e "\t\t- Dossier ayant les composants de la page : $(composants)"
@ -135,12 +135,12 @@ $(contenu): $(script_contenu) $(SOURCE) $(image_defaut)
@$(PROG_ECHO) -e "\t\t- Dossier contenant les images sources : $(image)"
@$(PROG_ECHO) -e "\t\t- Dossier de destination des images : $(dest_image)"
@$(PROG_ECHO) -e "\t\t- Image par défaut : $(image_defaut)"
@$(PROG_ECHO) -e "\t\t- Dossier de destination global : $(DESTINATION)"
@$(PROG_SH) $(script_contenu) $(categ) $(contenu) $(ext) $(composants) $(categ_deb) $(categ_fin) $(elem) $(image) $(dest_image) $(image_defaut) $(DESTINATION)
@$(PROG_ECHO) -e "\t\t- Dossier de destination global : $(CIBLE)"
@$(PROG_SH) $(script_contenu) $(CATEGORIES) $(contenu) $(ext) $(composants) $(categ_deb) $(categ_fin) $(elem) $(image) $(dest_image) $(image_defaut) $(CIBLE)
# création de la page d'index
index: $(INDEX)
$(INDEX): $(COMPOSANTS) $(DESTINATION)/$(CSS_NOM) $(dependances_index) $(contenu) $(DESTINATION)/$(STYLE)
$(INDEX): $(COMPOSANTS) $(CIBLE)/$(CSS_NOM) $(dependances_index) $(contenu) $(CIBLE)/$(STYLE)
@$(PROG_ECHO) -e "Création de la page de garde…"
# entete
@$(PROG_ECHO) -e "\t…insertion de l'entête"
@ -156,7 +156,7 @@ $(INDEX): $(COMPOSANTS) $(DESTINATION)/$(CSS_NOM) $(dependances_index) $(contenu
$(INDEX)
@$(PROG_ECHO) -e "\t …contenu modifié avec succès !"
# introduction (SI la variable INTRO est remplie)
$(if $(INTRO), @cat $(INTRO) >> $(INDEX); $(PROG_ECHO) -e "\t…insertion de l'introduction" || exit 1)
$(if $(INTRO), @cat $(INTRO_ADDR) >> $(INDEX); $(PROG_ECHO) -e "\t…insertion de l'introduction" || exit 1)
# contenu
@$(PROG_ECHO) -e "\t…insertion du contenu"
@$(PROG_CAT) $(contenu) >> $(INDEX)
@ -173,6 +173,6 @@ $(INDEX): $(COMPOSANTS) $(DESTINATION)/$(CSS_NOM) $(dependances_index) $(contenu
# nettoyage des fichiers générés
clean:
@$(PROG_ECHO) -e "Nettoyage des fichiers en cours…"
@$(PROG_RM) -rf $(DESTINATION)
@$(PROG_RM) -rf $(CIBLE)
@$(PROG_RM) -f $(contenu)
@$(PROG_ECHO) -e " …terminé."