# gmake # Defaults to the first target: default # gmake default # Same as gmake compile. # gmake compile # Compiles Java code in this directory. # gmake check # Compile if needed and test using HW1Test. # gmake clean # Remove extraneous or rebuildable files # Define $(SRCS) to be a list of Java files. SRCS = Progs.java HW1Test.java IntList.java # The targets following .PHONY aren't actually files; they serve as commands. .PHONY: compile default check clean # By default, compile all sources default: compile # To compile all source files, just bring the file YearCheck.class up to date. compile: HW1Test.class # Test the compiled program, after first making sure it is up-to-date. check: HW1Test.class java HW1Test > tests.out diff -b tests.std tests.out # Remove extraneous or reconstructable files. clean: rm -f *.class *~ HW1Test.class: $(SRCS) javac -g $(SRCS)