forked from h2oai/h2o-3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (67 loc) · 2.71 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
84
85
86
87
PROJECT_VERSION = 999999
# All the subdirs we might recursively make, in no particular order
SUBDIRS = h2o-core h2o-algos h2o-app h2o-scala #h2o-r h2o-hadoop h2o-docs assembly
# subdirs is a (phony) target we can make
.PHONY: subdirs $(SUBDIRS)
subdirs: $(SUBDIRS)
# Each subdir is its own (phony) target, using a recursive-make
$(SUBDIRS):
$(MAKE) -C $@
# By default, make all subdirs
default: subdirs build/h2o.jar
build/h2o.jar: h2o-app
@rm -f build/h2o.jar
@cp h2o-app/build/libs/h2o-web.jar build/h2o.jar
# Build, then run simple tests
check: subdirs
@-for d in $(SUBDIRS); do ($(MAKE) -C $$d check ); done
# h2o-core wants build info to get backed into the jar
h2o-core: build/BuildVersion.java
# h2o-algos needs h2o-core
h2o-algos: h2o-core
h2o-scala: h2o-core
h2o-app: h2o-core h2o-algos h2o-web
# R-integration requires H2O to be built first
#h2o-r: h2o-core
# Scala-integration requires H2O to be built first
#h2o-scala: h2o-core
# Hadoop/Yarn-integration requires H2O to be built first
#h2o-hadoop: h2o-core
# pkg needs other stuff built first
pkg: h2o-core h2o-r h2o-scala h2o-hadoop docs
# Recursive clean
.PHONY: clean
clean:
rm -rf build
-for d in $(SUBDIRS); do ($(MAKE) -C $$d clean ); done
# Recursive tool discovery.
# Called "config" here, after auto-conf, but really just asks each sub-make to list tools
.PHONY: conf
conf:
@which git
@which cut
@which date
@which grep
@which set
@which whoami
@-for d in $(SUBDIRS); do ($(MAKE) -C $$d conf ); done
# Build a Java Version file. Note that these next lines are all *text* to
# Makefile, the actual execution is delayed until the dependent file is built
# and the recipe runs.
BUILD_BRANCH= git branch | grep '*' | sed 's/* //'
BUILD_HASH= git log -1 --format="%H"
BUILD_DESCRIBE=git describe --always --dirty
BUILD_ON= date
BUILD_BY= (whoami | cut -d\\ -f2-)
FORCE:
build/BuildVersion.java: FORCE
@mkdir -p $(dir $@)
@echo "package water.init;" > $@
@echo "public class BuildVersion extends AbstractBuildVersion {" >> $@
@echo " public String branchName() { return \"$(shell $(BUILD_BRANCH))\"; }" >> $@
@echo " public String lastCommitHash() { return \"$(shell $(BUILD_HASH))\"; }" >> $@
@echo " public String describe() { return \"$(shell $(BUILD_DESCRIBE))\"; }" >> $@
@echo " public String projectVersion() { return \"$(PROJECT_VERSION)\"; }" >> $@
@echo " public String compiledOn() { return \"$(shell $(BUILD_ON))\"; }" >> $@
@echo " public String compiledBy() { return \"$(shell $(BUILD_BY))\"; }" >> $@
@echo "}" >> $@