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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
--- Makefile.orig 2010-07-20 19:18:58.000000000 +0200
+++ Makefile 2014-02-20 23:32:52.000000000 +0100
@@ -17,21 +17,21 @@
## Compiler defines
-cc = gcc
-CC = gcc
-AR = ar
-RANLIB = ranlib
-DEPENDFLAGS = -MM
-GNU_ANSI_FLAGS = -Wall -ansi -pedantic
-ANSI_FLAGS = ${GNU_ANSI_FLAGS}
-CFLAGS = $(ANSI_FLAGS)
+cc ?= gcc
+CC ?= gcc
+AR ?= ar
+RANLIB ?= ranlib
+DEPENDFLAGS ?= -MM
+GNU_ANSI_FLAGS ?= -Wall -ansi -pedantic
+ANSI_FLAGS += ${GNU_ANSI_FLAGS}
+CFLAGS += $(ANSI_FLAGS)
## Command defines
## gmake does not work on MacOSX or some versions of linux MAKE = gmake
-RM = rm
-MV = mv
-CP = cp
-TAR = tar
+RM ?= rm
+MV ?= mv
+CP ?= cp
+TAR ?= tar
## Installation
@@ -41,9 +41,9 @@
## Zlib defines
-ZLIB_INC = -I/usr/include
-ZLIB_PATH = -L/usr/lib
-ZLIB_LIBS = $(ZLIB_PATH) -lm -lz
+ZLIB_INC ?= -I/usr/include
+ZLIB_PATH ?= -L/usr/lib
+ZLIB_LIBS ?= $(ZLIB_PATH) -lm -lz
##############################################################
# platform specific redefines (to use, set ARCH appropriately)
@@ -116,33 +116,33 @@
znz:
echo "arch is $(ARCH)"
- (cd $(ZNZ); $(MAKE) depend; $(MAKE) lib;)
+ $(MAKE) -C $(ZNZ) depend lib
@echo " ----------- $(ZNZ) build completed."
@echo ""
nifti: znz
- (cd $(NIFTI); $(MAKE) depend; $(MAKE) lib;)
+ $(MAKE) -C $(NIFTI) depend lib
@echo " ----------- $(NIFTI) build completed."
@echo ""
nifticdf:nifti
- (cd $(NIFTICDF); $(MAKE) depend; $(MAKE) lib;)
+ $(MAKE) -C $(NIFTICDF) depend lib
@echo " ----------- $(NIFTICDF) build completed."
@echo ""
fslio: nifti
- (cd $(FSLIO); $(MAKE) depend; $(MAKE) lib;)
+ $(MAKE) -C $(FSLIO) depend lib
@echo " ---------- $(FSLIO) build completed."
@echo ""
example:nifti
- (cd $(EXAMPLES); $(MAKE) all;)
+ $(MAKE) -C $(EXAMPLES) all
@echo Example programs built.
@echo ""
utils: nifti nifticdf
- (cd $(UTILS); $(MAKE) all;)
+ $(MAKE) -C $(UTILS) all
@echo Utility programs built.
@echo ""
@@ -152,7 +152,7 @@
@echo ""
regress_data:
- (cd $(TESTING); $(MAKE) regress_data 'RM=$(RM)' 'TAR=$(TAR)'; )
+ $(MAKE) -C $(TESTING) regress_data 'RM=$(RM)' 'TAR=$(TAR)'
@echo ""
@echo Regression testing data installed.
@echo See Testing/README_regress for details.
@@ -167,25 +167,25 @@
$(INSTALL_LIB_DIR):
mkdir -p $@
-znz_install: $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR)
+znz_install: znz $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR)
($(CP) $(ZNZ)/*.a $(INSTALL_LIB_DIR); $(CP) $(ZNZ)/*.h $(INSTALL_INC_DIR);)
$(RANLIB) $(INSTALL_LIB_DIR)/*.a
@echo " $(ZNZ) installed."
@echo ""
-nifti_install: $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR)
+nifti_install: nifti $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR)
($(CP) $(NIFTI)/*.a $(INSTALL_LIB_DIR); $(CP) $(NIFTI)/*.h $(INSTALL_INC_DIR);)
$(RANLIB) $(INSTALL_LIB_DIR)/*.a
@echo " $(NIFTI) installed."
@echo ""
-nifticdf_install: $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR)
+nifticdf_install: nifticdf $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR)
($(CP) $(NIFTICDF)/*.a $(INSTALL_LIB_DIR); $(CP) $(NIFTICDF)/*.h $(INSTALL_INC_DIR);)
$(RANLIB) $(INSTALL_LIB_DIR)/*.a
@echo " $(NIFTI) installed."
@echo ""
-fslio_install: $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR)
+fslio_install: fslio $(INSTALL_INC_DIR) $(INSTALL_LIB_DIR)
($(CP) $(FSLIO)/*.a $(INSTALL_LIB_DIR); $(CP) $(FSLIO)/*.h $(INSTALL_INC_DIR);)
$(RANLIB) $(INSTALL_LIB_DIR)/*.a
@echo " $(FSLIO) installed."
@@ -212,19 +212,19 @@
(cd $(FSLIO); $(RM) -f *.o *.a core; $(RM) -f depend.mk;)
examples_clean:
- (cd $(EXAMPLES); $(MAKE) clean;)
+ $(MAKE) -C $(EXAMPLES) clean
utils_clean:
- (cd $(UTILS); $(MAKE) clean;)
+ $(MAKE) -C $(UTILS) clean
doc_clean:
($(RM) -fr docs/html;)
regress_clean:
- (cd $(TESTING); $(MAKE) regress_clean; )
+ $(MAKE) -C $(TESTING) regress_clean
regress_clean_all:
- (cd $(TESTING); $(MAKE) regress_clean_all; )
+ $(MAKE) -C $(TESTING) regress_clean_all
tar:
(cd .. ; ln -s $(THIS_DIR) ${TARFILE_NAME} ; \
|