CC = javac ALGS4 = $(HOME)/algs4 BIN = SeamCarver SRCS = SeamCarver.java CLASSES = PrintEnergy.class PrintSeams.class ResizeDemo.class SCUtility.class ShowEnergy.class ShowSeams.class CLASSPATH = -classpath '.:$(ALGS4)/algs4.jar:$(ALGS4)/stdlib.jar' .SUFFIXES: .SUFFIXES: .java .class .PHONY: clean $(BIN) .java.class: $(CC) -Xlint $(CLASSPATH) $< $(ALGS4)/bin/checkstyle $< $(BIN): $(BIN).class check.sh: echo -e "#! /bin/bash\nF=./data/\$${1}\njava $(CLASSPATH) PrintSeams \$${F}.png > \$${F}.txt && diff -B \$${F}.txt \$${F}.printseams.txt && rm \$${F}.txt" > check.sh chmod +x check.sh check: $(BIN) $(CLASSES) check.sh ./check.sh 3x7 ./check.sh 4x6 ./check.sh 5x6 ./check.sh 6x5 ./check.sh 7x3 ./check.sh 10x12 ./check.sh 12x10 ./check.sh HJocean ./check.sh HJoceanTransposed test: $(BIN) $(CLASSES) java $(CLASSPATH) ResizeDemo ./data/HJocean.png 200 100 zip: $(BIN) $(ALGS4)/bin/findbugs $(BIN).class rm -f *.zip zip seamCarving.zip $(SRCS) clean: rm -f *.class *.zip check.sh $(BIN)