1 |
##################################################### |
2 |
# Makefile for Oopse Utility Codes # |
3 |
##################################################### |
4 |
# You should not change anything here. # |
5 |
##################################################### |
6 |
|
7 |
TOP=../.. |
8 |
|
9 |
.SUFFIXES : .cpp .c $(O) |
10 |
|
11 |
# Extension of object files |
12 |
O=.o |
13 |
|
14 |
# Extension of executables |
15 |
EXE= |
16 |
|
17 |
# Bourn shell |
18 |
SHELL=/bin/sh |
19 |
|
20 |
# Path prefix for installation links |
21 |
PREFIX=/usr/local |
22 |
|
23 |
# List of subdirectories |
24 |
SUBDIRS=libBASS libmdtools src forceFields samples utils utils/sysbuilder staticProps third-party |
25 |
|
26 |
# Location of the oopse home |
27 |
OOPSE_HOME=/usr/local/oopse |
28 |
|
29 |
FORCE_PARAM_DIR=/usr/local/oopse/share/forceFields/ |
30 |
SAMPLE_SIM_DIR=/usr/local/oopse/share/samples/ |
31 |
|
32 |
# SPRNG library path |
33 |
SPRNG_LIBDIR=/usr/local/lib |
34 |
|
35 |
# SPRNG library |
36 |
SPRNG_LIB=-lsprng |
37 |
|
38 |
# SPRNG include path |
39 |
SPRNG_INC=-I/usr/local/include/sprng |
40 |
|
41 |
# MPICH library path |
42 |
MPI_LIBDIR=@MPI_LIBDIR@ |
43 |
|
44 |
# MPICH library |
45 |
MPI_LIB=-lmpich |
46 |
|
47 |
# MPICH include path |
48 |
MPI_INC=@MPI_INC@ |
49 |
|
50 |
# MPI F90 Module path |
51 |
MPI_F90_MODS=@MPI_F90_MODS@ |
52 |
|
53 |
# Compiler dependent Fortran module |
54 |
F90LIBS = -L/usr/local/intel/compiler80/lib -L/usr/lib -lifport -lifcoremt -limf -lm -lcxa -lunwind -lpthread -lirc |
55 |
|
56 |
# Location of yacc (or its substitution) |
57 |
YACC=bison -y |
58 |
|
59 |
#location of lex |
60 |
LEX=flex |
61 |
|
62 |
# C compiler |
63 |
CC=icc8 |
64 |
|
65 |
# C++ compiler |
66 |
|
67 |
CXX=icpc8 |
68 |
|
69 |
# F90 compiler |
70 |
F90=ifc8 |
71 |
|
72 |
# ar |
73 |
AR=ar |
74 |
|
75 |
# ranlib |
76 |
RANLIB=ranlib |
77 |
|
78 |
# rm |
79 |
RM=rm -f |
80 |
|
81 |
# soft link |
82 |
LN_S=ln -s |
83 |
|
84 |
# BSD install |
85 |
INSTALL=/usr/bin/install -c |
86 |
INSTALL_PROGRAM=${INSTALL} |
87 |
INSTALL_DATA=${INSTALL} -m 644 |
88 |
MKINSTALLDIRS=/home/maul/gezelter/chrisfen/code/cvsOOPSE/OOPSE-1.0/ac-tools/shtool mkdir -p -f |
89 |
|
90 |
# CPP flags |
91 |
CPPFLAGS= |
92 |
|
93 |
# C flags |
94 |
CFLAGS_C=-O3 |
95 |
|
96 |
# C++ flags |
97 |
CXXFLAGS_C=-O3 |
98 |
|
99 |
# Preprocessor flag for fortran |
100 |
PREPFLAG= |
101 |
|
102 |
# Preprocessor define flag for fortran |
103 |
PREPDEFFLAG= |
104 |
|
105 |
# Fortran flags |
106 |
FFLAGS_C=-O3 |
107 |
|
108 |
# LDFLAGS |
109 |
LDFLAGS= -L/usr/local/mpich//lib |
110 |
|
111 |
MPI_DECLARES= -DIS_MPI |
112 |
|
113 |
# include paths starting with "." are all relative to the SUBDIRS!!! |
114 |
|
115 |
INCLUDES= -I.. -I$(TOP)/../libBASS -I$(TOP)/../libmdtools |
116 |
CFLAGS=$(CFLAGS_C) $(INCLUDES) $(DECLARES) |
117 |
CXXFLAGS=$(CXXFLAGS_C) $(INCLUDES) $(DECLARES) |
118 |
DEPFLAGS=$(CFLAGS_C) -I. $(SPRNG_INC) -I$(TOP)/libBASS -I$(TOP)/libmdtools |
119 |
|
120 |
|
121 |
SYSBUILD=sysBuild$(EXE) |
122 |
BUILDER_LIB=libBuilder.a |
123 |
LBILAYER=latticeBilayer$(EXE) |
124 |
RBILAYER=randomBilayer$(EXE) |
125 |
|
126 |
BASS_LIB=$(TOP)/libBASS/libBASS.a |
127 |
MD_LIB=$(TOP)/libmdtools/libmdtools.a |
128 |
LIBS=$(BASS_LIB) $(MD_LIB) |
129 |
|
130 |
#SYSBUILD_LDFLAGS=-L$(TOP)/libBASS -L$(TOP)/libmdtools -L$(SPRNG_LIBDIR) |
131 |
#SYSBUILD_LDADD=-lmdtools -lBASS $(SPRNG_LIB) $(F90LIBS) |
132 |
|
133 |
|
134 |
SRC_DIR := $(PWD) |
135 |
|
136 |
LBILAYER_LDFLAGS=-L$(TOP)/libBASS -L$(TOP)/libmdtools -L$(SPRNG_LIBDIR) -L$(SRC_DIR) |
137 |
LBILAYER_LDADD=-lBuilder -lmdtools -lBASS $(SPRNG_LIB) $(F90LIBS) |
138 |
|
139 |
RBILAYER_LDFLAGS=-L$(TOP)/libBASS -L$(TOP)/libmdtools -L$(SPRNG_LIBDIR) -L$(SRC_DIR) |
140 |
RBILAYER_LDADD=-lBuilder -lmdtools -lBASS $(SPRNG_LIB) $(F90LIBS) |
141 |
|
142 |
PREFS=-DOOPSE_HOME=\"$(OOPSE_HOME)\" |
143 |
|
144 |
obj/%.o: %.cpp |
145 |
cd obj; $(CXX) $(CXXFLAGS) -c $(SRC_DIR)/$< |
146 |
|
147 |
MPIobj/%.o: %.cpp |
148 |
cd MPIobj; $(CXX) $(MPI_CXXFLAGS) -c $(SRC_DIR)/$< |
149 |
|
150 |
obj/%.o: %.c |
151 |
cd obj; $(CC) $(CFLAGS) -c $(SRC_DIR)/$< |
152 |
|
153 |
MPIobj/%.o: %.c |
154 |
cd MPIobj; $(CC) $(MPI_CFLAGS) -c $(SRC_DIR)/$< |
155 |
|
156 |
# sysBuilder files |
157 |
|
158 |
#SYSBUILD_C_FILES = $(DIR)/cmdline.c |
159 |
#SYSBUILD_CXX_FILES = \ |
160 |
# $(DIR)/sysBuild.cpp \ |
161 |
# $(DIR)/bilayerSys.cpp \ |
162 |
# $(DIR)/MoLocator.cpp \ |
163 |
# $(DIR)/latticeBuilder.cpp \ |
164 |
# $(DIR)/nanoBuilder.cpp |
165 |
|
166 |
#latticeBilayer files |
167 |
|
168 |
LBILAYER_CXX_FILES = $(DIR)/latticeBilayer.cpp |
169 |
|
170 |
RBILAYER_CXX_FILES = $(DIR)/randomBilayer.cpp |
171 |
|
172 |
# libBuilder files |
173 |
|
174 |
BUILDER_LIB_CXX_FILES = \ |
175 |
$(DIR)/MoLocator.cpp \ |
176 |
$(DIR)/latticeBuilder.cpp |
177 |
|
178 |
|
179 |
# the sources |
180 |
|
181 |
DIR:=. |
182 |
|
183 |
#SYSBUILD_C_SRCS := $(SYSBUILD_C_FILES) |
184 |
#SYSBUILD_CXX_SRCS := $(SYSBUILD_CXX_FILES) |
185 |
#SYSBUILD_SRCS := $(SYSBUILD_C_SRCS) $(SYSBUILD_CXX_SRCS) |
186 |
|
187 |
LBILAYER_CXX_SRCS := $(LBILAYER_CXX_FILES) |
188 |
LBILAYER_SRCS := $(LBILAYER_CXX_SRCS) |
189 |
|
190 |
RBILAYER_CXX_SRCS := $(RBILAYER_CXX_FILES) |
191 |
RBILAYER_SRCS := $(RBILAYER_CXX_SRCS) |
192 |
|
193 |
BUILDER_LIB_CXX_SRCS := $(BUILDER_LIB_CXX_FILES) |
194 |
BUILDER_LIB_SRCS := $(BUILDER_LIB_CXX_SRCS) |
195 |
|
196 |
C_CXX_SRCS := $(LBILAYER_SRCS) $(BUILDER_LIB_SRCS) $(RBILAYER_SRCS) |
197 |
|
198 |
C_SRCS := |
199 |
CXX_SRCS := $(LBILAYER_CXX_SRCS) $(BUILDER_LIB_CXX_SRCS) $(RBILAYER_CXX_SRCS) |
200 |
|
201 |
#the objects |
202 |
|
203 |
DIR:=obj |
204 |
|
205 |
#SYSBUILD_C_OBJS := $(SYSBUILD_C_FILES:.c=.o) |
206 |
#SYSBUILD_CXX_OBJS := $(SYSBUILD_CXX_FILES:.cpp=.o) |
207 |
#SYSBUILD_OBJS := $(SYSBUILD_C_OBJS) $(SYSBUILD_CXX_OBJS) |
208 |
|
209 |
LBILAYER_CXX_OBJS := $(LBILAYER_CXX_FILES:.cpp=.o) |
210 |
LBILAYER_OBJS := $(LBILAYER_CXX_OBJS) |
211 |
|
212 |
RBILAYER_CXX_OBJS := $(RBILAYER_CXX_FILES:.cpp=.o) |
213 |
RBILAYER_OBJS := $(RBILAYER_CXX_OBJS) |
214 |
|
215 |
BUILDER_LIB_CXX_OBJS := $(BUILDER_LIB_CXX_FILES:.cpp=.o) |
216 |
BUILDER_LIB_OBJS := $(BUILDER_LIB_CXX_OBJS) |
217 |
|
218 |
LIBSUBDIRS = \ |
219 |
obj |
220 |
|
221 |
all : $(BUILDER_LIB) $(LBILAYER) $(RBILAYER) |
222 |
|
223 |
depend: Make.dep |
224 |
|
225 |
#sysBuild$(EXE) : $(SYSBUILD_OBJS) $(BASS_LIB) $(MD_LIB) |
226 |
# $(CXX) $(CXXFLAGS) $(SYSBUILD_OBJS) -o $@ $(SYSBUILD_LDFLAGS) $(SYSBUILD_LDADD) |
227 |
|
228 |
libBuilder.a: $(BUILDER_LIB_OBJS) |
229 |
$(RM) $@ |
230 |
$(AR) cr $@ $(BUILDER_LIB_OBJS) |
231 |
$(RANLIB) $@ |
232 |
|
233 |
latticeBilayer$(EXE): $(LBILAYER_OBJS) $(BUILDER_LIB) $(BASS_LIB) $(MD_LIB) |
234 |
$(CXX) $(CXXFLAGS) $(LBILAYER_OBJS) -o $@ $(LBILAYER_LDFLAGS) $(LBILAYER_LDADD) |
235 |
|
236 |
randomBilayer$(EXE): $(RBILAYER_OBJS) $(BUILDER_LIB) $(BASS_LIB) $(MD_LIB) |
237 |
$(CXX) $(CXXFLAGS) $(RBILAYER_OBJS) -o $@ $(RBILAYER_LDFLAGS) $(RBILAYER_LDADD) |
238 |
|
239 |
install : $(LBILAYER) |
240 |
$(MKINSTALLDIRS) $(OOPSE_HOME)/bin |
241 |
$(INSTALL_PROGRAM) -s $(LBILAYER) $(OOPSE_HOME)/bin/$(LBILAYER) |
242 |
$(INSTALL_PROGRAM) -s $(RBILAYER) $(OOPSE_HOME)/bin/$(RBILAYER) |
243 |
|
244 |
|
245 |
tests : dummy |
246 |
|
247 |
|
248 |
$(OOPSE_HOME)/bin/$(LBILAYER) : $(LBILAYER) |
249 |
$(MAKE) install |
250 |
|
251 |
links : $(OOPSE_HOME)/bin/$(LBILAYER) |
252 |
$(MKINSTALLDIRS) $(PREFIX)/bin |
253 |
cd $(PREFIX)/bin; $(LN_S) -f $(OOPSE_HOME)/bin/$(LBILAYER) $(LBILAYER) |
254 |
cd $(PREFIX)/bin; $(LN_S) -f $(OOPSE_HOME)/bin/$(RBILAYER) $(RBILAYER) |
255 |
|
256 |
clean : dummy |
257 |
for i in $(LIBSUBDIRS); do \ |
258 |
(cd $$i; $(RM) *.o) || exit 1; \ |
259 |
done |
260 |
$(RM) $(LBILAYER) $(RBILAYER) $(BUILDER_LIB) *.o *~ Make.temp |
261 |
|
262 |
distclean : dummy |
263 |
for i in $(LIBSUBDIRS); do \ |
264 |
(cd $$i; $(RM) *.o) || exit 1; \ |
265 |
done |
266 |
$(RM) $(LBILAYER) $(RBILAYER) $(BUILDER_LIB) *.o *~ Make.temp |
267 |
|
268 |
devclean : distclean |
269 |
|
270 |
Make.dep : |
271 |
echo "# DO NOT DELETE THIS LINE - used by make depend" > Make.dep |
272 |
$(CC) $(DEPFLAGS) -MM $(C_SRCS) \ |
273 |
| sed 's/\.o:/\$$(O)\ :/g' > Make.temp |
274 |
$(CXX) $(DEPFLAGS) -MM $(CXX_SRCS) \ |
275 |
| sed 's/\.o:/\$$(O)\ :/g' >> Make.temp |
276 |
cat Make.temp | sed 's/^[a-zA-Z0-9]/obj\/&/g' >> Make.dep |
277 |
cat Make.temp | sed 's/^[a-zA-Z0-9]/MPIobj\/&/g' >> Make.dep |
278 |
$(RM) Make.temp |
279 |
|
280 |
tags : $(C_CXX_SRCS) |
281 |
ctags $(C_CXX_SRCS) |
282 |
|
283 |
dummy : |
284 |
|
285 |
# DO NOT DELETE |
286 |
include Make.dep |