forked from h2oai/h2o-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (68 loc) · 3.1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# For each supported HADOOP_VERSION, add _JAR_DIR and _JARS below,
# and add a line to the build target.
#
cdh3_JAR_DIR=../lib/hadoop/cdh3
cdh3_JARS=$(cdh3_JAR_DIR)/hadoop-core-0.20.2-cdh3u6.jar
cdh4_JAR_DIR=../lib/hadoop/cdh4
cdh4_JARS=$(cdh4_JAR_DIR)/hadoop-common.jar${SEP}${cdh4_JAR_DIR}/hadoop-annotations-2.0.0-cdh4.2.0.jar${SEP}$(cdh4_JAR_DIR)/hadoop-mapreduce-client-core-2.0.0-cdh4.2.0.jar
cdh5_JAR_DIR=../lib/hadoop/cdh5
cdh5_JARS=$(cdh5_JAR_DIR)/common/hadoop-common-2.2.0-cdh5.0.0-beta-2.jar${SEP}${cdh5_JAR_DIR}/common/lib/hadoop-annotations-2.2.0-cdh5.0.0-beta-2.jar${SEP}$(cdh5_JAR_DIR)/mapreduce2/hadoop-mapreduce-client-core-2.2.0-cdh5.0.0-beta-2.jar
cdh4_yarn_JAR_DIR=../lib/hadoop/cdh4_yarn
cdh4_yarn_JAR_DIR=../lib/hadoop/cdh4_yarn
cdh4_yarn_JARS=$(cdh4_yarn_JAR_DIR)/common/hadoop-common-2.0.0-cdh4.3.0.jar${SEP}${cdh4_yarn_JAR_DIR}/common/lib/hadoop-annotations-2.0.0-cdh4.3.0.jar${SEP}$(cdh4_yarn_JAR_DIR)/mapreduce2/hadoop-mapreduce-client-core-2.0.0-cdh4.3.0.jar
mapr2.1.3_JAR_DIR=../lib/hadoop/mapr2.1.3
mapr2.1.3_JARS=$(mapr2.1.3_JAR_DIR)/hadoop-0.20.2-dev-core.jar
hdp1.3.2_JAR_DIR=../lib/hadoop/hdp1.3.2
hdp1.3.2_JARS=$(hdp1.3.2_JAR_DIR)/hadoop-core-1.2.0.1.3.2.0-111.jar
hdp2.0.6_JAR_DIR=../lib/hadoop/hdp2.0.6
hdp2.0.6_JARS=$(hdp2.0.6_JAR_DIR)/hadoop-common-2.2.0.2.0.6.0-101.jar${SEP}$(hdp2.0.6_JAR_DIR)/hadoop-mapreduce-client-core-2.2.0.2.0.6.0-101.jar${SEP}${hdp2.0.6_JAR_DIR}/hadoop-annotations-2.2.0.2.0.6.0-101.jar
# ------------------------------
# Figure out classpath separator for Unix vs. Windows
ifndef SEP
UNAME = $(shell uname)
ifeq ($(UNAME),Darwin)
SEP=:
endif
ifeq ($(UNAME),Linux)
SEP=:
endif
ifndef SEP
UNAME_DASH_O = $(shell uname -o)
ifeq ($(UNAME_DASH_O),Cygwin)
SEP?=;
else
SEP?=:
endif
endif
endif
COMMON_JARS=../lib/log4j/log4j-1.2.15.jar${SEP}../target/h2o.jar
HADOOP_JARS=$($(HADOOP_VERSION)_JARS)
default: build
F=src/main/java/water/hadoop/h2odriver_config.java
build_inner:
rm -f $(F)
@echo "package water.hadoop;" >> $(F)
@echo "class h2odriver_config {" >> $(F)
@echo " public static boolean usingYarn() { return $(YARN); }" >> $(F)
@echo "}" >> $(F)
mkdir classes/$(HADOOP_VERSION)
javac -Xlint:-deprecation -source 1.6 -target 1.6 -sourcepath src/main/java -classpath "$(COMMON_JARS)${SEP}$(HADOOP_JARS)" -d classes/$(HADOOP_VERSION) src/main/java/water/hadoop/*.java
jar cf target/h2odriver_$(HADOOP_VERSION).jar -C classes/$(HADOOP_VERSION) .
clean:
rm -fr classes target
rm -f src/main/java/water/hadoop/h2odriver_config.java
build: clean
mkdir classes
mkdir target
$(MAKE) build_inner HADOOP_VERSION=mapr2.1.3 YARN=false
$(MAKE) build_inner HADOOP_VERSION=cdh3 YARN=false
$(MAKE) build_inner HADOOP_VERSION=cdh4 YARN=false
$(MAKE) build_inner HADOOP_VERSION=cdh4_yarn YARN=true
$(MAKE) build_inner HADOOP_VERSION=cdh5 YARN=false
$(MAKE) build_inner HADOOP_VERSION=hdp1.3.2 YARN=false
$(MAKE) build_inner HADOOP_VERSION=hdp2.0.6 YARN=false
rm -rf ../target/hadoop
mkdir ../target/hadoop
cp README.txt ../target/hadoop
cp target/* ../target/hadoop