-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
63 lines (51 loc) · 1.8 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
include ${FSLCONFDIR}/default.mk
PROJNAME = oxford_asl
# The FSL build system changed
# substantially in FSL 6.0.6
# FSL >= 6.0.6
ifeq (${FSL_GE_606}, true)
LIBS = -lfsl-newimage -lfsl-miscmaths -lfsl-cprob -lfsl-utils \
-lfsl-NewNifti -lfsl-znz
# FSL <= 6.0.5
else
ifeq ($(shell uname -s), Linux)
MATLIB := -lopenblas
endif
USRINCFLAGS = -I${INC_NEWMAT} -I${INC_ZLIB} \
-I${FSLDIR}/extras/include/armawrap
USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_ZLIB} -L${LIB_CPROB} \
-lutils -lnewimage -lmiscmaths -lcprob \
${MATLIB} -lNewNifti -lznz -lz
endif
XFILES = asl_file
SCRIPTS = oxford_asl asl_calib asl_reg quasil toast
PYMODULES = python/oxford_asl/*.py
PYGUI = python/oxford_asl/gui/*.py python/oxford_asl/gui/*.png
VERSIONED = oxford_asl asl_calib quasil asl_reg toast
OBJS = readoptions.o asl_functions.o
# Pass Git revision details
GIT_SHA1 := $(shell git describe --dirty)
GIT_DATE := $(shell git log -1 --format=%ad --date=local)
CXXFLAGS += -DGIT_SHA1=\"${GIT_SHA1}\" -DGIT_DATE="\"${GIT_DATE}\""
# Always rebuild scripts
.PHONY: FORCE
all: ${XFILES} ${VERSIONED}
asl_file: ${OBJS} asl_file.o
${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS}
$(VERSIONED): %: %.in FORCE
sed -e "s/@GIT_SHA1@/${GIT_SHA1}/" -e "s/@GIT_DATE@/${GIT_DATE}/" $< >$@
chmod a+x $@
# Only called in FSL <= 605
postinstallscript: $(PYMODULES) $(PYGUI)
mkdir -p $(DESTDIR)/python/oxford_asl/gui
cp $(PYMODULES) $(DESTDIR)/python/oxford_asl/
cp $(PYGUI) $(DESTDIR)/python/oxford_asl/gui/
cp wrappers/* $(DESTDIR)/bin/
# Only called in FSL >= 606
# setup.py -V is called to force creation
# of _version.py before installation
pyinstall:
fslpython python/setup.py -V
fslpython -m pip install --no-deps -vv ./python/ --prefix ${FSLDEVDIR}
clean:
rm -f ${VERSIONED} asl_file *.o