Skip to content
Snippets Groups Projects
Commit 8152f255 authored by Thibaut DE SAIVRE's avatar Thibaut DE SAIVRE
Browse files

update makefile

parent 4cf814d5
No related branches found
No related tags found
No related merge requests found
# Output and source directories # Output and source directories
SOURCE_DIR = src SOURCE_DIR = src
OUTPUT_DIR = out OUTPUT_DIR = out
LIB_DIR = lib
# Main source and class files # Main source and class files
SRC_FILE = Main.java SRC_FILE = EditorTD1.java
CLASS_FILE = Main.class CLASS_FILE = Main.class
# Java compiler and interpreter paths # Java compiler and interpreter paths
JAVAC = javac JAVAC = javac
JAVA = java JAVA = java
# Classpath, including the "lib" directory
CLASSPATH = $(OUTPUT_DIR):$(LIB_DIR)/*
.PHONY: all compile run clean .PHONY: all compile run clean
# "make" will compile and run the program # "make" will compile and run the program
...@@ -17,12 +21,12 @@ all: compile run ...@@ -17,12 +21,12 @@ all: compile run
# "make compile" will compile the program # "make compile" will compile the program
compile: compile:
$(JAVAC) -sourcepath $(SOURCE_DIR) -d $(OUTPUT_DIR) $(SOURCE_DIR)/$(SRC_FILE) $(JAVAC) -sourcepath $(SOURCE_DIR) -d $(OUTPUT_DIR) -cp $(CLASSPATH) $(SOURCE_DIR)/$(SRC_FILE)
# "make run" will clear the terminal and run the program # "make run" will clear the terminal and run the program
run: run:
clear clear
$(JAVA) -classpath $(OUTPUT_DIR) $(basename $(SRC_FILE)) $(JAVA) -classpath $(CLASSPATH) $(basename $(SRC_FILE))
# "make clean" will remove the output directory's contents # "make clean" will remove the output directory's contents
clean: clean:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment