summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-04-03 23:40:17 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-04-08 20:57:27 +0200
commit7f3c934a60d2b4e56608aa0e777e3868620b5f31 (patch)
treefb9deefd7bd3500457006ba0b49c5edd4b2efa14
parent31effd10b34f4de8bbb3a509187eebb5cc0f3b65 (diff)
downloadcoursera-7f3c934a60d2b4e56608aa0e777e3868620b5f31.zip
coursera-7f3c934a60d2b4e56608aa0e777e3868620b5f31.tar.gz
Algorithms-II : 1-WordNet: replace run.sh with Makefile
-rw-r--r--Algorithms/Part-II/1-WordNet/Makefile28
-rwxr-xr-xAlgorithms/Part-II/1-WordNet/run.sh19
2 files changed, 28 insertions, 19 deletions
diff --git a/Algorithms/Part-II/1-WordNet/Makefile b/Algorithms/Part-II/1-WordNet/Makefile
new file mode 100644
index 0000000..70edcc8
--- /dev/null
+++ b/Algorithms/Part-II/1-WordNet/Makefile
@@ -0,0 +1,28 @@
+
+CC = javac
+ALGS4 = ../../algs4
+BIN = Outcast
+SRCS = SAP.java Outcast.java WordNet.java Outcast.java
+CLASSES = SAP.class Outcast.class WordNet.class Outcast.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): $(CLASSES)
+
+test: $(BIN) $(CLASSES)
+ java $(CLASSPATH) $(BIN)
+
+zip: $(BIN)
+ $(ALGS4)/bin/findbugs $(BIN).class
+ rm -f *.zip
+ zip wordnet.zip $(SRCS)
+
+clean:
+ rm -f *.class *.zip $(BIN)
diff --git a/Algorithms/Part-II/1-WordNet/run.sh b/Algorithms/Part-II/1-WordNet/run.sh
deleted file mode 100755
index 7ec80c5..0000000
--- a/Algorithms/Part-II/1-WordNet/run.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/bash
-
-ALGS4=../../algs4
-export CLASSPATH="$ALGS4/algs4.jar:$ALGS4/stdlib.jar:."
-
-CLASSES="SpecializedBFS WordNet SAP Outcast"
-
-rm *.class *.zip 2>/dev/null
-
-for kls in $CLASSES; do
- $ALGS4/bin/checkstyle ${kls}.java
- javac -Xlint ${kls}.java || exit 1
-done
-$ALGS4/bin/findbugs *.class
-
-java Outcast || exit 1
-
-zip wordnet.zip *.java
-