2024-06-05 17:38:59 +02:00
|
|
|
# Variables
|
|
|
|
SRC_DIR = src
|
|
|
|
BIN_DIR = bin
|
2024-06-07 17:10:23 +02:00
|
|
|
RES_DIR = $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/resources
|
2024-06-07 17:44:24 +02:00
|
|
|
RES_BIN_DIR = $(BIN_DIR)/com/charpentierbalocchi/dorfjavatik/resources
|
2024-06-06 20:26:49 +02:00
|
|
|
JAVAC = javac
|
|
|
|
JAVA = java
|
|
|
|
JAVADOC = javadoc
|
|
|
|
MAIN = com.charpentierbalocchi.dorfjavatik.view.FenetreDemarrage
|
2024-06-05 17:38:59 +02:00
|
|
|
|
2024-06-06 20:26:49 +02:00
|
|
|
# Compilation flags
|
2024-06-07 17:10:23 +02:00
|
|
|
JFLAGS = -d $(BIN_DIR) -encoding UTF-8 -sourcepath $(SRC_DIR)
|
2024-06-05 17:38:59 +02:00
|
|
|
|
2024-06-06 20:26:49 +02:00
|
|
|
# Default rule
|
2024-06-07 17:14:08 +02:00
|
|
|
all: clean compile copy-resources
|
2024-06-05 17:38:59 +02:00
|
|
|
|
2024-06-06 20:26:49 +02:00
|
|
|
# Rule to compile the java files
|
|
|
|
compile:
|
2024-06-07 17:10:23 +02:00
|
|
|
@echo "Compilation des fichiers source java..."
|
2024-06-07 17:14:08 +02:00
|
|
|
@mkdir -p $(BIN_DIR)
|
2024-06-07 17:10:23 +02:00
|
|
|
@$(JAVAC) $(JFLAGS) $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/controller/*.java
|
|
|
|
@$(JAVAC) $(JFLAGS) $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/model/*.java
|
|
|
|
@$(JAVAC) $(JFLAGS) $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/util/*.java
|
|
|
|
@$(JAVAC) $(JFLAGS) $(SRC_DIR)/com/charpentierbalocchi/dorfjavatik/view/*.java
|
|
|
|
|
|
|
|
# Rule to copy resources
|
|
|
|
copy-resources:
|
|
|
|
@echo "Copying resources..."
|
2024-06-07 17:44:24 +02:00
|
|
|
@cp -r $(RES_DIR) $(RES_BIN_DIR)
|
2024-06-05 17:38:59 +02:00
|
|
|
|
2024-06-06 20:26:49 +02:00
|
|
|
# Rule to run the application
|
2024-06-07 17:14:08 +02:00
|
|
|
run: compile copy-resources
|
2024-06-07 17:10:23 +02:00
|
|
|
@echo "Lancement du jeu..."
|
2024-06-07 17:14:08 +02:00
|
|
|
@$(JAVA) -cp $(BIN_DIR) $(MAIN)
|
2024-06-05 17:38:59 +02:00
|
|
|
|
2024-06-06 20:26:49 +02:00
|
|
|
# Rule to generate Javadoc
|
|
|
|
javadoc:
|
|
|
|
@echo "Generating Javadoc..."
|
|
|
|
@$(JAVADOC) -d $(BIN_DIR)/docs -sourcepath $(SRC_DIR) -subpackages com.charpentierbalocchi.dorfjavatik
|
2024-06-05 17:38:59 +02:00
|
|
|
|
2024-06-06 20:26:49 +02:00
|
|
|
# Rule to clean the project
|
|
|
|
clean:
|
2024-06-07 17:10:23 +02:00
|
|
|
@echo "Nettoyage en cours..."
|
2024-06-07 17:14:08 +02:00
|
|
|
@rm -rf $(BIN_DIR)
|
2024-06-05 17:38:59 +02:00
|
|
|
|
2024-06-07 17:14:08 +02:00
|
|
|
.PHONY: all compile run javadoc clean copy-resources
|