Séparation fichier index.html et fichier css
This commit is contained in:
		
							
								
								
									
										16
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								makefile
									
									
									
									
									
								
							@@ -18,19 +18,18 @@ CSS_NOM = defaut.css
 | 
				
			|||||||
TITRE = Titre par défaut
 | 
					TITRE = Titre par défaut
 | 
				
			||||||
ACCUEIL = Accueil - $(TITRE)
 | 
					ACCUEIL = Accueil - $(TITRE)
 | 
				
			||||||
## utiles pour le makefile
 | 
					## utiles pour le makefile
 | 
				
			||||||
 | 
					dependances_index = entete.html enqueue.html
 | 
				
			||||||
PROG_ECHO = `which echo`
 | 
					PROG_ECHO = `which echo`
 | 
				
			||||||
## facultatives
 | 
					## facultatives
 | 
				
			||||||
#MENU = menu.html
 | 
					#MENU = menu.html
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# création de tous les fichiers
 | 
					# création de tous les fichiers
 | 
				
			||||||
all: test index
 | 
					all: test index.html
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# divers tests sur l'existence des dossiers/fichiers
 | 
					# divers tests sur l'existence des dossiers/fichiers
 | 
				
			||||||
# création si besoin
 | 
					# création si besoin
 | 
				
			||||||
test:
 | 
					test:
 | 
				
			||||||
	@$(PROG_ECHO) -e "Lancement des tests…"
 | 
						@$(PROG_ECHO) -e "Lancement des tests…"
 | 
				
			||||||
	@test -f entete.html || exit
 | 
					 | 
				
			||||||
	@test -f enqueue.html || exit
 | 
					 | 
				
			||||||
	@test -d img || mkdir img
 | 
						@test -d img || mkdir img
 | 
				
			||||||
	@test -d categ || mkdir categ
 | 
						@test -d categ || mkdir categ
 | 
				
			||||||
	@test -d style || mkdir style
 | 
						@test -d style || mkdir style
 | 
				
			||||||
@@ -41,16 +40,21 @@ test:
 | 
				
			|||||||
	@test -d $(DESTINATION)/image || mkdir $(DESTINATION)/image
 | 
						@test -d $(DESTINATION)/image || mkdir $(DESTINATION)/image
 | 
				
			||||||
	@$(PROG_ECHO) -e "\t…terminé."
 | 
						@$(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
 | 
					# création de la page d'index
 | 
				
			||||||
index:
 | 
					index.html: css $(dependances_index)
 | 
				
			||||||
	@$(PROG_ECHO) -e "Création de la page de garde…"
 | 
						@$(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))
 | 
						$(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 "\t…terminée."
 | 
				
			||||||
	@$(PROG_ECHO) -e "Modification du contenu…"
 | 
						@$(PROG_ECHO) -e "Modification du contenu…"
 | 
				
			||||||
	@sed -i "s/TITRE_PORTEAIL/$(TITRE)/g" $(INDEX)
 | 
						@sed -i "s/TITRE_PORTEAIL/$(TITRE)/g" $(INDEX)
 | 
				
			||||||
	@sed -i "s/ACCUEIL_PORTEAIL/$(ACCUEIL)/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)
 | 
						@sed -i "s#CSS_DEFAUT#./$(CSS_NOM)#g" $(INDEX)
 | 
				
			||||||
	@$(PROG_ECHO) -e "\t…terminée."
 | 
						@$(PROG_ECHO) -e "\t…terminée."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user