Hadoop_Lab5: Makefile

File Makefile, 777 bytes (added by waue, 10 years ago)
Line 
1JarFile="sample-0.1.jar"
2MainFunc="Sample.WordCount"
3LocalOutDir="/tmp/output"
4HADOOP_BIN="/opt/hadoop/bin"
5
6all:jar run output clean
7
8jar:
9  jar -cvf ${JarFile} -C bin/ .
10
11run:
12  ${HADOOP_BIN}/hadoop jar ${JarFile} ${MainFunc} input output
13
14clean:
15  ${HADOOP_BIN}/hadoop fs -rmr output
16
17output:
18  rm -rf ${LocalOutDir}
19  ${HADOOP_BIN}/hadoop fs -get output ${LocalOutDir}
20  gedit ${LocalOutDir}/part-r-00000 & 
21
22help:
23  @echo "Usage:"
24  @echo " make jar     - Build Jar File."
25  @echo " make clean   - Clean up Output directory on HDFS."
26  @echo " make run     - Run your MapReduce code on Hadoop."
27  @echo " make output  - Download and show output file"
28  @echo " make help    - Show Makefile options."
29  @echo " "
30  @echo "Example:"
31  @echo " make jar; make run; make output; make clean"
32