# Simplified Standard CS61B Makefile definitions for Java # Targets: # all: All classes compiled from files listed in SRCS # clean: Clean up compiled .class files and other junk # # Assumes that you have defined SRCS (list of .java files) # Default Java compiler JC = javac # Default flags to Java compiler JFLAGS = -g CLASSES = $(SRCS:.java=.class) # Default rule for random Java compilation (so that typing gmake foo.class # compiles foo.java). %.class: %.java $(JC) $(JFLAGS) $< # Default target. Typing plain 'gmake' compiles RatioCalc.class (and # Rational.class, if needed. all: $(CLASSES) $(CLASSES): $(SRCS) $(JC) $(JFLAGS) $(SRCS) # To get rid of other files, just add more clean:: (double colon) entries # like this one to your file. clean:: /bin/rm -f *~ "#"* core */*~ */"#"* */core *.tmp */*.tmp /bin/rm -f $(CLASSES) $(TESTS:%=%.results)