Introduction to Makefile

Building a Project

Running code in java without modern IDE can be tedious: .java files are not runnable by default. You have to first compile them into a .class file before running. But the .class file will not update automatically when its .java file is updated - You have to compile them again. This sounds worse when the project gets larger: Let A.java reference the class on B.java, when you change some code in B.java, compiling and running A.java without recompiling B.java causes the change to be ignored. When B.java is referenced on more classes, you would have to end up re-compiling everything that depends on the class before running the actual application. The task becomes nearly impossible in bigger projects.

The Solution: Makefile

A written Makefile is:

Basic Syntax of a Makefile

Read more about Makefile