-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile_hdds
81 lines (67 loc) · 2.17 KB
/
Makefile_hdds
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
# Makefile_hdds
# Builds HDDS under a new directory rooted in the current working
# directory. The new directory (DIR_NAME) has a name that depends on
# the version being built.
# HDDS_VERSION defines which tagged version to build. It should
# correspond to the name of the desired directory in the repos/tags
# directory of the repository. If left undefined, the latest version
# will be checked out from the repos/trunk.
SHELL = /bin/bash
include $(BUILD_SCRIPTS)/gcc_version.mk
PWD = $(shell pwd)
ifdef HDDS_VERSION
SOURCE_CODE_TARGET = $(HDDS_HOME)/.untar_done
ifdef HDDS_DIRTAG
HDDS_DIR = hdds-$(HDDS_VERSION)^$(HDDS_DIRTAG)
else
HDDS_DIR = hdds-$(HDDS_VERSION)
endif
TARFILE = $(HDDS_VERSION).tar.gz
else
SOURCE_CODE_TARGET = $(HDDS_HOME)/.clone_done
ifndef HDDS_URL
HDDS_URL=https://github.com/jeffersonlab/hdds
endif
ifdef HDDS_DIRTAG
HDDS_DIR = $(notdir $(HDDS_URL))^$(HDDS_DIRTAG)
else
HDDS_DIR = $(notdir $(HDDS_URL))
endif
ifndef HDDS_BRANCH
HDDS_BRANCH = master
endif
endif
SCONS = $(shell $(BUILD_SCRIPTS)/python_chooser.sh scons)
PYVERSION = $(shell $(BUILD_SCRIPTS)/python_chooser.sh version)
HDDS_HOME = $(PWD)/$(HDDS_DIR)
UNTAR_TEMP_DIR := untar_temp_dir_$(shell echo $$RANDOM)
all: force_rebuild_action $(HDDS_HOME)/hdds_prereqs_version.xml
force_rebuild_action:
ifdef FORCE
@echo forcing rebuild
$(RM) $(HDDS_HOME)/.sconstruct_done
endif
$(TARFILE):
wget --no-verbose --no-check-certificate -O $@ https://github.com/jeffersonlab/hdds/archive/$(TARFILE)
$(HDDS_HOME)/.clone_done:
git clone -b $(HDDS_BRANCH) $(HDDS_URL) $(HDDS_DIR)
ifdef HDDS_HASH
cd $(HDDS_DIR) ; git checkout $(HDDS_HASH)
endif
date > $@
$(HDDS_HOME)/.untar_done: $(TARFILE)
rm -rf $(UNTAR_TEMP_DIR)
mkdir $(UNTAR_TEMP_DIR)
cd $(UNTAR_TEMP_DIR) ; tar zxf ../$(TARFILE)
mv -v $(UNTAR_TEMP_DIR)/* $(HDDS_DIR)
rmdir -v $(UNTAR_TEMP_DIR)
date > $@
$(HDDS_HOME)/.sconstruct_done: $(SOURCE_CODE_TARGET)
cd $(HDDS_HOME) ; $(SCONS) install $(HDDS_SCONS_OPTIONS)
date > $@
ifndef GVMS_TEST
$(HDDS_HOME)/hdds_prereqs_version.xml: $(HDDS_HOME)/.sconstruct_done
else
$(HDDS_HOME)/hdds_prereqs_version.xml: $(SOURCE_CODE_TARGET)
endif
cd $(HDDS_HOME) ; $(BUILD_SCRIPTS)/version_prereqs.pl hdds