summaryrefslogtreecommitdiffstats
path: root/Algorithms/Part-II/2-SeamCarving/Makefile
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-12-17 15:24:54 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-12-17 15:24:54 +0100
commit31f4e08b3b0df3058619da493d15334caa3d4f55 (patch)
tree1e7f8df359678ba90d3dd33e6318776a5d4bec4e /Algorithms/Part-II/2-SeamCarving/Makefile
parente1ec44b3078a20c4e7ab85e30083063205159761 (diff)
downloadcoursera-31f4e08b3b0df3058619da493d15334caa3d4f55.zip
coursera-31f4e08b3b0df3058619da493d15334caa3d4f55.tar.gz
Algorithms-II : 2-SeamCarving: implementation (fast but heavy mem usage)
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)