summaryrefslogtreecommitdiffstats
path: root/Algorithms/Part-II/2-SeamCarving/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Algorithms/Part-II/2-SeamCarving/Makefile')
-rw-r--r--Algorithms/Part-II/2-SeamCarving/Makefile27
1 files changed, 21 insertions, 6 deletions
diff --git a/Algorithms/Part-II/2-SeamCarving/Makefile b/Algorithms/Part-II/2-SeamCarving/Makefile
index 8a7d1c1..8e826fe 100644
--- a/Algorithms/Part-II/2-SeamCarving/Makefile
+++ b/Algorithms/Part-II/2-SeamCarving/Makefile
@@ -4,7 +4,7 @@ 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
+CLASSPATH = -classpath '.:$(ALGS4)/algs4.jar:$(ALGS4)/stdlib.jar'
.SUFFIXES:
.SUFFIXES: .java .class
@@ -16,13 +16,28 @@ CLASSPATH = -classpath .:$(ALGS4)/algs4.jar:$(ALGS4)/stdlib.jar
$(BIN): $(BIN).class
-run: $(BIN) $(CLASSES)
- java $(CLASSPATH) PrintEnergy ./data/6x5.png
- java $(CLASSPATH) PrintSeams ./data/6x5.png
+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
- zip $(BIN).zip $(SRCS)
+ rm -f *.zip
+ zip seamCarving.zip $(SRCS)
clean:
- rm -f *.class *.zip $(BIN)
+ rm -f *.class *.zip check.sh $(BIN)