2023-04-27 22:28:07 +02:00
|
|
|
### VARIABLES ###
|
|
|
|
|
|
|
|
JC = javac
|
|
|
|
JCFLAGS = -encoding UTF-8 -implicit:none
|
|
|
|
JVM = java
|
|
|
|
JVMFLAGS =
|
|
|
|
|
|
|
|
SRCDIR = ./src
|
|
|
|
OUTDIR = ./out
|
2023-04-28 20:10:44 +02:00
|
|
|
DOCDIR = ./doc
|
2023-04-27 22:28:07 +02:00
|
|
|
OFILES = $(subst src/,out/,$(subst .java,.class,$(shell find $(SRCDIR)/ -name *.java)))
|
|
|
|
|
|
|
|
### REGLES ESSENTIELLES ###
|
|
|
|
|
|
|
|
$(OUTDIR)/%.class : $(SRCDIR)/%.java
|
|
|
|
@mkdir -p $(@D)
|
|
|
|
${JC} ${JCFLAGS} -cp $(SRCDIR) -d $(@D) $<
|
|
|
|
|
|
|
|
$(OUTDIR)/Main.class : $(OFILES)
|
|
|
|
|
|
|
|
### REGLES OPTIONNELLES ###
|
|
|
|
|
|
|
|
run : $(OUTDIR)/Main.class
|
|
|
|
${JVM} ${JVMFLAGS} -cp $(OUTDIR) Main
|
|
|
|
|
|
|
|
clean :
|
|
|
|
-rm -rf $(OUTDIR)
|
2023-04-28 20:10:44 +02:00
|
|
|
-rm -rf $(DOCDIR)
|
2023-04-27 22:28:07 +02:00
|
|
|
|
|
|
|
mrproper : clean $(OUTDIR)/Main.class
|
|
|
|
|
2023-04-28 20:10:44 +02:00
|
|
|
doc :
|
|
|
|
javadoc -d $(DOCDIR) $(SRCDIR)/*.java
|
|
|
|
|
2023-04-27 22:28:07 +02:00
|
|
|
### BUTS FACTICES ###
|
|
|
|
|
|
|
|
.PHONY : run clean mrproper
|
|
|
|
|
|
|
|
### FIN ###
|