From 2edf4581fee4b948c7ba8b8de4ed47cc7c461f01 Mon Sep 17 00:00:00 2001 From: orfao Date: Sat, 4 May 2024 19:39:22 +0200 Subject: [PATCH] Correction du makefile --- Makefile | 5 ++++- Makefile-V2 | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Makefile-V2 diff --git a/Makefile b/Makefile index 45b337d..f61de1e 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,9 @@ GSMenuController.class : ${SRCDIR}/GSMenuController.java GSMenu.class Window.cla 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) @@ -125,4 +128,4 @@ default: .PHONY : run clean doc -### FIN ### +### FIN ### \ No newline at end of file diff --git a/Makefile-V2 b/Makefile-V2 new file mode 100644 index 0000000..40f7e5d --- /dev/null +++ b/Makefile-V2 @@ -0,0 +1,40 @@ +JC := javac +JCFLAGS := -encoding UTF-8 -implicit:none +JVM := java +JVMFLAGS := + +SRCDIR := ./src +OUTDIR := ./build +DOCDIR := ./doc +SRC := $(wildcard $(SRCDIR)/*.java) +OFILES := $(SRC:$(SRCDIR)/%.java=$(OUTDIR)/%.class) + +### REGLES ESSENTIELLES ### + +$(OUTDIR)/%.class : $(SRCDIR)/%.java + @mkdir -p $(@D) + ${JC} ${JCFLAGS} -cp $(SRCDIR) -d $(OUTDIR) $< + + +### REGLES OPTIONNELLES ### + +all: + +GridMaker : $(OFILES) + ${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridMaker $(RUN_ARGS) + +GridSolver : $(OFILES) + ${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridSolver $(RUN_ARGS) + +clean : + -rm -rf $(OUTDIR) + -rm -rf $(DOCDIR) + +doc : + javadoc -d $(DOCDIR) $(SRC) + +### BUTS FACTICES ### + +.PHONY: all GridMaker GridSolver clean doc + +### FIN ### \ No newline at end of file