1 |
##################################################### |
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-icc7/lib |
42 |
|
43 |
# MPICH library |
44 |
MPI_LIB=-lmpich |
45 |
|
46 |
# MPICH include path |
47 |
MPI_INC=/usr/local/mpich-icc7/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=icc |
60 |
|
61 |
# C++ compiler |
62 |
|
63 |
CXX=icpc |
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=-p -O3 |
88 |
|
89 |
# C++ flags |
90 |
CXXFLAGS_C=-p -O3 |
91 |
|
92 |
# C++ template flags |
93 |
OOPSE_TEMPLATE_FLAGS=-instances=static |
94 |
|
95 |
# C++ namespace flags |
96 |
EXTRA_CC_FLAG= -LANG:std |
97 |
|
98 |
# Preprocessor flag for fortran |
99 |
PREPFLAG=-fpp1 |
100 |
|
101 |
# Preprocessor define flag for fortran |
102 |
PREPDEFFLAG= |
103 |
|
104 |
# LDFLAGS |
105 |
LDFLAGS= -L/usr/local/mpich-icc7/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 = \ |
169 |
obj \ |
170 |
MPIobj |
171 |
|
172 |
# Possible make targets: |
173 |
|
174 |
all: forcer |
175 |
|
176 |
forcer$(EXE) : $(OBJS) |
177 |
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LDADD) |
178 |
|
179 |
install : $(FORCER) |
180 |
$(MKINSTALLDIRS) $(OOPSE_HOME)/bin |
181 |
$(INSTALL_PROGRAM) -s $(FORCER) $(OOPSE_HOME)/bin/$(FORCER) |
182 |
|
183 |
|
184 |
.PHONY : clean |
185 |
|
186 |
clean : dummy |
187 |
for i in $(LIBSUBDIRS); do \ |
188 |
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
189 |
done |
190 |
$(RM) forcer *.o *.mod *~ Make.temp Make.ftemp |
191 |
|
192 |
distclean : dummy |
193 |
for i in $(LIBSUBDIRS); do \ |
194 |
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
195 |
done |
196 |
$(RM) forcer *.o *.mod *~ Make.temp Make.ftemp |
197 |
|
198 |
depend : Make.dep |
199 |
|
200 |
Make.dep : |
201 |
echo "Only C dependencies are made automagically!" |
202 |
echo "# DO NOT DELETE THIS LINE - used by make depend" > Make.dep |
203 |
$(CC) $(DEPFLAGS) -MM $(C_SRCS) \ |
204 |
| sed 's/\.o:/\$$(O)\ :/g' > Make.temp |
205 |
$(CXX) $(DEPFLAGS) -MM $(CXX_SRCS) \ |
206 |
| sed 's/\.o:/\$$(O)\ :/g' >> Make.temp |
207 |
cat Make.temp | sed 's/^[a-zA-Z0-9]/obj\/&/g' >> Make.dep |
208 |
cat Make.temp | sed 's/^[a-zA-Z0-9]/MPIobj\/&/g' >> Make.dep |
209 |
# ../scripts/sfmakedepend -I $(MPI_F90_MODS) -d obj -f ./Make.ftemp -h *.F90 |
210 |
# ../scripts/sfmakedepend -I $(MPI_F90_MODS) -d MPIobj -f ./Make.ftemp -h *.F90 |
211 |
# cat Make.ftemp | sed 's/\.o:/\$$(O)\ :/g' >> Make.dep |
212 |
$(RM) Make.ftemp Make.temp |
213 |
|
214 |
install : dummy |
215 |
|
216 |
links : dummy |
217 |
|
218 |
tests : dummy |
219 |
|
220 |
dummy : |
221 |
|
222 |
include Make.dep |