Correction du makefile V2

This commit is contained in:
Marco ORFAO 2024-05-04 19:43:54 +02:00
parent 2edf4581fe
commit 0c7be3d26f
2 changed files with 114 additions and 115 deletions

115
Makefile
View File

@ -1,119 +1,30 @@
JC := javac JC := javac
JCFLAGS := -encoding UTF-8 -implicit:none JCFLAGS := -encoding UTF-8 -implicit:none
JVM := java JVM := java
JVMFLAGS := JVMFLAGS :=
SRCDIR := ./src SRCDIR := ./src
OUTDIR := ./build OUTDIR := ./build
DOCDIR := ./doc DOCDIR := ./doc
SRC := $(wildcard $(SRCDIR)/*.java) SRC := $(wildcard $(SRCDIR)/*.java)
OFILES := $(wildcard $(OUTDIR)/*.class) OFILES := $(SRC:$(SRCDIR)/%.java=$(OUTDIR)/%.class)
### REGLES ESSENTIELLES ### ### REGLES ESSENTIELLES ###
GridSolver.class : ${SRCDIR}/GridSolver.java Window.class HomeView.class $(OUTDIR)/%.class : $(SRCDIR)/%.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GridSolver.java -d $(OUTDIR) @mkdir -p $(@D)
${JC} ${JCFLAGS} -cp $(SRCDIR) -d $(OUTDIR) $<
GMChecker.class : ${SRCDIR}/GMChecker.java GMGrid.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GMChecker.java -d $(OUTDIR)
GMHowToCreateView.class : ${SRCDIR}/GMHowToCreateView.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GMHowToCreateView.java -d $(OUTDIR)
HomeView.class HomeButtonClickListener.class : ${SRCDIR}/HomeView.java ${SRCDIR}/HomeButtonClickListener.java MusicButton.class Window.class Title.class Button.class DialogManager.class GMUserInterfaceView.class GSMenu.class GSMenuController.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/HomeView.java ${SRCDIR}/HomeButtonClickListener.java -d $(OUTDIR)
GSMenu.class : ${SRCDIR}/GSMenu.java Window.class Title.class Button.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSMenu.java -d $(OUTDIR)
GSMenuController.class : ${SRCDIR}/GSMenuController.java GSMenu.class Window.class GSGrid.class GSPlay.class GSPlayController.class GSSolver.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSMenuController.java -d $(OUTDIR)
GSGrid.class GSCase.class GSCaseMouseListener.class : ${SRCDIR}/GSGrid.java GSMenu.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSGrid.java ${SRCDIR}/GSCase.java ${SRCDIR}/GSCaseMouseListener.java -d $(OUTDIR)
GSPlay.class GSPlayController.class : ${SRCDIR}/GSPlay.java GSGrid.class Button.class Window.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSPlay.java ${SRCDIR}/GSPlayController.java -d $(OUTDIR)
GSSolver.class : ${SRCDIR}/GSSolver.java GSGrid.class Window.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSSolver.java -d $(OUTDIR)
MusicButton.class : ${SRCDIR}/MusicButton.java MusicPlayer.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/MusicButton.java -d $(OUTDIR)
MusicPlayer.class : ${SRCDIR}/MusicPlayer.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/MusicPlayer.java -d $(OUTDIR)
Rules.class : ${SRCDIR}/Rules.java RulesDialogManager.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Rules.java -d $(OUTDIR)
RulesDialogManager.class : ${SRCDIR}/RulesDialogManager.java DialogManager.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/RulesDialogManager.java -d $(OUTDIR)
DialogManager.class : ${SRCDIR}/DialogManager.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/DialogManager.java -d $(OUTDIR)
RulesSudoku.class : ${SRCDIR}/RulesSudoku.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/RulesSudoku.java -d $(OUTDIR)
Window.class : ${SRCDIR}/Window.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Window.java -d $(OUTDIR)
Title.class : ${SRCDIR}/Title.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Title.java -d $(OUTDIR)
Button.class : ${SRCDIR}/Button.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Button.java -d $(OUTDIR)
GMUserInterfaceView.class : ${SRCDIR}/GMUserInterfaceView.java GMGrid.class GMResetGrid.class GMImport.class GMSaverActionListener.class GMHowToCreateController.class Rules.class GMUserInterfaceController.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMUserInterfaceView.java -d $(OUTDIR)
GMGrid.class : ${SRCDIR}/GMGrid.java GMCase.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMGrid.java -d $(OUTDIR)
GMCase.class GMCaseKeyListener.class GMCaseMouseListener.class : ${SRCDIR}/GMCase.java ${SRCDIR}/GMCaseKeyListener.java ${SRCDIR}/GMCaseMouseListener.java
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMCase.java ${SRCDIR}/GMCaseKeyListener.java ${SRCDIR}/GMCaseMouseListener.java -d $(OUTDIR)
GMResetGrid.class : ${SRCDIR}/GMResetGrid.java GMGrid.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMResetGrid.java -d $(OUTDIR)
GMImport.class : ${SRCDIR}/GMImport.java GMGrid.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMImport.java -d $(OUTDIR)
GMSaverActionListener.class GMSaver.class : ${SRCDIR}/GMSaverActionListener.java ${SRCDIR}/GMSaver.java GMGrid.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMSaverActionListener.java ${SRCDIR}/GMSaver.java -d $(OUTDIR)
GMHowToCreateController.class : ${SRCDIR}/GMHowToCreateController.java GMHowToCreateDialogManager.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMHowToCreateController.java -d $(OUTDIR)
GMHowToCreateDialogManager.class : ${SRCDIR}/GMHowToCreateDialogManager.java DialogManager.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMHowToCreateDialogManager.java -d $(OUTDIR)
GMUserInterfaceController.class : ${SRCDIR}/GMUserInterfaceController.java Window.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMUserInterfaceController.java -d $(OUTDIR)
GridMaker.class : ${SRCDIR}/GridMaker.java Window.class HomeView.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GridMaker.java -d $(OUTDIR)
GSWin.class : ${SRCDIR}/GSWin.java DialogManager.class CongratulationsDialog.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSWin.java -d $(OUTDIR)
CongratulationsDialog.class : ${SRCDIR}/CongratulationsDialog.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/CongratulationsDialog.java -d $(OUTDIR)
GSTest.class : ${SRCDIR}/GSTest.java GSGrid.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSTest.java -d $(OUTDIR)
GSImport.class : ${SRCDIR}/GSImport.java Window.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSImport.java -d $(OUTDIR)
### REGLES OPTIONNELLES ### ### REGLES OPTIONNELLES ###
GridMaker : Window.class Title.class RulesSudoku.class RulesDialogManager.class Rules.class MusicPlayer.class MusicButton.class HomeView.class HomeButtonClickListener.class GridMaker.class GMUserInterfaceView.class GMUserInterfaceController.class GMSaverActionListener.class GMSaver.class GMResetGrid.class GMImport.class GMHowToCreateView.class GMHowToCreateDialogManager.class GMHowToCreateController.class GMGrid.class GMChecker.class GMCaseMouseListener.class GMCaseKeyListener.class GMCase.class DialogManager.class Button.class all:
${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridMaker
GridSolver : Window.class Title.class RulesSudoku.class RulesDialogManager.class Rules.class MusicPlayer.class MusicButton.class HomeView.class HomeButtonClickListener.class GSWin.class GSTest.class GSSolver.class GSPlayController.class GSPlay.class GSMenuController.class GSMenu.class GSImport.class GSGrid.class GSCaseMouseListener.class GSCase.class GridSolver.class DialogManager.class CongratulationsDialog.class Button.class GridMaker : $(OFILES)
${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridSolver ${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridMaker $(RUN_ARGS)
GridSolver : $(OFILES)
${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridSolver $(RUN_ARGS)
clean : clean :
-rm -rf $(OUTDIR) -rm -rf $(OUTDIR)
@ -122,10 +33,8 @@ clean :
doc : doc :
javadoc -d $(DOCDIR) $(SRC) javadoc -d $(DOCDIR) $(SRC)
default:
### BUTS FACTICES ### ### BUTS FACTICES ###
.PHONY : run clean doc .PHONY: all GridMaker GridSolver clean doc
### FIN ### ### FIN ###

View File

@ -2,29 +2,117 @@ JC := javac
JCFLAGS := -encoding UTF-8 -implicit:none JCFLAGS := -encoding UTF-8 -implicit:none
JVM := java JVM := java
JVMFLAGS := JVMFLAGS :=
SRCDIR := ./src SRCDIR := ./src
OUTDIR := ./build OUTDIR := ./build
DOCDIR := ./doc DOCDIR := ./doc
SRC := $(wildcard $(SRCDIR)/*.java) SRC := $(wildcard $(SRCDIR)/*.java)
OFILES := $(SRC:$(SRCDIR)/%.java=$(OUTDIR)/%.class) OFILES := $(wildcard $(OUTDIR)/*.class)
### REGLES ESSENTIELLES ### ### REGLES ESSENTIELLES ###
$(OUTDIR)/%.class : $(SRCDIR)/%.java GridSolver.class : ${SRCDIR}/GridSolver.java Window.class HomeView.class
@mkdir -p $(@D) ${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GridSolver.java -d $(OUTDIR)
${JC} ${JCFLAGS} -cp $(SRCDIR) -d $(OUTDIR) $<
GMChecker.class : ${SRCDIR}/GMChecker.java GMGrid.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GMChecker.java -d $(OUTDIR)
GMHowToCreateView.class : ${SRCDIR}/GMHowToCreateView.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GMHowToCreateView.java -d $(OUTDIR)
HomeView.class HomeButtonClickListener.class : ${SRCDIR}/HomeView.java ${SRCDIR}/HomeButtonClickListener.java MusicButton.class Window.class Title.class Button.class DialogManager.class GMUserInterfaceView.class GSMenu.class GSMenuController.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/HomeView.java ${SRCDIR}/HomeButtonClickListener.java -d $(OUTDIR)
GSMenu.class : ${SRCDIR}/GSMenu.java Window.class Title.class Button.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSMenu.java -d $(OUTDIR)
GSMenuController.class : ${SRCDIR}/GSMenuController.java GSMenu.class Window.class GSGrid.class GSPlay.class GSPlayController.class GSSolver.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSMenuController.java -d $(OUTDIR)
GSGrid.class GSCase.class GSCaseMouseListener.class : ${SRCDIR}/GSGrid.java GSMenu.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSGrid.java ${SRCDIR}/GSCase.java ${SRCDIR}/GSCaseMouseListener.java -d $(OUTDIR)
GSPlay.class GSPlayController.class : ${SRCDIR}/GSPlay.java GSGrid.class Button.class Window.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSPlay.java ${SRCDIR}/GSPlayController.java -d $(OUTDIR)
GSSolver.class : ${SRCDIR}/GSSolver.java GSGrid.class Window.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSSolver.java -d $(OUTDIR)
MusicButton.class : ${SRCDIR}/MusicButton.java MusicPlayer.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/MusicButton.java -d $(OUTDIR)
MusicPlayer.class : ${SRCDIR}/MusicPlayer.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/MusicPlayer.java -d $(OUTDIR)
Rules.class : ${SRCDIR}/Rules.java RulesDialogManager.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Rules.java -d $(OUTDIR)
RulesDialogManager.class : ${SRCDIR}/RulesDialogManager.java DialogManager.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/RulesDialogManager.java -d $(OUTDIR)
DialogManager.class : ${SRCDIR}/DialogManager.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/DialogManager.java -d $(OUTDIR)
RulesSudoku.class : ${SRCDIR}/RulesSudoku.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/RulesSudoku.java -d $(OUTDIR)
Window.class : ${SRCDIR}/Window.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Window.java -d $(OUTDIR)
Title.class : ${SRCDIR}/Title.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Title.java -d $(OUTDIR)
Button.class : ${SRCDIR}/Button.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Button.java -d $(OUTDIR)
GMUserInterfaceView.class : ${SRCDIR}/GMUserInterfaceView.java GMGrid.class GMResetGrid.class GMImport.class GMSaverActionListener.class GMHowToCreateController.class Rules.class GMUserInterfaceController.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMUserInterfaceView.java -d $(OUTDIR)
GMGrid.class : ${SRCDIR}/GMGrid.java GMCase.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMGrid.java -d $(OUTDIR)
GMCase.class GMCaseKeyListener.class GMCaseMouseListener.class : ${SRCDIR}/GMCase.java ${SRCDIR}/GMCaseKeyListener.java ${SRCDIR}/GMCaseMouseListener.java
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMCase.java ${SRCDIR}/GMCaseKeyListener.java ${SRCDIR}/GMCaseMouseListener.java -d $(OUTDIR)
GMResetGrid.class : ${SRCDIR}/GMResetGrid.java GMGrid.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMResetGrid.java -d $(OUTDIR)
GMImport.class : ${SRCDIR}/GMImport.java GMGrid.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMImport.java -d $(OUTDIR)
GMSaverActionListener.class GMSaver.class : ${SRCDIR}/GMSaverActionListener.java ${SRCDIR}/GMSaver.java GMGrid.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMSaverActionListener.java ${SRCDIR}/GMSaver.java -d $(OUTDIR)
GMHowToCreateController.class : ${SRCDIR}/GMHowToCreateController.java GMHowToCreateDialogManager.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMHowToCreateController.java -d $(OUTDIR)
GMHowToCreateDialogManager.class : ${SRCDIR}/GMHowToCreateDialogManager.java DialogManager.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMHowToCreateDialogManager.java -d $(OUTDIR)
GMUserInterfaceController.class : ${SRCDIR}/GMUserInterfaceController.java Window.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMUserInterfaceController.java -d $(OUTDIR)
GridMaker.class : ${SRCDIR}/GridMaker.java Window.class HomeView.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GridMaker.java -d $(OUTDIR)
GSWin.class : ${SRCDIR}/GSWin.java DialogManager.class CongratulationsDialog.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSWin.java -d $(OUTDIR)
CongratulationsDialog.class : ${SRCDIR}/CongratulationsDialog.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/CongratulationsDialog.java -d $(OUTDIR)
GSTest.class : ${SRCDIR}/GSTest.java GSGrid.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSTest.java -d $(OUTDIR)
GSImport.class : ${SRCDIR}/GSImport.java Window.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSImport.java -d $(OUTDIR)
### REGLES OPTIONNELLES ### ### REGLES OPTIONNELLES ###
all: GridMaker : Window.class Title.class RulesSudoku.class RulesDialogManager.class Rules.class MusicPlayer.class MusicButton.class HomeView.class HomeButtonClickListener.class GridMaker.class GMUserInterfaceView.class GMUserInterfaceController.class GMSaverActionListener.class GMSaver.class GMResetGrid.class GMImport.class GMHowToCreateView.class GMHowToCreateDialogManager.class GMHowToCreateController.class GMGrid.class GMChecker.class GMCaseMouseListener.class GMCaseKeyListener.class GMCase.class DialogManager.class Button.class
${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridMaker
GridMaker : $(OFILES) GridSolver : Window.class Title.class RulesSudoku.class RulesDialogManager.class Rules.class MusicPlayer.class MusicButton.class HomeView.class HomeButtonClickListener.class GSWin.class GSTest.class GSSolver.class GSPlayController.class GSPlay.class GSMenuController.class GSMenu.class GSImport.class GSGrid.class GSCaseMouseListener.class GSCase.class GridSolver.class DialogManager.class CongratulationsDialog.class Button.class
${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridMaker $(RUN_ARGS) ${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridSolver
GridSolver : $(OFILES)
${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridSolver $(RUN_ARGS)
clean : clean :
-rm -rf $(OUTDIR) -rm -rf $(OUTDIR)
@ -33,8 +121,10 @@ clean :
doc : doc :
javadoc -d $(DOCDIR) $(SRC) javadoc -d $(DOCDIR) $(SRC)
default:
### BUTS FACTICES ### ### BUTS FACTICES ###
.PHONY: all GridMaker GridSolver clean doc .PHONY : run clean doc
### FIN ### ### FIN ###