ifeq "$(CFLAGS)" "pedantic"
CFLAGS := -g -W -Wall -pedantic -ansi
endif
ifeq "$(CFLAGS)" "O"
CFLAGS := -g -W -Wall -O
else
CFLAGS := -g -W -Wall
endif


### Liste des sources

SOURCE_FILES=ALT1_afficher.c ALT1_afficher.h ALT2_afficher.c Combien.c Hal.c Makefile Makefile.afficher Makefile.all affect_vecteur.c affiche_caracteres.c affiche_caracteres.h afficher.c afficher.h arguments.c argv_pp.c automatic.c avec_reg.c caractere_suivant.c caractere_suivant.h caracteres.c chaines.c chaines_concat.c collate.c compte_bits.c compte_bits.h compter.c delta.c dichotomie.c dichotomie.h divi.c divi.h do_while.c dynam_ini.c effet_de_bord.c encadre.c err_aff_vecteur.c erreur_auto.c Pi.c pi.c fonction_par.c h_somme.c ident_fonc.c ident_vect.c ill-ass.c implementation_de_enr.c ini_chn_vct.c longuechaine.c main.c main_compte_bits.c main_divi.c main_divi.h divi.h divi.c main_no_return.c maxmot.c memfaute.c motif.c test_ec_tailles.c piege_taille.c ec_tailles.h nultest.c optimisation.c permanente.c premier_programme.c pyra.c racines.c representation_neg.c return_exit.c sans_reg.c subsep_decoupe.c subsep_en_vrac.c subsep_indent.c sw.c sw_break.c taille.c test_dichotomie.c tri3.c tri3car.c tri3car.h tri3int.c tri3int.h triangle.c trigraph.E trigraph.c types.c u_caracteres.c unsigned.c promo_intgr.c variable_globale.c variable_globale.h variable_globale_main.c portee.c volatile.c wcstombs.c while_do.c whileplusplus.c defs.h booleen.h booleen.c autre_booleen.h tbool.c redefinitions.c unites.h test_unites.c errdef.c LINEFILE.c version.c exit_if.h exit_if.c test_exit_if_1.c test_exit_if_2.c recdef.c inc_ab.c inc_a.h inc_b.h debug.h debug.c cppif.c line.c pile.h test_pile.c test_pile.c_E linux.h include.c errabs.c error.c typo.c ctype.c majuscule-2.c test_typo.c  autre_triangle.c generateur.c generateur.h e_suite.c e_suite.h stat.h stat.c st.def st.c stat_ni.c classe.h roue_num.h instancier.h test_instancier.c roue_num.c deux_roues.c test_historique.c test_historique.def historique.c historique.h totalisateur.h totalisateur.c compteur.c plaque.c compteur_silencieux.c vecteur.h vecteur.c test_vecteur.c pilegen.h pilegen.c test_pilegen.c format1.c format2.c deformat.c format_etoile.c btob.c auto.c reopen.c noredir.c genere_programme.c lignes.c accind.h accind_flot.c accind_basniveau.c ai_consultation.c ai_saisie.c tampon.c eof.c pgm.c pgm.h pgmmake.c pgmmake_with_atexit.c grepenv.c cputime.h mesurer.c cputime.c tramage.c image_grisee.c fonctions_math.c trier_chercher.c raise.c signal.c majuscule.c moyenne.c chaine_trier.c chaine_trier.h test_chaine_trier.c heure_approximative.c heure_approximative.h heure.c nom_de_base.h nom_de_base.c nomcmd.c chaine.h chaine.c perror.c format_numerique.c lire_chaine.c lire_chaine.h test_lirechaine.c options.h options.c extropts.c malldmp.h malldmp.c allocation.h allocation.c dmpchn.c itob.c assert.h racine.c quel_jour_est_le.c date_locale.c hms.h hms.c test_hms.c concatener.c concatener.h test_concatener.c test_formater.c message.c test_message.c message.h formater.h formater.c exemple_system.c err_contexte.c tmpname.c err_format.c strtol.c deformat.c defiler_entier.c erreurs.c erreurs.h pluriel.h pluriel.c lecture_controlee.c lecture_zone.h lecture_zone.c terminal.h petit.c plus_gros.c vraiment_plus_gros.c pid.c nom_unique.c nom_unique.h test_nom_unique.c chiffres.c test_chiffres.c info6tem.c fg_bg.c tzname.c configuration noredir_posix.c lsdates.c idem.c mode.c reculer.c test_umask.c lsg.c retenir.c test_verrou.c verrou.c verrou.h fermer.c allocation_descripteurs.c redirection.c lecture_terminal.c lire_FIFO.c ecrire_FIFO.c lectures_non_bloquantes.c charger.c filtre.c charger.h signal_posix.c fork.c lancer.c execenv.c autokill.c systeme.c test_systeme.c tube.c pApB.c processus_1.c processus_2.c tuber.h tuber.c detourner.c trace_alloc.c memcpy.c test_chaine.c usertime.h chiffres.h terminal.c configuration.c systeme.h typo.h st.def st.def-2 st.def-1 test_lep.c getchar.c flock.c trivial_es.c zero.c ABS.c fl.c

SOURCE_DIRS=generateur_elementaire generateur_messages generateur_parametres 
#totalisateur_retenue

### Listes des objets et des excutables

OB_01 = ALT1_afficher.o Combien.o Hal.o affiche_caracteres.o afficher.o arguments.o delta.o divi.o encadre.o Pi.o pi.o h_somme.o main.o main_divi.o premier_programme.o pyra.o racines.o subsep_decoupe.o subsep_en_vrac.o subsep_indent.o taille.o 

BUT_01 = premier_programme afficher ALT1_afficher Pi pi h_somme Combien Hal delta divi racines encadre taille pyra arguments subsep_en_vrac subsep_decoupe 


OB_02 = caractere_suivant.o chaines.o dynam_ini.o erreur_auto.o ini_chn_vct.o memfaute.o motif.o optimisation.o permanente.o sans_reg.o avec_reg.o avec_reg_O1.o sans_reg_O1.o avec_reg_O2.o sans_reg_O2.o avec_reg_O3.o sans_reg_O3.o tri3.o tri3.o tri3car.o tri3int.o types.o unsigned.o promo_intgr.o variable_globale.o variable_globale_main.o portee.o volatile.o petit.o plus_gros.o vraiment_plus_gros.o

BUT_02 = unsigned promo_intgr memfaute chaines caractere_suivant.o variable_globale tri3 portee permanente erreur_auto sans_reg avec_reg sans_reg_O1 sans_reg_O2 sans_reg_O3 avec_reg_O1 avec_reg_O2 avec_reg_O3 optimisation volatile types ini_chn_vct dynam_ini motif portee petit plus_gros vraiment_plus_gros


OB_03 = affect_vecteur.o argv_pp.o caracteres.o chaines_concat.o compte_bits.o effet_de_bord.o err_aff_vecteur.o fonction_par.o ident_fonc.o ident_vect.o implementation_de_enr.o longuechaine.o main_compte_bits.o test_ec_tailles.o piege_taille.o nultest.o trigraph.o u_caracteres.o pluriel.o

BUT_03 = trigraph caracteres u_caracteres longuechaine chaines_concat ident_vect fonction_par ident_fonc compte_bits implementation_de_enr test_ec_tailles piege_taille nultest affect_vecteur argv_pp effet_de_bord


OB_04 = compter.o dichotomie.o do_while.o maxmot.o return_exit.o sw.o sw_break.o test_dichotomie.o triangle.o while_do.o whileplusplus.o

BUT_04 = sw sw_break compter while_do do_while whileplusplus triangle maxmot dichotomie return_exit.o 


OB_05 =  LINEFILE.o debug.o exit_if.o test_exit_if_1.o test_exit_if_2.o test_unites.o test_unites.o test_pile.o version.o tbool.o erreurs.o

BUT_05 = tbool test_unites LINEFILE version test_exit_if_1 test_exit_if_2 debug test_pile


OB_06 = perror.o allocation.o auto.o nom_de_base.o moyenne.o chaine.o chaine.o chaine_trier.o concatener.o dmpchn.o err_contexte.o exemple_system.o extropts.o format1.o format2.o deformat.o format_etoile.o btob.o formater.o message.o test_message.o heure.o hms.o heure_approximative.o itob.o perror.o format_numerique.o lire_chaine.o lire_chaine.o tramage.o image_grisee.o fonctions_math.o trier_chercher.o raise.o signal.o pgm.o pgmmake.o pgmmake_with_atexit.o grepenv.o cputime.o mesurer.o ctype.o majuscule.o malldmp.o nomcmd.o noredir.o options.o options.o racine.o reopen.o genere_programme.o lignes.o accind.o accind_flot.o ai_consultation.o ai_saisie.o tampon.o eof.o test_chaine.o test_chaine_trier.o test_concatener.o test_formater.o test_hms.o test_lirechaine.o trace_alloc.o memcpy.o quel_jour_est_le.o date_locale.o tmpname.o err_format.o defiler_entier.o chiffres.o test_chiffres.o

BUT_06 = perror format_numerique format1 format2 deformat format_etoile btob auto reopen noredir genere_programme lignes ai_consultation_f ai_saisie_f tampon eof tramage image_grisee fonctions_math trier_chercher raise signal ctype majuscule moyenne test_chaine_trier heure nomcmd test_lirechaine extropts dmpchn itob racine quel_jour_est_le date_locale test_hms test_concatener test_formater test_message exemple_system err_contexte trace_alloc memcpy test_chaine tmpname err_format defiler_entier pgmmake pgmmake_with_atexit grepenv mesurer test_chiffres


OB_07 = lecture_controlee.o lecture_zone.o pid.o test_nom_unique.o nom_unique.o info6tem.o fg_bg.o tzname.o configuration.o noredir_posix.o lsdates.o idem.o mode.o reculer.o test_umask.o lsg.o retenir.o test_verrou.o verrou.o fermer.o allocation_descripteurs.o redirection.o lecture_terminal.o lire_FIFO.o ecrire_FIFO.o lectures_non_bloquantes.o charger.o filtre.o signal_posix.o fork.o lancer.o execenv.o autokill.o systeme.o test_systeme.o tube.o pApB.o processus_1.o processus_2.o tuber.o detourner.o terminal.o test_lep.o getchar.o flock.o trivial_es.o

BUT_07 = lecture_controlee pid test_nom_unique info6tem fg_bg tzname configuration noredir_posix lsdates idem mode reculer test_umask lsg retenir test_verrou fermer.o allocation_descripteurs redirection lecture_terminal lire_FIFO ecrire_FIFO lectures_non_bloquantes filtre signal_posix fork lancer execenv autokill test_systeme tube pApB processus_1 processus_2 detourner test_lep getchar.o flock trivial_es

OB_08 = autre_triangle.o historique.o compteur.o test_typo.o typo.o majuscule-2.o stat.o st.o stat-ni.o vecteur.o test_vecteur.o pilegen.o test_pilegen.o  test_historique.o test_instancier.o deux_roues.o totalisateur.o generateur.o plaque.o roue_num.o stat_ni.o

BUT_08 = test_typo majuscule-2 autre_triangle st st-ni test_instancier deux_roues historique compteur plaque test_vecteur test_pilegen test_historique

BUTD_08 = generateur_elementaire generateur_messages generateur_parametres 
#totalisateur_retenue

BUTS = $(BUTD_08) $(BUT_01) $(BUT_02) $(BUT_03) $(BUT_04) $(BUT_05) $(BUT_06) $(BUT_07) $(BUT_08) 


### Entrees generales

all: $(BUTS)

.PHONY : pall
pall :
	CFLAGS="pedantic" ; make all

.PHONY : pO
Oall :
	CFLAGS="O" ; make all


clean: cl01 cl02 cl03 cl04 cl05 cl06 cl07 cl08
	clean -a -r

.PHONY : cl01 
cl01 : 
	rm -f $(BUT_01) $(OB_01)
.PHONY : cl02 
cl02 : 
	rm -f $(BUT_02) $(OB_02)
.PHONY : cl03 
cl03 : 
	rm -f $(BUT_03) $(OB_03)
.PHONY : cl04 
cl04 : 
	rm -f $(BUT_04) $(OB_04)
.PHONY : cl05 
cl05 : 
	rm -f $(BUT_05) $(OB_05)
.PHONY : cl06
cl06 :
	rm -f $(BUT_06) $(OB_06)
.PHONY : cl07 
cl07 : 
	rm -f $(BUT_07) $(OB_07)
.PHONY : cl08 
cl08 : 
	rm -f $(BUT_08) $(OB_08)
	for N in $(BUTD_08); do make -C $$N clean ; done 


### Chapitre 1

premier_programme :	premier_programme.o

afficher : main.o afficher.o
main.o : main.c afficher.h
afficher.o : afficher.c afficher.h

ALT1_afficher : main.o ALT1_afficher.o
ALT1_afficher.o : ALT1_afficher.c afficher.h

Pi : Pi.o
	$(CC) Pi.o -lm -o Pi

pi : pi.o
	$(CC) pi.o -lm -o pi

h_somme : h_somme.o

Combien : Combien.o

Hal : Hal.o

delta : delta.o

divi : main_divi.o divi.o
main_divi.o: main_divi.c main_divi.h divi.h
divi.o: divi.c divi.h main_divi.h

racines : racines.o
	$(CC) -lm racines.o -o racines


encadre : encadre.o affiche_caracteres.o
affiche_caracteres.o: affiche_caracteres.c affiche_caracteres.h
encadre.o: encadre.c affiche_caracteres.h

taille : taille.o

pyra : pyra.o affiche_caracteres.o
pyra.o: pyra.c affiche_caracteres.h

arguments : arguments.o

subsep_en_vrac : subsep_en_vrac.o

subsep_decoupe : subsep_decoupe.o

subsep_indent : subsep_indent.o


### Chapitre 2

unsigned : unsigned.o

promo_intgr : promo_intgr.o

memfaute : memfaute.o

chaines : chaines.o

caractere_suivant.o : caractere_suivant.c caractere_suivant.h

variable_globale : variable_globale_main.o variable_globale.o
variable_globale.o : variable_globale.c variable_globale.h
variable_globale_main.o : variable_globale_main.c variable_globale.h

tri3 : tri3car.o tri3int.o tri3.o
tri3car.o : tri3car.c tri3car.h
tri3int.o : tri3int.c tri3int.h
tri3.o : tri3.c tri3car.h tri3int.h

portee : portee.o

permanente : permanente.o

erreur_auto : erreur_auto.o

sans_reg : sans_reg.o

avec_reg : avec_reg.o

sans_reg_O1 : sans_reg_O1.o
sans_reg_O1.o : sans_reg.c
	$(CC) -c $(CFLAGS) -O1 sans_reg.c -o sans_reg_O1.o

avec_reg_O1 : avec_reg_O1.o
avec_reg_O1.o : avec_reg.c
	$(CC) -c $(CFLAGS) -O1 avec_reg.c -o avec_reg_O1.o

sans_reg_O2 : sans_reg_O2.o
sans_reg_O2.o : sans_reg.c
	$(CC) -c $(CFLAGS) -O2 sans_reg.c -o sans_reg_O2.o

avec_reg_O2 : avec_reg_O2.o
avec_reg_O2.o : avec_reg.c
	$(CC) -c $(CFLAGS) -O2 avec_reg.c -o avec_reg_O2.o

sans_reg_O3 : sans_reg_O3.o
sans_reg_O3.o : sans_reg.c
	$(CC) -c $(CFLAGS) -O3 sans_reg.c -o sans_reg_O3.o

avec_reg_O3 : avec_reg_O3.o
avec_reg_O3.o : avec_reg.c
	$(CC) -c $(CFLAGS) -O3 avec_reg.c -o avec_reg_O3.o

optimisation : optimisation.o

volatile : volatile.o

types : types.o

ini_chn_vct : ini_chn_vct.o

dynam_ini : dynam_ini.o

motif : motif.o

petit.o: petit.c
plus_gros.o: plus_gros.c
vraiment_plus_gros.o: vraiment_plus_gros.c

### Chapitre 3

trigraph : trigraph.o
trigraph.o : trigraph.c
	$(CC) $(CFLAGS) -ansi -c trigraph.c 

caracteres : caracteres.o

u_caracteres : u_caracteres.o

longuechaine : longuechaine.o

chaines_concat : chaines_concat.o

ident_vect : ident_vect.o

compte_bits : main_compte_bits.o compte_bits.o
compte_bits.o : compte_bits.c compte_bits.h
main_compte_bits.o : main_compte_bits.c compte_bits.h

err_aff_vecteur : err_aff_vecteur.o

ident_fonc : ident_fonc.o

fonction_par : fonction_par.o

implementation_de_enr : implementation_de_enr.o

pluriel.o: pluriel.c pluriel.h

test_ec_tailles : test_ec_tailles.o pluriel.o
test_ec_tailles.o: test_ec_tailles.c ec_tailles.h pluriel.h

piege_taille : piege_taille.o
piege_taille.o: piege_taille.c ec_tailles.h

nultest : nultest.o

affect_vecteur : affect_vecteur.o

argv_pp : argv_pp.o

effet_de_bord : effet_de_bord.o


### Chapitre 4

sw : sw.o

sw_break : sw_break.o

compter : compter.o pluriel.o

while_do : while_do.o

do_while : do_while.o

whileplusplus : whileplusplus.o

triangle : triangle.o

maxmot : maxmot.o

dichotomie : test_dichotomie.o dichotomie.o
test_dichotomie.o : test_dichotomie.c dichotomie.h
dichotomie.o : dichotomie.c dichotomie.h

return_exit.o : return_exit.c

### Chapitre 5

#include : include.o
#include.o : include.c linux.h

tbool : tbool.o
tbool.o: tbool.c autre_booleen.h

test_unites : test_unites.o 
test_unites.o: test_unites.c unites.h

LINEFILE: LINEFILE.o

version: version.o

exit_if.o: exit_if.c exit_if.h erreurs.h
erreurs.o: erreurs.c erreurs.h

test_exit_if_1: test_exit_if_1.o exit_if.o
test_exit_if_1.o: test_exit_if_1.c exit_if.h

test_exit_if_2: test_exit_if_2.o exit_if.o erreurs.o
test_exit_if_2.o: test_exit_if_2.c exit_if.h erreurs.h


debug: debug.o
debug.o: debug.c debug.h
	$(CC) $(CFLAGS) -c -DDEBUG debug.c

test_pile: test_pile.o
test_pile.o: test_pile.c pile.h


### Chapitre 6

perror : perror.o
	$(CC) -lm perror.o -o perror

format_numerique : format_numerique.o
format_numerique.o: format_numerique.c

lire_chaine.o: lire_chaine.c lire_chaine.h exit_if.h erreurs.h
chaine.o: chaine.c exit_if.h erreurs.h chaine.h
options.o: options.c exit_if.h erreurs.h options.h

format1 : format1.o
format1.o: format1.c

format2 : format2.o
format2.o: format2.c

deformat : deformat.o

format_etoile : format_etoile.o pluriel.o
format_etoile.o: format_etoile.c pluriel.h

btob : btob.o
 
auto : auto.o
auto.o: auto.c

err_format: err_format.o
err_format.o : err_format.c

defiler_entier : defiler_entier.o
defiler_entier.o : defiler_entier.c

reopen : reopen.o
reopen.o: reopen.c

noredir : noredir.o
noredir.o: noredir.c

tmpname : tmpname.o
tmpname.o: tmpname.c

genere_programme : genere_programme.o
genere_programme.o: genere_programme.c

lignes : lignes.o
lignes.o: lignes.c

ai_consultation_f : ai_consultation.o accind_flot.o
	$(CC) ai_consultation.o accind_flot.o -o ai_consultation_f
ai_saisie_f : ai_saisie.o lire_chaine.o accind_flot.o exit_if.o erreurs.o
	$(CC) ai_saisie.o lire_chaine.o exit_if.o erreurs.o accind_flot.o -o ai_saisie_f

ai_consultation.o: ai_consultation.c accind.h
ai_saisie.o: ai_saisie.c lire_chaine.h accind.h
accind_flot.o: accind_flot.c accind.h

pgmmake : pgmmake.o pgm.o exit_if.o erreurs.o
pgmmake.o: pgmmake.c pgm.h
pgm.o: pgm.c exit_if.h erreurs.h pgm.h

pgmmake_with_atexit : pgmmake_with_atexit.o pgm.o exit_if.o erreurs.o
pgmmake_with_atexit.o: pgmmake_with_atexit.c pgm.h

grepenv : grepenv.o chaine.o exit_if.o erreurs.o
grepenv.o: grepenv.c chaine.h

mesurer: mesurer.o cputime.o
mesurer.o: mesurer.c cputime.h
cputime.o: cputime.c usertime.h

tampon : tampon.o
tampon.o: tampon.c

eof : eof.o
eof.o : eof.c

tramage : tramage.o pgm.o exit_if.o erreurs.o
tramage.o: tramage.c pgm.h

image_grisee : image_grisee.o pgm.o exit_if.o erreurs.o
image_grisee.o: image_grisee.c pgm.h

fonctions_math : fonctions_math.o pgm.o exit_if.o erreurs.o
	$(CC) -lm fonctions_math.o pgm.o exit_if.o erreurs.o -o fonctions_math

test_chiffres : test_chiffres.o chiffres.o  
	$(CC) -lm test_chiffres.o chiffres.o -o test_chiffres

chiffres.o: chiffres.c chiffres.h
test_chiffres.o: test_chiffres.c chiffres.h

trier_chercher : trier_chercher.o lire_chaine.o exit_if.o erreurs.o
trier_chercher.o: trier_chercher.c ec_tailles.h lire_chaine.h

raise : raise.o
raise.o : raise.c

signal : signal.o
signal.o : signal.c

majuscule : majuscule.o
majuscule.o: majuscule.c

ctype : ctype.o
ctype.o: ctype.c

moyenne : moyenne.o pluriel.o
moyenne.o: moyenne.c

test_chaine_trier : test_chaine_trier.o chaine_trier.o
test_chaine_trier.o: test_chaine_trier.c chaine_trier.h
chaine_trier.o: chaine_trier.c chaine_trier.h

heure : heure.o heure_approximative.o chaine.o exit_if.o erreurs.o
heure_approximative.o: heure_approximative.c heure_approximative.h \
 chaine.h ec_tailles.h
heure.o: heure.c heure_approximative.h

nomcmd : nomcmd.o nom_de_base.o
nomcmd.o: nomcmd.c
nom_de_base.o: nom_de_base.c

test_chaine : test_chaine.o chaine.o exit_if.o erreurs.o
test_chaine.o: test_chaine.c chaine.h
chaine.o: chaine.c chaine.h

test_lirechaine : test_lirechaine.o lire_chaine.o exit_if.o erreurs.o
test_lirechaine.o: test_lirechaine.c lire_chaine.h
lire_chaine.o: lire_chaine.c lire_chaine.h erreurs.h exit_if.h

extropts : extropts.o options.o exit_if.o erreurs.o
options.o: options.c erreurs.h exit_if.h options.h
extropts.o: extropts.c options.h

trace_alloc : malldmp.o trace_alloc.o
trace_alloc.o: trace_alloc.c malldmp.h
malldmp.o: malldmp.c malldmp.h

memcpy : memcpy.o
memcpy.o : memcpy.c
	$(CC) $(CFLAGS) -O -c memcpy.c -o memcpy.o

dmpchn : dmpchn.o allocation.o malldmp.o
allocation.o: allocation.c
dmpchn.o: dmpchn.c malldmp.h allocation.h

itob : itob.o
	$(CC) -lm itob.o -o itob
itob.o: itob.c

racine : racine.o
racine.o: racine.c

quel_jour_est_le : quel_jour_est_le.o
quel_jour_est_le.o: quel_jour_est_le.c

date_locale : date_locale.o
date_locale.o: date_locale.c

test_hms : test_hms.o hms.o heure_approximative.o chaine.o exit_if.o erreurs.o
hms.o: hms.c hms.h
test_hms.o: test_hms.c hms.h heure_approximative.h

test_concatener : test_concatener.o concatener.o exit_if.o erreurs.o
concatener.o: concatener.c exit_if.h erreurs.h concatener.h
test_concatener.o: test_concatener.c concatener.h

test_formater : test_formater.o formater.o hms.o exit_if.o erreurs.o
test_formater.o: test_formater.c hms.h formater.h
formater.o: formater.c erreurs.h exit_if.h formater.h

test_message : test_message.o message.o chaine.o exit_if.o erreurs.o
test_message.o: test_message.c message.h
message.o: message.c message.c chaine.h

exemple_system : exemple_system.o
exemple_system.o: exemple_system.c

err_contexte : err_contexte.o
err_contexte.o: err_contexte.c


### Chapitre 7

pid.o: pid.c

test_nom_unique : test_nom_unique.o nom_unique.o nom_de_base.o chiffres.o exit_if.o
	$(CC) -lm test_nom_unique.o nom_unique.o nom_de_base.o chiffres.o exit_if.o -o test_nom_unique

test_nom_unique.o: test_nom_unique.c nom_de_base.h nom_unique.h
nom_unique.o: nom_unique.c chiffres.h exit_if.h

noredir_posix : noredir_posix.o
noredir_posix.o: noredir_posix.c

info6tem : info6tem.o
info6tem.o: info6tem.c

fg_bg : fg_bg.o
fg_bg.o: fg_bg.c

tzname : tzname.o
tzname.o: tzname.c

configuration : configuration.o
configuration.o: configuration.c

lsdates : lsdates.o
lsdates.o: lsdates.c

idem : idem.o
idem.o: idem.c

mode : mode.o 
mode.o: mode.c ec_tailles.h

reculer : reculer.o
reculer.o: reculer.c

test_umask : test_umask.o
test_umask.o: test_umask.c

lsg : lsg.o
lsg.o: lsg.c

retenir : retenir.o
retenir.o: retenir.c

test_verrou : test_verrou.o verrou.o hms.o
	$(CC) test_verrou.o verrou.o hms.o -o test_verrou
test_verrou.o: test_verrou.c hms.h verrou.h
verrou.o: verrou.c verrou.h

fermer.o: fermer.c

alallocation_descripteurs : allocation_descripteurs.o
location_descripteurs.o: allocation_descripteurs.c

redirection : redirection.o
redirection.o: redirection.c

lecture_terminal : lecture_terminal.o pluriel.o
lecture_terminal.o: lecture_terminal.c pluriel.h

test_lep : test_lep.o
test_lep.o: test_lep.c

getchar.o: getchar.c

flock : flock.o hms.o
flock.o: flock.c hms.h

trivial_es : trivial_es.o
trivial_es.o: trivial_es.c

lire_FIFO : lire_FIFO.o
lire_FIFO.o: lire_FIFO.c

ecrire_FIFO : ecrire_FIFO.o
ecrire_FIFO.o: ecrire_FIFO.c

lectures_non_bloquantes : lectures_non_bloquantes.o hms.o
	$(CC) lectures_non_bloquantes.o hms.o -o lectures_non_bloquantes
lectures_non_bloquantes.o: lectures_non_bloquantes.c hms.h

filtre : filtre.o charger.o
filtre.o : filtre.c charger.h
charger.o : charger.c charger.h

signal_posix : signal_posix.o hms.o
	$(CC) signal_posix.o hms.o -o signal_posix
signal_posix.o : signal_posix.c hms.h

fork : fork.o formater.o exit_if.o erreurs.o
fork.o : fork.c formater.h

lancer : lancer.o
lancer.o : lancer.c

execenv : execenv.o concatener.o exit_if.o erreurs.o
execenv.o : execenv.c concatener.h

autokill : autokill.o
autokill.o : autokill.c

test_systeme : test_systeme.o systeme.o lire_chaine.o exit_if.o erreurs.o
test_systeme.o : test_systeme.c systeme.h lire_chaine.h
systeme.o: systeme.c systeme.h

tube : tube.o
tube.o: tube.c

pApB : pApB.o formater.o exit_if.o erreurs.o
pApB.o : pApB.c formater.h

processus_1 : processus_1.o
processus_1.o: processus_1.c

processus_2 : processus_2.o
processus_2.o: processus_2.c

detourner : detourner.o tuber.o exit_if.o erreurs.o
detourner.o: detourner.c tuber.h exit_if.h erreurs.h



terminal.o: terminal.c exit_if.h terminal.h

lecture_controlee : lecture_controlee.o lecture_zone.o terminal.o exit_if.o erreurs.o
lecture_controlee.o: lecture_controlee.c lecture_zone.h
lecture_zone.o: lecture_zone.c lecture_zone.h terminal.h

ai_consultation_b : ai_consultation.o accind_basniveau.o
	$(CC) ai_consultation.o accind_basniveau.o -o ai_consultation_b
ai_saisie_b : ai_saisie.o lire_chaine.o accind_basniveau.o exit_if.o erreurs.o
	$(CC) ai_saisie.o lire_chaine.o exit_if.o erreurs.o accind_basniveau.o -o ai_saisie_b


### Chapitre 8

.PHONY : generateur_elementaire
generateur_elementaire :
	make -C generateur_elementaire

.PHONY : generateur_messages
generateur_messages :
	make -C generateur_messages 

.PHONY : generateur_parametres
generateur_parametres :
	make -C generateur_parametres

#.PHONY : totalisateur_retenue
#totalisateur_retenue :
#	make -C totalisateur_retenue

test_typo : test_typo.o typo.o lire_chaine.o exit_if.o erreurs.o
majuscule-2 : majuscule-2.o typo.o

typo.o: typo.c typo.h
majuscule-2.o: majuscule-2.c typo.h
test_typo.o: test_typo.c typo.h lire_chaine.h

autre_triangle : autre_triangle.o generateur.o
autre_triangle.o : autre_triangle.c generateur.h e_suite.h 
e_suite.o : e_suite.c e_suite.h generateur.h 
generateur.o : generateur.c generateur.h 

st : st.o stat.o options.o chaine.o exit_if.o erreurs.o
st.o: st.c options.h stat.h chaine.h st.def
stat.o: stat.c stat.h

st-ni : st.o stat_ni.o options.o chaine.o exit_if.o erreurs.o
	$(CC) st.o stat_ni.o options.o chaine.o exit_if.o erreurs.o -o st-ni
stat_ni.o: stat_ni.c erreurs.h exit_if.h stat.h

test_instancier : test_instancier.o exit_if.o 
test_instancier.o: test_instancier.c classe.h instancier.h exit_if.h unites.h

deux_roues : deux_roues.o roue_num.o exit_if.o
deux_roues.o: deux_roues.c roue_num.h classe.h
roue_num.o: roue_num.c instancier.h exit_if.h roue_num.h classe.h

test_historique : test_historique.o generateur.o historique.o exit_if.o
test_historique.o: test_historique.c generateur.h historique.h classe.h test_historique.def
historique : historique.o test_historique.o generateur.o exit_if.o
historique.o: historique.c instancier.h exit_if.h historique.h classe.h


compteur : compteur.o totalisateur.o roue_num.o exit_if.o erreurs.o pluriel.o
plaque : plaque.o totalisateur.o roue_num.o generateur.o exit_if.o erreurs.o

totalisateur.o: totalisateur.c exit_if.h instancier.h totalisateur.h classe.h roue_num.h
compteur.o: compteur.c pluriel.h roue_num.h classe.h totalisateur.h
plaque.o: plaque.c pluriel.h generateur.h roue_num.h classe.h totalisateur.h

#compteur_avec_iteration : compteur_silencieux.o roue_num.o totalisateur.o pluriel.o
#compteur_avec_retenue : compteur_silencieux.o \
# totalisateur_retenue/roue_num.o totalisateur_retenue/totalisateur.o
#compteur_silencieux.o: compteur_silencieux.c pluriel.h roue_num.h \
# classe.h totalisateur.h

test_vecteur : test_vecteur.o vecteur.o exit_if.o erreurs.o
test_vecteur.o: test_vecteur.c vecteur.h classe.h
vecteur.o: vecteur.c instancier.h exit_if.h vecteur.h classe.h

test_pilegen : test_pilegen.o pilegen.o vecteur.o exit_if.o erreurs.o
test_pilegen.o: test_pilegen.c pilegen.h classe.h
pilegen.o: pilegen.c instancier.h exit_if.h vecteur.h classe.h pilegen.h


cp : 
	tar -cf - $(SOURCE_FILES) $(SOURCE_DIRS) | (cd .src - ; tar xvf -) 