-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile_hd_utilities
52 lines (44 loc) · 1.59 KB
/
Makefile_hd_utilities
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
# Makefile_hd_utilities
PWD = $(shell pwd)
ifdef HD_UTILITIES_VERSION
SOURCE_CODE_TARGET = $(HD_UTILITIES_HOME)/.untar_done
ifdef HD_UTILITIES_DIRTAG
HD_UTILITIES_DIR = hd_utilities-$(HD_UTILITIES_VERSION)^$(HD_UTILITIES_DIRTAG)
else
HD_UTILITIES_DIR = hd_utilities-$(HD_UTILITIES_VERSION)
endif
TARFILE = $(HD_UTILITIES_VERSION).tar.gz
else
SOURCE_CODE_TARGET = $(HD_UTILITIES_HOME)/.clone_done
ifndef HD_UTILITIES_URL
HD_UTILITIES_URL=https://github.com/jeffersonlab/hd_utilities
endif
ifdef HD_UTILITIES_DIRTAG
HD_UTILITIES_DIR = $(notdir $(HD_UTILITIES_URL))^$(HD_UTILITIES_DIRTAG)
else
HD_UTILITIES_DIR = $(notdir $(HD_UTILITIES_URL))
endif
ifndef HD_UTILITIES_BRANCH
HD_UTILITIES_BRANCH = master
endif
endif
UNTAR_TEMP_DIR := untar_temp_dir_$(shell echo $$RANDOM)
HD_UTILITIES_HOME = $(PWD)/$(HD_UTILITIES_DIR)
all: $(HD_UTILITIES_HOME)/hd_utilities_prereqs_version.xml
$(TARFILE):
wget --no-verbose --no-check-certificate -O $@ https://github.com/jeffersonlab/hd_utilities/archive/$(TARFILE)
$(HD_UTILITIES_HOME)/.clone_done:
git clone -b $(HD_UTILITIES_BRANCH) $(HD_UTILITIES_URL) $(HD_UTILITIES_DIR)
ifdef HD_UTILITIES_HASH
cd $(HD_UTILITIES_DIR) ; git checkout $(HD_UTILITIES_HASH)
endif
date > $@
$(HD_UTILITIES_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)/* $(HD_UTILITIES_DIR)
rmdir -v $(UNTAR_TEMP_DIR)
date > $@
$(HD_UTILITIES_HOME)/hd_utilities_prereqs_version.xml: $(SOURCE_CODE_TARGET)
cd $(HD_UTILITIES_HOME) ; $(BUILD_SCRIPTS)/version_prereqs.pl hd_utilities