-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
32 lines (23 loc) · 901 Bytes
/
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
SCALA_VERSION ?= 2.11.11
HADOOP_HOME ?= /usr/local/hadoop
M2_REPO ?= /usr/local/share/mahout-m2-repo
M2_DEFINES = -Phadoop2 -DskipTests -Dspark.version=$(SPARK_VERSION)
M2_DEFINES += -Dscala.version=$(SCALA_VERSION) -Dscala.compat.version=$(basename $(SCALA_VERSION))
BUILT_JARS = $(wildcard *.jar)
DEPLOY_DEFINES = -Durl=file://$(M2_REPO) -DgroupId=org.apache.mahout
.PHONY: all prereq build deploy
all: build deploy
prereq:
ifeq ($(SPARK_VERSION),)
$(error SPARK_VERSION environment variable is not given!)
endif
build: prereq
@export HADOOP_HOME=$(HADOOP_HOME) && \
mvn clean package $(M2_DEFINES)
deploy:
@$(MAKE) $(patsubst %,__%,$(BUILT_JARS))
__%.jar:
@version=`echo $* | sed -rn 's/.*-(([0-9]|\.)+).*/\1/p'` ;\
artifact=`echo $* | sed -rn 's/(.*)-([0-9]|\.)+.*/\1/p'` ;\
\
mvn deploy:deploy-file $(DEPLOY_DEFINES) -DartifactId=$$artifact -Dversion=$$version -Dfile=$*.jar