-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile_hdds
More file actions
101 lines (84 loc) · 2.78 KB
/
Makefile_hdds
File metadata and controls
101 lines (84 loc) · 2.78 KB
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
# 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)
CMAKE3 = $(shell $(BUILD_SCRIPTS)/cmake3_chooser.sh)
all: force_rebuild_action $(HDDS_HOME)/hdds_prereqs_version.xml
force_rebuild_action:
ifdef FORCE
@echo forcing rebuild
$(RM) $(HDDS_HOME)/.cmake_install_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)/.cmake_done: $(SOURCE_CODE_TARGET)
cd $(HDDS_HOME); \
mkdir -p build; \
cd build; \
$(CMAKE3) \
-DXercesC_LIBRARY=$(XERCESCROOT)/lib/libxerces-c.so \
-DXercesC_INCLUDE_DIR=$(XERCES_INCLUDE) \
-DXercesC_VERSION=$(XERCES_C_VERSION) \
-DCMAKE_INSTALL_PREFIX=$(HDDS_HOME)/$(BMS_OSNAME) .. ; \
date > $@
$(HDDS_HOME)/.cmake_build_done: $(HDDS_HOME)/.cmake_done
cd $(HDDS_HOME)/build; \
$(CMAKE3) --build . ; \
date > $@
# use "make install" rather than "cmake3 --install ." because ifarm does not like the latter
$(HDDS_HOME)/.cmake_install_done: $(HDDS_HOME)/.cmake_build_done
cd $(HDDS_HOME)/build; \
make install $(HDDS_SCONS_OPTIONS)
date > $@
ifndef GVMS_TEST
$(HDDS_HOME)/hdds_prereqs_version.xml: $(HDDS_HOME)/.cmake_install_done
else
$(HDDS_HOME)/hdds_prereqs_version.xml: $(SOURCE_CODE_TARGET)
endif
cd $(HDDS_HOME) ; $(BUILD_SCRIPTS)/version_prereqs.pl hdds