Ajout du Makefile

This commit is contained in:
Lyanis SOUIDI 2023-04-27 22:28:07 +02:00
parent 4f326ef2d1
commit bb6afe1c3e
Signed by: Lyanis SOUIDI
GPG Key ID: 251ADD56CFE6A854
3 changed files with 35 additions and 2 deletions

View File

@ -2,7 +2,6 @@
<configuration default="false" name="Labyrinthe" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="Main" />
<module name="SAE21_2022" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src" />
<method v="2">
<option name="Make" enabled="true" />
</method>

34
Makefile Normal file
View File

@ -0,0 +1,34 @@
### VARIABLES ###
JC = javac
JCFLAGS = -encoding UTF-8 -implicit:none
JVM = java
JVMFLAGS =
SRCDIR = ./src
OUTDIR = ./out
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)
mrproper : clean $(OUTDIR)/Main.class
### BUTS FACTICES ###
.PHONY : run clean mrproper
### FIN ###

View File

@ -118,6 +118,6 @@ public class HomeView extends JPanel {
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawImage(new ImageIcon("background.jpg").getImage(), 0, 0, getWidth(), getHeight(), null);
g.drawImage(new ImageIcon("./src/background.jpg").getImage(), 0, 0, getWidth(), getHeight(), null);
}
}