1 |
gezelter |
1240 |
##################################################### |
2 |
|
|
# Makefile for libmdtools (bundled with OOPSE) # |
3 |
|
|
##################################################### |
4 |
|
|
# You should not change anything here. # |
5 |
|
|
##################################################### |
6 |
|
|
|
7 |
|
|
# No make rules by default |
8 |
|
|
.SUFFIXES : .c .cpp .hpp .h $(O) |
9 |
|
|
|
10 |
|
|
# Extension of object files |
11 |
|
|
O=.o |
12 |
|
|
|
13 |
|
|
# Extension of executables |
14 |
|
|
EXE= |
15 |
|
|
|
16 |
|
|
# Bourn shell |
17 |
|
|
SHELL=/bin/sh |
18 |
|
|
|
19 |
|
|
# Path prefix for installation links |
20 |
|
|
PREFIX=/usr/local |
21 |
|
|
|
22 |
|
|
# List of subdirectories |
23 |
|
|
SUBDIRS=libBASS libmdtools src forceFields samples utils utils/sysbuilder staticProps third-party shapes |
24 |
|
|
|
25 |
|
|
# Location of the oopse home |
26 |
|
|
OOPSE_HOME=/usr/local/oopse |
27 |
|
|
|
28 |
|
|
FORCE_PARAM_DIR=/usr/local/oopse/share/forceFields/ |
29 |
|
|
SAMPLE_SIM_DIR=/usr/local/oopse/share/samples/ |
30 |
|
|
|
31 |
|
|
# SPRNG library path |
32 |
|
|
SPRNG_LIBDIR=/usr/local/lib |
33 |
|
|
|
34 |
|
|
# SPRNG library |
35 |
|
|
SPRNG_LIB=-lsprng |
36 |
|
|
|
37 |
|
|
# SPRNG include path |
38 |
|
|
SPRNG_INC=-I/usr/local/include/sprng |
39 |
|
|
|
40 |
|
|
# MPICH library path |
41 |
|
|
MPI_LIBDIR=/usr/local/mpich/lib |
42 |
|
|
|
43 |
|
|
# MPICH library |
44 |
|
|
MPI_LIB=-lmpich |
45 |
|
|
|
46 |
|
|
# MPICH include path |
47 |
|
|
MPI_INC=/usr/local/mpich/include |
48 |
|
|
|
49 |
|
|
# MODDIRFLAG |
50 |
|
|
MODDIRFLAG=-I |
51 |
|
|
|
52 |
|
|
# Location of yacc (or its substitution) |
53 |
|
|
YACC=bison -y |
54 |
|
|
|
55 |
|
|
#location of lex |
56 |
|
|
LEX=flex |
57 |
|
|
|
58 |
|
|
# C compiler |
59 |
|
|
CC=icc8 |
60 |
|
|
|
61 |
|
|
# C++ compiler |
62 |
|
|
|
63 |
|
|
CXX=icpc8 |
64 |
|
|
|
65 |
|
|
# ar |
66 |
|
|
AR=ar |
67 |
|
|
|
68 |
|
|
# ranlib |
69 |
|
|
RANLIB=ranlib |
70 |
|
|
|
71 |
|
|
# rm |
72 |
|
|
RM=rm -f |
73 |
|
|
|
74 |
|
|
# soft link |
75 |
|
|
LN_S=ln -s |
76 |
|
|
|
77 |
|
|
# BSD install |
78 |
|
|
INSTALL=/usr/bin/install -c |
79 |
|
|
INSTALL_PROGRAM=${INSTALL} |
80 |
|
|
INSTALL_DATA=${INSTALL} -m 644 |
81 |
|
|
MKINSTALLDIRS=/home/maul/gezelter/gezelter/OOPSE/ac-tools/shtool mkdir -p -f |
82 |
|
|
|
83 |
|
|
# CPP flags |
84 |
|
|
CPPFLAGS= |
85 |
|
|
|
86 |
|
|
# C flags |
87 |
|
|
CFLAGS_C=-O3 |
88 |
|
|
|
89 |
|
|
# C++ flags |
90 |
|
|
CXXFLAGS_C=-O3 |
91 |
|
|
|
92 |
|
|
# C++ template flags |
93 |
|
|
OOPSE_TEMPLATE_FLAGS= |
94 |
|
|
|
95 |
|
|
# C++ namespace flags |
96 |
|
|
EXTRA_CC_FLAG= |
97 |
|
|
|
98 |
|
|
# Preprocessor flag for fortran |
99 |
|
|
PREPFLAG= |
100 |
|
|
|
101 |
|
|
# Preprocessor define flag for fortran |
102 |
|
|
PREPDEFFLAG= |
103 |
|
|
|
104 |
|
|
# LDFLAGS |
105 |
|
|
LDFLAGS= -L/usr/local/mpich/lib |
106 |
|
|
|
107 |
|
|
# First do compile-time flags: |
108 |
|
|
|
109 |
|
|
DECLARE=-DFRC_PATH="$(FORCE_PARAM_DIR)" |
110 |
|
|
MPI_DECLARE=-DIS_MPI |
111 |
|
|
|
112 |
|
|
# include paths starting with "." are all relative to the SUBDIRS!!! |
113 |
|
|
|
114 |
|
|
INCLUDES= -I.. -I../../libBASS $(SPRNG_INC) |
115 |
|
|
MPI_INCLUDES= -I$(MPI_INC) |
116 |
|
|
|
117 |
|
|
CFLAGS=$(CFLAGS_C) $(INCLUDES) $(DECLARE) $(MPI_INCLUDES) $(FUNCWRAP) |
118 |
|
|
CXXFLAGS=$(CXXFLAGS_C) $(OOPSE_TEMPLATE_FLAGS) $(EXTRA_CC_FLAG) $(INCLUDES) $(DECLARE) $(FUNCWRAP) |
119 |
|
|
DEPFLAGS=$(CFLAGS_C) -I. -I../libBASS $(SPRNG_INC) $(MPI_INCLUDES) |
120 |
|
|
|
121 |
|
|
MPI_CFLAGS=$(CFLAGS) $(MPI_INCLUDES) $(MPI_DECLARE) |
122 |
|
|
MPI_CXXFLAGS=$(CXXFLAGS) $(MPI_INCLUDES) $(MPI_DECLARE) |
123 |
|
|
|
124 |
|
|
SRC_DIR := .. |
125 |
|
|
|
126 |
|
|
FORCER=forcer$(EXE) |
127 |
|
|
LDADD=-lz |
128 |
|
|
|
129 |
|
|
# Then do the compile rules: |
130 |
|
|
|
131 |
|
|
obj/%.o: %.cpp |
132 |
|
|
cd obj; $(CXX) $(CXXFLAGS) -c $(SRC_DIR)/$< |
133 |
|
|
|
134 |
|
|
MPIobj/%.o: %.cpp |
135 |
|
|
cd MPIobj; $(CXX) $(MPI_CXXFLAGS) -c $(SRC_DIR)/$< |
136 |
|
|
|
137 |
|
|
obj/%.o: %.c |
138 |
|
|
cd obj; $(CC) $(CFLAGS) -c $(SRC_DIR)/$< |
139 |
|
|
|
140 |
|
|
MPIobj/%.o: %.c |
141 |
|
|
cd MPIobj; $(CC) $(MPI_CFLAGS) -c $(SRC_DIR)/$< |
142 |
|
|
|
143 |
|
|
# Then list what we have to compile |
144 |
|
|
# |
145 |
|
|
C_FILES = \ |
146 |
|
|
$(DIR)/forcerCmd.c |
147 |
|
|
|
148 |
|
|
CXX_FILES = \ |
149 |
|
|
$(DIR)/forcer.cpp \ |
150 |
|
|
$(DIR)/PDBReader.cpp \ |
151 |
|
|
$(DIR)/VDWAtom.cpp |
152 |
|
|
|
153 |
|
|
DIR:=. |
154 |
|
|
C_SRCS := $(C_FILES) |
155 |
|
|
CXX_SRCS := $(CXX_FILES) |
156 |
|
|
SRCS := $(C_SRCS) $(CXX_SRCS) |
157 |
|
|
|
158 |
|
|
DIR:=obj |
159 |
|
|
C_OBJS := $(C_FILES:.c=.o) |
160 |
|
|
CXX_OBJS := $(CXX_FILES:.cpp=.o) |
161 |
|
|
OBJS := $(C_OBJS) $(CXX_OBJS) |
162 |
|
|
|
163 |
|
|
DIR:=MPIobj |
164 |
|
|
C_MPIOBJS := $(C_FILES:.c=.o) |
165 |
|
|
CXX_MPIOBJS := $(CXX_FILES:.cpp=.o) |
166 |
|
|
MPIOBJS := $(C_MPIOBJS) $(CXX_MPIOBJS) |
167 |
|
|
|
168 |
|
|
SUBDIRS = obj \ |
169 |
|
|
MPIobj |
170 |
|
|
|
171 |
|
|
# Possible make targets: |
172 |
|
|
|
173 |
|
|
all: forcer |
174 |
|
|
|
175 |
|
|
forcer$(EXE) : $(OBJS) |
176 |
|
|
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LDADD) |
177 |
|
|
|
178 |
|
|
install : $(FORCER) |
179 |
|
|
$(MKINSTALLDIRS) $(OOPSE_HOME)/bin |
180 |
|
|
$(INSTALL_PROGRAM) -s $(FORCER) $(OOPSE_HOME)/bin/$(FORCER) |
181 |
|
|
|
182 |
|
|
|
183 |
|
|
.PHONY : clean |
184 |
|
|
|
185 |
|
|
clean : dummy |
186 |
|
|
for i in $(LIBSUBDIRS); do \ |
187 |
|
|
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
188 |
|
|
done |
189 |
|
|
$(RM) forcer *.o *.mod *~ Make.temp Make.ftemp |
190 |
|
|
|
191 |
|
|
distclean : dummy |
192 |
|
|
for i in $(LIBSUBDIRS); do \ |
193 |
|
|
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
194 |
|
|
done |
195 |
|
|
$(RM) forcer *.o *.mod *~ Make.temp Make.ftemp |
196 |
|
|
|
197 |
|
|
depend : Make.dep |
198 |
|
|
|
199 |
|
|
Make.dep : |
200 |
|
|
echo "Only C dependencies are made automagically!" |
201 |
|
|
echo "# DO NOT DELETE THIS LINE - used by make depend" > Make.dep |
202 |
|
|
$(CC) $(DEPFLAGS) -MM $(C_SRCS) \ |
203 |
|
|
| sed 's/\.o:/\$$(O)\ :/g' > Make.temp |
204 |
|
|
$(CXX) $(DEPFLAGS) -MM $(CXX_SRCS) \ |
205 |
|
|
| sed 's/\.o:/\$$(O)\ :/g' >> Make.temp |
206 |
|
|
cat Make.temp | sed 's/^[a-zA-Z0-9]/obj\/&/g' >> Make.dep |
207 |
|
|
cat Make.temp | sed 's/^[a-zA-Z0-9]/MPIobj\/&/g' >> Make.dep |
208 |
|
|
# ../scripts/sfmakedepend -I $(MPI_F90_MODS) -d obj -f ./Make.ftemp -h *.F90 |
209 |
|
|
# ../scripts/sfmakedepend -I $(MPI_F90_MODS) -d MPIobj -f ./Make.ftemp -h *.F90 |
210 |
|
|
# cat Make.ftemp | sed 's/\.o:/\$$(O)\ :/g' >> Make.dep |
211 |
|
|
$(RM) Make.ftemp Make.temp |
212 |
|
|
|
213 |
|
|
install : dummy |
214 |
|
|
|
215 |
|
|
links : dummy |
216 |
|
|
|
217 |
|
|
tests : dummy |
218 |
|
|
|
219 |
|
|
dummy : |
220 |
|
|
|
221 |
|
|
include Make.dep |