From 7f3c934a60d2b4e56608aa0e777e3868620b5f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 3 Apr 2014 23:40:17 +0200 Subject: Algorithms-II : 1-WordNet: replace run.sh with Makefile --- Algorithms/Part-II/1-WordNet/Makefile | 28 ++++++++++++++++++++++++++++ Algorithms/Part-II/1-WordNet/run.sh | 19 ------------------- 2 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 Algorithms/Part-II/1-WordNet/Makefile delete mode 100755 Algorithms/Part-II/1-WordNet/run.sh 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 - -- cgit v1.1-2-g2b99