This is a template for a Java project using the Makefile build system.
src/
βββ main
β βββ java
β β βββ com
β β βββ pokeverse
β β βββ pokemon
β β βββ App.java
β βββ resources
β βββ db.properties
βββ test
βββ java
βββ com
βββ pokeverse
βββ pokemon
βββ AppTest.java
make source
This target finds all Java source files in the $(SRC)
directory and saves their paths to a file named sources.txt
.
make compile
This target compiles the Java source files using $(JC) (the Java compiler)
and saves the compiled class files to the $(DIST)
directory. It also includes the classpath of the $(DIST)
directory and all JAR files in the $(LIB)
directory.
make run
This target runs the main class of the project using $(JAVA) (the Java runtime)
and the classpath of the $(DIST)
directory and all JAR files in the $(LIB)
directory.
make build
This target creates a JAR
file named App.jar containing the compiled class files and all files in the $(LIB)
directory, using $(JAR) (the Java archiver)
.
make exec
This target runs the main class of the project using the JAR
file created by the build target, as well as the classpath of the$(DIST)
directory and all JAR files in the $(LIB)
directory.