-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
62 lines (51 loc) · 1.73 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
include ${FSLCONFDIR}/default.mk
PROJNAME = fabber_qbold
XFILES = fabber_qbold
SOFILES = libfsl-fabber_models_qbold.so
AFILES = libfabber_models_qbold.a
# The FSL build system changed
# substantially in FSL 6.0.6
# FSL >= 6.0.6
ifeq (${FSL_GE_606}, true)
LIBS = -lfsl-fabberexec -lfsl-fabbercore -lfsl-newimage \
-lfsl-miscmaths -lfsl-utils -lfsl-NewNifti \
-lfsl-cprob -lfsl-znz -ldl
# FSL <= 6.0.5
else
ifeq ($(shell uname -s), Linux)
MATLIB := -lopenblas
endif
USRINCFLAGS = -I${INC_NEWMAT} -I${INC_CPROB} -I${INC_BOOST} \
-I.. -I${FSLDIR}/extras/include/armawrap
USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_CPROB} -L../fabber_core \
-lfabberexec -lfabbercore -lnewimage -lmiscmaths \
-lutils ${MATLIB} -lNewNifti -lznz -lz -ldl
endif
# Forward models
OBJS = fwdmodel_qbold.o
# For debugging:
#OPTFLAGS = -ggdb
# Pass Git revision details
GIT_SHA1 := $(shell git describe --match=NeVeRmAtCh --always --abbrev=40 --dirty)
GIT_DATE := $(shell git log -1 --format=%ad --date=local)
CXXFLAGS += -DGIT_SHA1=\"${GIT_SHA1}\" -DGIT_DATE="\"${GIT_DATE}\""
#
# Build
#
# FSL >=606 uses dynamic linking
ifeq (${FSL_GE_606}, true)
all: ${XFILES} ${SOFILES}
# models in a library
libfsl-fabber_models_qbold.so : ${OBJS}
${CXX} ${CXXFLAGS} -shared -o $@ $^ ${LDFLAGS}
# fabber built from the FSL fabbercore library including the models specifieid in this project
fabber_qbold : fabber_main.o | libfsl-fabber_models_qbold.so
${CXX} ${CXXFLAGS} -o $@ $< -lfsl-fabber_models_qbold ${LDFLAGS}
# FSL <=605 uses static linking
else
all: ${XFILES} ${AFILES}
libfabber_models_qbold.a : ${OBJS}
${AR} -r $@ $^
fabber_qbold : fabber_main.o ${OBJS}
${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS}
endif