diff --git a/AutomatiqueActionListener.class b/AutomatiqueActionListener.class deleted file mode 100644 index 71d5119..0000000 Binary files a/AutomatiqueActionListener.class and /dev/null differ diff --git a/CaseMouseListener.class b/CaseMouseListener.class deleted file mode 100644 index cfb8716..0000000 Binary files a/CaseMouseListener.class and /dev/null differ diff --git a/FenetreChoix.class b/FenetreChoix.class deleted file mode 100644 index f204a25..0000000 Binary files a/FenetreChoix.class and /dev/null differ diff --git a/FenetreModif$1.class b/FenetreModif$1.class deleted file mode 100644 index 84eaabf..0000000 Binary files a/FenetreModif$1.class and /dev/null differ diff --git a/FenetreModif.class b/FenetreModif.class deleted file mode 100644 index 5e1dabe..0000000 Binary files a/FenetreModif.class and /dev/null differ diff --git a/FenetrePrincipale.class b/FenetrePrincipale.class deleted file mode 100644 index c76e9e8..0000000 Binary files a/FenetrePrincipale.class and /dev/null differ diff --git a/GrilleExisteActionListener.class b/GrilleExisteActionListener.class deleted file mode 100644 index f9e2114..0000000 Binary files a/GrilleExisteActionListener.class and /dev/null differ diff --git a/GrillePainter.class b/GrillePainter.class deleted file mode 100644 index 577e558..0000000 Binary files a/GrillePainter.class and /dev/null differ diff --git a/GrilleSudokuDessin.class b/GrilleSudokuDessin.class deleted file mode 100644 index 28cb06b..0000000 Binary files a/GrilleSudokuDessin.class and /dev/null differ diff --git a/GrilleVideActionListener.class b/GrilleVideActionListener.class deleted file mode 100644 index 5132c2d..0000000 Binary files a/GrilleVideActionListener.class and /dev/null differ diff --git a/Grilles.class b/Grilles.class deleted file mode 100644 index 18560e4..0000000 Binary files a/Grilles.class and /dev/null differ diff --git a/Grilles/GrilMakeTest b/Grilles/GrilMakeTest new file mode 100644 index 0000000..dee2404 Binary files /dev/null and b/Grilles/GrilMakeTest differ diff --git a/Lecteur.class b/Lecteur.class deleted file mode 100644 index 8e08d2c..0000000 Binary files a/Lecteur.class and /dev/null differ diff --git a/Main.class b/Main.class deleted file mode 100644 index edb9063..0000000 Binary files a/Main.class and /dev/null differ diff --git a/MainCreation$1.class b/MainCreation$1.class deleted file mode 100644 index 47b9e23..0000000 Binary files a/MainCreation$1.class and /dev/null differ diff --git a/MainCreation$2.class b/MainCreation$2.class deleted file mode 100644 index b5581ec..0000000 Binary files a/MainCreation$2.class and /dev/null differ diff --git a/MainCreation.class b/MainCreation.class deleted file mode 100644 index 94b2805..0000000 Binary files a/MainCreation.class and /dev/null differ diff --git a/Makefile b/Makefile index adcf723..25d2e6b 100644 --- a/Makefile +++ b/Makefile @@ -1,56 +1,64 @@ -# Variables +# If the first argument is "jeu"... +ifeq (jeu,$(firstword $(MAKECMDGOALS))) + # use the rest as arguments for "jeu" + RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) + # ...and turn them into do-nothing targets + $(eval $(RUN_ARGS):;@:) +endif + +### VARIABLES ### + JC = javac +JCFLAGS = -encoding UTF-8 -implicit:none JVM = java -SRCDIR = src -BINDIR = bin -MAINCLASS1 = MainJeu -MAINCLASS2 = MainCreation +JVMFLAGS = + +SRCDIR = ./src +OUTDIR = ./out +DOCDIR = ./doc + +### LISTE DES FICHIERS SOURCE ### + SRCFILES := $(wildcard $(SRCDIR)/*.java) -CLASSFILES := $(patsubst $(SRCDIR)/%.java,$(BINDIR)/%.class,$(SRCFILES)) -# Règles de compilation pour les fichiers Java dans le répertoire src -$(BINDIR)/%.class: $(SRCDIR)/%.java | $(BINDIR) - $(JC) -d $(BINDIR) $< +### LISTE DES FICHIERS OBJET ### -# Crée le répertoire bin s'il n'existe pas -$(BINDIR): - mkdir -p $(BINDIR) +CLASSFILES := $(patsubst $(SRCDIR)/%.java,$(OUTDIR)/%.class,$(SRCFILES)) -# Règle pour exécuter le premier programme -runJeu: $(CLASSFILES) - $(JVM) -cp $(BINDIR) $(MAINCLASS1) +### REGLES ESSENTIELLES ### -# Règle pour exécuter le deuxième programme -runCreation: $(CLASSFILES) - $(JVM) -cp $(BINDIR) $(MAINCLASS2) +# Compilation de tous les fichiers source +$(OUTDIR)/%.class : $(SRCDIR)/%.java | $(OUTDIR) + @mkdir -p $(OUTDIR) + $(JC) $(JCFLAGS) -cp $(SRCDIR) -d $(OUTDIR) $< -# Règle pour nettoyer les fichiers compilés -clean: - rm -rf $(BINDIR)/* +# Crée le répertoire de sortie s'il n'existe pas +$(OUTDIR): + mkdir -p $(OUTDIR) -# Règle pour créer la documentation -doc: - javadoc -d docs $(SRCDIR)/*.java +# La classe Main dépend de tous les fichiers compilés +$(OUTDIR)/MainJeu.class : $(CLASSFILES) -# Règle pour visualiser la documentation -seedoc: - firefox docs/index.html & +### REGLES OPTIONNELLES ### -# Définir les cibles factices -.PHONY: build runJeu runCreation clean doc seedoc +# Règle pour lancer le programme +jeu : $(OUTDIR)/MainJeu.class + $(JVM) $(JVMFLAGS) -cp $(OUTDIR) MainJeu $(RUN_ARGS) -# Règle par défaut -.DEFAULT_GOAL := build +# Nettoyage des fichiers générés +clean : + -rm -rf $(OUTDIR) + -rm -rf $(DOCDIR) -# Règle pour compiler AutomatiqueActionListener avec ses dépendances -$(BINDIR)/AutomatiqueActionListener.class: $(SRCDIR)/AutomatiqueActionListener.java $(BINDIR)/GenerateurSudoku.class $(BINDIR)/FenetrePrincipale.class $(BINDIR)/Resolveur.class - $(JC) -d $(BINDIR) $< +# Nettoyage et suppression des fichiers générés, y compris la classe Main +mrproper : clean -# Règle pour compiler FenetrePrincipale avec ses dépendances -$(BINDIR)/FenetrePrincipale.class: $(SRCDIR)/FenetrePrincipale.java $(BINDIR)/SaisieGrille.class $(BINDIR)/ReinitialiserActionListener.class - $(JC) -d $(BINDIR) $< +# Génération de la documentation +doc : + javadoc -d $(DOCDIR) $(SRCDIR)/*.java -# Règle pour compiler SaisieGrille avec ses dépendances -$(BINDIR)/SaisieGrille.class: $(SRCDIR)/SaisieGrille.java $(BINDIR)/CaseMouseListener.class $(BINDIR)/GrillePainter.class - $(JC) -d $(BINDIR) $< +### BUTS FACTICES ### +.PHONY : jeu clean mrproper doc + +### FIN ### diff --git a/ManuelActionListener.class b/ManuelActionListener.class deleted file mode 100644 index 05ad053..0000000 Binary files a/ManuelActionListener.class and /dev/null differ diff --git a/OuvertureFichier.class b/OuvertureFichier.class deleted file mode 100644 index 039a049..0000000 Binary files a/OuvertureFichier.class and /dev/null differ diff --git a/Register.class b/Register.class deleted file mode 100644 index 3d22e40..0000000 Binary files a/Register.class and /dev/null differ diff --git a/Reinitialiser.class b/Reinitialiser.class deleted file mode 100644 index 7a9179d..0000000 Binary files a/Reinitialiser.class and /dev/null differ diff --git a/ReinitialiserActionListener.class b/ReinitialiserActionListener.class deleted file mode 100644 index 76190d5..0000000 Binary files a/ReinitialiserActionListener.class and /dev/null differ diff --git a/Resolveur.class b/Resolveur.class deleted file mode 100644 index c039556..0000000 Binary files a/Resolveur.class and /dev/null differ diff --git a/SaisieGrille.class b/SaisieGrille.class deleted file mode 100644 index ab56530..0000000 Binary files a/SaisieGrille.class and /dev/null differ diff --git a/SudokuGenerator.class b/SudokuGenerator.class deleted file mode 100644 index c8d4474..0000000 Binary files a/SudokuGenerator.class and /dev/null differ diff --git a/FenetreModif.java b/src/FenetreModif.java similarity index 100% rename from FenetreModif.java rename to src/FenetreModif.java diff --git a/GrilleExisteActionListener.java b/src/GrilleExisteActionListener.java similarity index 100% rename from GrilleExisteActionListener.java rename to src/GrilleExisteActionListener.java diff --git a/GrilleVideActionListener.java b/src/GrilleVideActionListener.java similarity index 100% rename from GrilleVideActionListener.java rename to src/GrilleVideActionListener.java