# COMMANDES #
JAVAC = javac
# note $$ to get a single shell $
JAVAC_OPTIONS = -implicit:none -d build -classpath "res/mariadb-client.jar:build" -sourcepath src
JAVA = java
JAR = jar
EXEC_JAR = ${JAVA} -jar

# CHEMINS RELATIFS
SRC = src/fr/iutfbleau/projetIHM2022FI2
BUILD = build/fr/iutfbleau/projetIHM2022FI2
DOC = doc/fr/iutfbleau/projetIHM2022FI2

# CHOIX NOMS
JAR_MNP = IHM.jar

# BUTS FACTICES #
.PHONY : run clean doc clean_doc

# BUT PAR DEFAUT #
run : build\
	${JAR_MNP}
	${EXEC_JAR} ${JAR_MNP}

# AUTRE BUTS
doc :
	javadoc -d doc src/fr/iutfbleau/projetIHM2022FI2/API/*.java src/fr/iutfbleau/projetIHM2022FI2/MP/*.java src/fr/iutfbleau/projetIHM2022FI2/MP/ROOT/Controller/*.java src/fr/iutfbleau/projetIHM2022FI2/MP/ROOT/View/*.java src/fr/iutfbleau/projetIHM2022FI2/MP/ETU/View/*.java src/fr/iutfbleau/projetIHM2022FI2/MP/ETU/Model/*.java src/fr/iutfbleau/projetIHM2022FI2/MP/ROOT/Model/*.java src/fr/iutfbleau/projetIHM2022FI2/MP/PROF/Model/*.java src/fr/iutfbleau/projetIHM2022FI2/MP/PROF/View/*.java src/fr/iutfbleau/projetIHM2022FI2/MNP/*.java src/fr/iutfbleau/projetIHM2022FI2/MNP/ROOT/Model/*.java src/fr/iutfbleau/projetIHM2022FI2/MNP/PROF/Model/* src/fr/iutfbleau/projetIHM2022FI2/MNP/ETU/Model/*
clean :
	rm -rf ${BUILD}/* *.jar

clean_doc:
	rm -rf ./doc
# REGLES DE DEPENDANCE #
## Dossier  ##
build :
	mkdir build
## API ##
${BUILD}/API/Model.class : ${SRC}/API/Model.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Model.java

${BUILD}/API/MonPrint.class : ${SRC}/API/MonPrint.java 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/MonPrint.java

${BUILD}/API/TypeGroupe.class : ${SRC}/API/TypeGroupe.java 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/TypeGroupe.java

${BUILD}/API/Groupe.class : ${SRC}/API/Groupe.java \
	  		     ${BUILD}/API/TypeGroupe.class\
			     ${BUILD}/API/MonPrint.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Groupe.java

${BUILD}/API/Etudiant.class : ${SRC}/API/Etudiant.java \
                            ${BUILD}/API/MonPrint.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Etudiant.java

${BUILD}/API/Changement.class : ${SRC}/API/Changement.java \
	  		            ${BUILD}/API/Etudiant.class \
	  		     	    ${BUILD}/API/Groupe.class 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/Changement.java

${BUILD}/API/AbstractGroupeFactory.class : ${SRC}/API/AbstractGroupeFactory.java \
				${BUILD}/API/Groupe.class \
	  		         ${BUILD}/API/Etudiant.class 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/AbstractGroupeFactory.java

${BUILD}/API/AbstractChangementFactory.class : ${SRC}/API/AbstractChangementFactory.java \
	  		            ${BUILD}/API/AbstractGroupeFactory.class \
				    ${BUILD}/API/Changement.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/API/AbstractChangementFactory.java

## MP ##

${BUILD}/MP/EtudiantNP.class : ${SRC}/MP/EtudiantNP.java \
                              ${BUILD}/API/Etudiant.class 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/EtudiantNP.java


${BUILD}/MP/GroupeNP.class : ${SRC}/MP/GroupeNP.java \
                              ${BUILD}/API/Groupe.class \
			      ${BUILD}/API/TypeGroupe.class \
                              ${BUILD}/API/Etudiant.class 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/GroupeNP.java


${BUILD}/MP/ChangementNP.class : ${BUILD}/API/Changement.class \
				${SRC}/MP/ChangementNP.java \
                              ${BUILD}/API/Groupe.class \
                              ${BUILD}/API/Etudiant.class 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ChangementNP.java

${BUILD}/MP/AbstractGroupeFactoryPersistant.class : ${SRC}/MP/AbstractGroupeFactoryPersistant.java \
				${BUILD}/API/AbstractGroupeFactory.class 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/AbstractGroupeFactoryPersistant.java

${BUILD}/MP/AbstractChangementFactoryPersistant.class : ${SRC}/MP/AbstractChangementFactoryPersistant.java \
				${BUILD}/API/AbstractChangementFactory.class \
				${BUILD}/API/Changement.class 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/AbstractChangementFactoryPersistant.java

	

## ROOT ##


## 		View ##

${BUILD}/MP/ROOT/View/FindBarFenetre.class : ${SRC}/MP/ROOT/View/FindBarFenetre.java\
								${BUILD}/MP/ROOT/Controller/ListenerFindBar.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/View/FindBarFenetre.java


${BUILD}/MP/ROOT/View/FenetreChangement.class : ${SRC}/MP/ROOT/View/FenetreChangement.java \
										${BUILD}/MP/ROOT/Controller/ActionChangement.class	
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/View/FenetreChangement.java

${BUILD}/MP/ROOT/View/FenetreGroupe.class : ${SRC}/MP/ROOT/View/FenetreGroupe.java \
										${BUILD}/Permanent/Controller/ObservateurFenetre.class \
										${BUILD}/Permanent/Controller/ObservateurChangeGroupe.class \
										${BUILD}/MP/ROOT/Controller/ObservateurModifGroupe.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/View/FenetreGroupe.java

${BUILD}/MP/ROOT/View/FenetreEtudiant.class :${SRC}/MP/ROOT/View/FenetreEtudiant.java \
										${BUILD}/Permanent/Controller/ObservateurFenetre.class \
										${BUILD}/Permanent/Controller/ObservateurChangeGroupe.class \
										${BUILD}/MP/ROOT/View/PanelEtudiant.class \
										${BUILD}/Permanent/Controller/ActionListenerChangeEtu.class \
										${BUILD}/MP/ROOT/Controller/ActionListChange.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/View/FenetreEtudiant.java

${BUILD}/MP/ROOT/View/PanelEtudiant.class : ${SRC}/MP/ROOT/View/PanelEtudiant.java \
										${BUILD}/MP/ROOT/Controller/ActionListenerSuprEtu.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/View/PanelEtudiant.java


${BUILD}/MP/ROOT/View/FenetreSelectionEtu.class : ${SRC}/MP/ROOT/View/FenetreSelectionEtu.java \
											${BUILD}/MP/ROOT/Controller/SelecteurEtudiant.class \
											${BUILD}/MP/ROOT/Controller/ActionListenerNouveauEtu.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/View/FenetreSelectionEtu.java


##		Controller ##
${BUILD}/MP/ROOT/Controller/ListenerFindBar.class : ${SRC}/MP/ROOT/Controller/ListenerFindBar.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/Controller/ListenerFindBar.java


${BUILD}/MP/ROOT/Controller/ActionListenerSuprEtu.class : ${SRC}/MP/ROOT/Controller/ActionListenerSuprEtu.java \
									${BUILD}/API/Etudiant.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/Controller/ActionListenerSuprEtu.java

${BUILD}/MP/ROOT/Controller/ActionChangement.class : ${SRC}/MP/ROOT/Controller/ActionChangement.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/Controller/ActionChangement.java

${BUILD}/MP/ROOT/Controller/ObservateurModifGroupe.class : ${SRC}/MP/ROOT/Controller/ObservateurModifGroupe.java \
												${BUILD}/MP/ROOT/View/FenetreSelectionEtu.class \
												${BUILD}/MP/ROOT/Controller/SelecteurEtudiant.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/Controller/ObservateurModifGroupe.java

${BUILD}/MP/ROOT/Controller/SelecteurEtudiant.class : ${SRC}/MP/ROOT/Controller/SelecteurEtudiant.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/Controller/SelecteurEtudiant.java

${BUILD}/MP/ROOT/Controller/ActionListenerNouveauEtu.class : ${SRC}/MP/ROOT/Controller/ActionListenerNouveauEtu.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/Controller/ActionListenerNouveauEtu.java

${BUILD}/MP/ROOT/Controller/ActionListChange.class : ${SRC}/MP/ROOT/Controller/ActionListChange.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/Controller/ActionListChange.java

##....


##    Model   ###

${BUILD}/MP/ROOT/Model/ModelRoot.class : ${SRC}/MP/ROOT/Model/ModelRoot.java \
				${BUILD}/API/Model.class \
				${BUILD}/MP/ROOT/View/FenetreGroupe.class \
				${BUILD}/MP/ROOT/View/FenetreEtudiant.class \
				${BUILD}/Permanent/View/Chargement.class \
				${BUILD}/MP/ROOT/View/FenetreChangement.class \
				${BUILD}/MP/ROOT/View/FindBarFenetre.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ROOT/Model/ModelRoot.java






## ETU ##


## 		View ##

${BUILD}/MP/ETU/View/FenetreGroupe.class : ${SRC}/MP/ETU/View/FenetreGroupe.java \
										${BUILD}/Permanent/Controller/ObservateurFenetre.class \
										${BUILD}/Permanent/Controller/ObservateurChangeGroupe.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ETU/View/FenetreGroupe.java

${BUILD}/MP/ETU/View/FenetreEtudiant.class :${SRC}/MP/ETU/View/FenetreEtudiant.java \
										${BUILD}/Permanent/Controller/ObservateurFenetre.class \
										${BUILD}/Permanent/Controller/ObservateurChangeGroupe.class \
										${BUILD}/MP/ETU/View/PanelEtudiant.class \
										${BUILD}/Permanent/Controller/ActionListenerChangeEtu.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ETU/View/FenetreEtudiant.java

${BUILD}/MP/ETU/View/PanelEtudiant.class : ${SRC}/MP/ETU/View/PanelEtudiant.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ETU/View/PanelEtudiant.java



##		Controller ##



##....


##    Model   ###

${BUILD}/MP/ETU/Model/ModelEtu.class : ${SRC}/MP/ETU/Model/ModelEtu.java \
				${BUILD}/API/Model.class \
				${BUILD}/MP/ETU/View/FenetreGroupe.class \
				${BUILD}/MP/ETU/View/FenetreEtudiant.class \
				${BUILD}/Permanent/View/Chargement.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/ETU/Model/ModelEtu.java


## PROF ##


## View ##

${BUILD}/MP/PROF/View/FenetreGroupe.class : ${SRC}/MP/PROF/View/FenetreGroupe.java \
										${BUILD}/Permanent/Controller/ObservateurFenetre.class \
										${BUILD}/Permanent/Controller/ObservateurChangeGroupe.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/PROF/View/FenetreGroupe.java

${BUILD}/MP/PROF/View/FenetreEtudiant.class :${SRC}/MP/PROF/View/FenetreEtudiant.java \
										${BUILD}/Permanent/Controller/ObservateurChangeGroupe.class \
										${BUILD}/MP/PROF/View/PanelEtudiant.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/PROF/View/FenetreEtudiant.java

${BUILD}/MP/PROF/View/PanelEtudiant.class : ${SRC}/MP/PROF/View/PanelEtudiant.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/PROF/View/PanelEtudiant.java



##		Controller ##



##....


##    Model   ###

${BUILD}/MP/PROF/Model/ModelProf.class : ${SRC}/MP/PROF/Model/ModelProf.java \
				${BUILD}/API/Model.class \
				${BUILD}/MP/PROF/View/FenetreGroupe.class \
				${BUILD}/MP/PROF/View/FenetreEtudiant.class \
				${BUILD}/Permanent/View/Chargement.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MP/PROF/Model/ModelProf.java



## MNP ##

${BUILD}/MNP/AbstractGroupeFactoryNP.class : ${SRC}/MNP/AbstractGroupeFactoryNP.java \
				${BUILD}/API/AbstractGroupeFactory.class 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/AbstractGroupeFactoryNP.java

${BUILD}/MNP/AbstractChangementFactoryNP.class : ${SRC}/MNP/AbstractChangementFactoryNP.java \
				${BUILD}/API/AbstractChangementFactory.class \
				${BUILD}/API/Changement.class 
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/AbstractChangementFactoryNP.java


## ROOT ##


##    Model   ###

${BUILD}/MNP/ROOT/Model/ModelRoot.class : ${SRC}/MNP/ROOT/Model/ModelRoot.java \
				${BUILD}/API/Model.class \
				${BUILD}/MP/ROOT/View/FenetreGroupe.class \
				${BUILD}/MP/ROOT/View/FenetreEtudiant.class \
				${BUILD}/Permanent/View/Chargement.class \
				${BUILD}/MP/ROOT/View/FenetreChangement.class \
				${BUILD}/MP/ROOT/View/FindBarFenetre.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/ROOT/Model/ModelRoot.java


## ETU ##



##    Model   ###

${BUILD}/MNP/ETU/Model/ModelEtu.class : ${SRC}/MNP/ETU/Model/ModelEtu.java \
				${BUILD}/API/Model.class \
				${BUILD}/MP/ETU/View/FenetreGroupe.class \
				${BUILD}/MP/ETU/View/FenetreEtudiant.class \
				${BUILD}/Permanent/View/Chargement.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/ETU/Model/ModelEtu.java


## PROF ##



##    Model   ###

${BUILD}/MNP/PROF/Model/ModelProf.class : ${SRC}/MNP/PROF/Model/ModelProf.java \
				${BUILD}/API/Model.class \
				${BUILD}/MP/PROF/View/FenetreGroupe.class \
				${BUILD}/MP/PROF/View/FenetreEtudiant.class \
				${BUILD}/Permanent/View/Chargement.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/MNP/PROF/Model/ModelProf.java


##... FIN MNP ##

## Permanent ##

 ${BUILD}/Permanent/Connexion.class : ${SRC}/Permanent/Connexion.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/Permanent/View/Connexion.java

 ${BUILD}/Permanent/IHM.class : ${SRC}/Permanent/IHM.java \
			 ${BUILD}/MP/EtudiantNP.class \
			 ${BUILD}/MP/GroupeNP.class \
			 ${BUILD}/MP/ChangementNP.class \
			 ${BUILD}/MP/AbstractGroupeFactoryPersistant.class \
			 ${BUILD}/MP/AbstractChangementFactoryPersistant.class	\
			 ${BUILD}/MP/ROOT/Model/ModelRoot.class \
			 ${BUILD}/MP/ETU/Model/ModelEtu.class \
			 ${BUILD}/MP/PROF/Model/ModelProf.class \
			 ${BUILD}/MNP/AbstractGroupeFactoryNP.class \
			 ${BUILD}/MNP/AbstractChangementFactoryNP.class	\
			 ${BUILD}/MNP/ROOT/Model/ModelRoot.class \
			 ${BUILD}/MNP/ETU/Model/ModelEtu.class \
			 ${BUILD}/MNP/PROF/Model/ModelProf.class \
			 ${BUILD}/Permanent/View/Connexion.class \
			 ${BUILD}/Permanent/Util/User.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/Permanent/IHM.java
## View ##

${BUILD}/Permanent/View/Chargement.class : ${SRC}/Permanent/View/Chargement.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/Permanent//View/Chargement.java

${BUILD}/Permanent/View/Connexion.class : ${SRC}/Permanent/View/Connexion.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/Permanent/View/Connexion.java

## Util  ##

${BUILD}/Permanent/Util/User.class : ${SRC}/Permanent/Util/User.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/Permanent/Util/User.java

## Controller ##

${BUILD}/Permanent/Controller/ObservateurFenetre.class : ${SRC}/Permanent/Controller/ObservateurFenetre.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/Permanent/Controller/ObservateurFenetre.java

${BUILD}/Permanent/Controller/ObservateurChangeGroupe.class : ${SRC}/Permanent/Controller/ObservateurChangeGroupe.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/Permanent/Controller/ObservateurChangeGroupe.java

${BUILD}/Permanent/Controller/ActionListenerChangeEtu.class : ${SRC}/Permanent/Controller/ActionListenerChangeEtu.java \
													${BUILD}/Permanent/Controller/ControllerGroupeBChangement.class
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/Permanent/Controller/ActionListenerChangeEtu.java

${BUILD}/Permanent/Controller/ControllerGroupeBChangement.class : ${SRC}/Permanent/Controller/ControllerGroupeBChangement.java
	${JAVAC} ${JAVAC_OPTIONS} ${SRC}/Permanent/Controller/ControllerGroupeBChangement.java

# ## JARS ##

 ${JAR_MNP} : ${BUILD}/Permanent/IHM.class
	${JAR} cfme ${JAR_MNP} Manifest.txt fr/iutfbleau/projetIHM2022FI2/Permanent/IHM res/ -C build fr
