Skip to content

Instantly share code, notes, and snippets.

@TorNATO-PRO
Created September 30, 2021 18:53
Show Gist options
  • Save TorNATO-PRO/ae9229fcc3f7b75a7abee11933da87c6 to your computer and use it in GitHub Desktop.
Save TorNATO-PRO/ae9229fcc3f7b75a7abee11933da87c6 to your computer and use it in GitHub Desktop.
#
# A simple makefile for compiling three java classes
#
# define a makefile variable for the java compiler
#
JCC = javac
# define a makefile variable for compilation flags
# the -g flag compiles with debugging information
#
JFLAGS = -g
# typing 'make' will invoke the first target entry in the makefile
# (the default one in this case)
#
default: Average.class Convert.class Volume.class
# this target entry builds the Average class
# the Average.class file is dependent on the Average.java file
# and the rule associated with this entry gives the command to create it
#
Average.class: Average.java
$(JCC) $(JFLAGS) Average.java
Convert.class: Convert.java
$(JCC) $(JFLAGS) Convert.java
Volume.class: Volume.java
$(JCC) $(JFLAGS) Volume.java
# To start over from scratch, type 'make clean'.
# Removes all .class files, so that the next make rebuilds them
#
clean:
$(RM) *.class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment