#
# This is a simple makefile to assist with quickly building the Exercises of MP2.
#
# To build and execute a particular exercise:
# - For a single exercise, type 'make runA' to run exercise A.
# - For all exercises, 'make'.
#
#
HADOOP_CLASSPATH := ${JAVA_HOME}/lib/tools.jar
export HADOOP_CLASSPATH
HDFS=user/lada38/lab3
OBJDIR=build
JAR := MapReducePSO.jar
TARGETS := $(addprefix run, 1 2)
.PHONY: final $(TARGETS) clean
final: $(TARGETS)
run1: $(OBJDIR)/WHV1.class
jar -cvf $(JAR) -C $(OBJDIR)/ ./
hdfs dfs -rm -r -skipTrash -f /$(HDFS)/Aout/
hadoop jar $(JAR) WHV1 -D percentage=.2 /user/adampap/WHVsmall /$(HDFS)/Aout
@echo "Run the following command to read the output file:"
@echo "hdfs dfs -cat /$(HDFS)/Aout/part*"
run2: $(OBJDIR)/WHV2.class
jar -cvf $(JAR) -C $(OBJDIR)/ ./
hdfs dfs -rm -r -skipTrash -f /$(HDFS)/Bout/
hadoop jar $(JAR) WHV2 -D N=10 /user/adampap/WHVsmall /$(HDFS)/Bout
@echo "Run the following command to read the output file:"
@echo "hdfs dfs -cat /$(HDFS)/Bout/part*"
$(OBJDIR)/%.class: %.java | $(OBJDIR)
hadoop com.sun.tools.javac.Main $< -d $(OBJDIR)
$(OBJDIR):
mkdir $@
.PHONY: clean
clean:
rm -f $(OBJDIR)/* $(JAR)
hdfs dfs -rm -r -skipTrash -f /$(HDFS)/*-output/
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}