forked from quantcast/qfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
107 lines (96 loc) · 3.32 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# $Id$
#
# Created 2012/07/27
# Author: Mike Ovsiannikov
#
# Copyright 2012 Quantcast Corp.
#
# This file is part of Kosmos File System (KFS).
#
# Licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# Do not assume gnumake -- keep it as simple as possible
all: release
prep:
test -d build || mkdir build
release: prep
cd build && \
{ test -d release || mkdir release; } && \
cd release && \
cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo ../.. && \
$(MAKE) install
./src/java/javabuild.sh clean
if test -x "`which mvn 2>/dev/null`"; then \
./src/java/javabuild.sh ; fi
debug: prep
cd build && \
{ test -d debug || mkdir debug; } && \
cd debug && \
cmake ../.. && \
$(MAKE) install
./src/java/javabuild.sh clean
if test -x "`which mvn 2>/dev/null`"; then \
./src/java/javabuild.sh ; fi
hadoop-jars: release
./src/java/javabuild.sh clean
if test -x "`which mvn 2>/dev/null`"; then \
./src/java/javabuild.sh clean && \
./src/java/javabuild.sh 0.23.4 && \
./src/java/javabuild.sh 0.23.11 && \
./src/java/javabuild.sh 1.0.4 && \
./src/java/javabuild.sh 1.1.2 && \
./src/java/javabuild.sh 2.5.1 \
; fi
tarball: hadoop-jars
cd build && \
myuname=`uname -s`; \
if [ x"$$myuname" = x'Linux' -a -f /etc/issue ]; then \
myflavor=`head -n 1 /etc/issue | cut -d' ' -f1` ; \
if [ x"$$myflavor" = x'Ubuntu' ]; then \
myflavor="$$myflavor-`head -n 1 /etc/issue | cut -d' ' -f2`" ; \
elif [ x"$$myflavor" = x ]; then \
myflavor=$$myuname ; \
else \
myflavor="$$myflavor-`head -n 1 /etc/issue | cut -d' ' -f3`" ; \
fi ; \
else \
if echo "$$myuname" | grep CYGWIN > /dev/null; then \
myflavor=cygwin ; \
else \
myflavor=$$myuname ; \
fi ; \
fi ; \
qfsversion=`../src/cc/common/buildversgit.sh -v 2> /dev/null | head -1` ; \
tarname="qfs-$$myflavor-$$qfsversion-`uname -m`" ;\
tarname=`echo "$$tarname" | tr A-Z a-z` ; \
{ test -d tmpreldir || mkdir tmpreldir; } && \
rm -rf "tmpreldir/$$tarname" && \
mkdir "tmpreldir/$$tarname" && \
cp -r release/bin release/lib release/include ../scripts ../webui \
../examples ../benchmarks "tmpreldir/$$tarname/" && \
if ls -1 ./java/qfs-access/qfs-access-*.jar > /dev/null 2>&1; then \
cp ./java/qfs-access/qfs-access*.jar "tmpreldir/$$tarname/lib/"; fi && \
if ls -1 ./java/hadoop-qfs/hadoop-*.jar > /dev/null 2>&1; then \
cp ./java/hadoop-qfs/hadoop-*.jar "tmpreldir/$$tarname/lib/"; fi && \
tar cvfz "$$tarname".tgz -C ./tmpreldir "$$tarname" && \
rm -rf tmpreldir
python-release: release
cd build/release && python ../../src/cc/access/kfs_setup.py build
python-debug: debug
cd build/debug && python ../../src/cc/access/kfs_setup.py build
test-debug: debug
cd build/debug && ../../src/test-scripts/qfstest.sh
test-release: release
cd build/release && ../../src/test-scripts/qfstest.sh
clean:
rm -rf build/release build/debug build/qfs-*.tgz build/java