Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions Makefile_evio
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,47 @@
PWD = $(shell pwd)

ifndef EVIO_VERSION
EVIO_VERSION=4.3.1
EVIO_VERSION=4.4.6
endif

MAJOR_MINOR = $(shell perl -e '$$v = "$(EVIO_VERSION)"; @t = split(/\./, $$v); print "$$t[0].$$t[1]";')
DIR_NAME = evio-$(EVIO_VERSION)
TARFILE = evio-$(EVIO_VERSION).tgz
EVIO_HOME = $(PWD)/$(DIR_NAME)
EVIO_DOWNLOAD_URL_BASE = https://coda.jlab.org/drupal/system/files/coda/evio
SCONS = $(shell $(BUILD_SCRIPTS)/python_chooser.sh scons)

# Grab from tagged release unless EVIO_BRANCH is defined
ifdef EVIO_BRANCH
WGET_URL = https://github.com/JeffersonLab/evio/archive/$(EVIO_BRANCH).tar.gz
DIR_NAME = $(EVIO_BRANCH)
else
WGET_URL = https://github.com/JeffersonLab/evio/archive/v$(EVIO_VERSION).tar.gz
endif

all: $(EVIO_HOME)/.scons_done

# Version evio-4.3: retrieve from coda website
# Version evio-4.4 and later: retrieve from github
$(TARFILE):
wget --no-verbose --no-check-certificate $(EVIO_DOWNLOAD_URL_BASE)/evio-$(MAJOR_MINOR)/$(TARFILE)
ifeq ($(MAJOR_MINOR),4.3)
wget --no-verbose --no-check-certificate https://coda.jlab.org/drupal/system/files/coda/evio/evio-$(MAJOR_MINOR)/$(TARFILE)
else
wget --no-verbose --no-check-certificate -O $@ $(WGET_URL)
endif

$(EVIO_HOME)/.untar_done: $(TARFILE)
mkdir -p temp
cd temp ; tar zxf ../$(TARFILE)
mv -v temp/evio-$(MAJOR_MINOR)* $(DIR_NAME)
mv -v temp/evio** $(DIR_NAME)
rmdir -v temp
date > $@

$(EVIO_HOME)/.patch_done: $(EVIO_HOME)/.untar_done
ifeq ($(MAJOR_MINOR),4.3)
cd $(EVIO_HOME) ; patch -p1 < $(BUILD_SCRIPTS)/patches/evio/evio-4.3.patch
endif
cd $(EVIO_HOME) ; patch SConstruct < $(BUILD_SCRIPTS)/patches/evio/SConstruct.patch
cd $(EVIO_HOME) ; patch coda.py < $(BUILD_SCRIPTS)/patches/evio/coda.py.patch
endif
date > $@

$(EVIO_HOME)/.scons_done: $(EVIO_HOME)/.patch_done
Expand Down