1 |
##################################################### |
2 |
# Makefile for SHAPES # |
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 |
# Location of the shapes home |
23 |
SHAPES_HOME=/usr/local/shapes |
24 |
VDW_PARAM_DIR=/usr/local/shapes/share/vdwFiles |
25 |
|
26 |
# C compiler |
27 |
CC=gcc |
28 |
|
29 |
# C++ compiler |
30 |
CXX=g++ |
31 |
|
32 |
# ar |
33 |
AR=ar |
34 |
|
35 |
# ranlib |
36 |
RANLIB=ranlib |
37 |
|
38 |
# rm |
39 |
RM=rm -f |
40 |
|
41 |
# soft link |
42 |
LN_S=ln -s |
43 |
|
44 |
# BSD install |
45 |
INSTALL=@INSTALL@ |
46 |
INSTALL_PROGRAM=@INSTALL_PROGRAM@ |
47 |
INSTALL_DATA=@INSTALL_DATA@ |
48 |
MKINSTALLDIRS=@MKINSTALLDIRS@ |
49 |
|
50 |
# fftw library and include files |
51 |
FFTWINC = -I/usr/local/include |
52 |
FFTWLIB = -L/usr/local/lib/ -lfftw3 |
53 |
|
54 |
# CPP flags |
55 |
CPPFLAGS= |
56 |
|
57 |
# C flags |
58 |
CFLAGS_C= -O3 |
59 |
|
60 |
# C++ flags |
61 |
CXXFLAGS_C= -O3 |
62 |
|
63 |
# LDFLAGS |
64 |
LDFLAGS= |
65 |
|
66 |
# First do compile-time flags: |
67 |
|
68 |
DECLARE=-DVDW_PATH="$(VDW_PARAM_DIR)" |
69 |
|
70 |
# include paths starting with "." are all relative to the SUBDIRS!!! |
71 |
|
72 |
INCLUDES= -I.. $(FFTWINC) |
73 |
|
74 |
CFLAGS=$(CFLAGS_C) $(INCLUDES) $(DECLARE) |
75 |
CXXFLAGS=$(CXXFLAGS_C) $(INCLUDES) $(DECLARE) |
76 |
DEPFLAGS=$(CFLAGS_C) -I. |
77 |
|
78 |
SRC_DIR := .. |
79 |
|
80 |
FORCER=forcer$(EXE) |
81 |
LDADD=-lz |
82 |
|
83 |
# Then do the compile rules: |
84 |
|
85 |
obj/%.o: %.cpp |
86 |
cd obj; $(CXX) $(CXXFLAGS) -c $(SRC_DIR)/$< |
87 |
|
88 |
obj/%.o: %.c |
89 |
cd obj; $(CC) $(CFLAGS) -c $(SRC_DIR)/$< |
90 |
|
91 |
# Then list what we have to compile |
92 |
# |
93 |
C_FILES = \ |
94 |
$(DIR)/forcerCmd.c \ |
95 |
$(DIR)/MatVec3.c \ |
96 |
$(DIR)/cospmls.c \ |
97 |
$(DIR)/makeweights.c \ |
98 |
$(DIR)/naive_synthesis.c \ |
99 |
$(DIR)/pmls.c \ |
100 |
$(DIR)/primitive.c \ |
101 |
$(DIR)/seminaive.c \ |
102 |
$(DIR)/FST_semi_memo.c |
103 |
|
104 |
CXX_FILES = \ |
105 |
$(DIR)/forcer.cpp \ |
106 |
$(DIR)/PDBReader.cpp \ |
107 |
$(DIR)/RigidBody.cpp \ |
108 |
$(DIR)/VDWAtom.cpp \ |
109 |
$(DIR)/GridBuilder.cpp \ |
110 |
$(DIR)/SphereHarm.cpp |
111 |
|
112 |
VDW_FILES= \ |
113 |
amber99.vdw \ |
114 |
charmm27.vdw \ |
115 |
gaff.vdw \ |
116 |
LJ.vdw \ |
117 |
oplsaal.vdw |
118 |
|
119 |
DIR:=. |
120 |
C_SRCS := $(C_FILES) |
121 |
CXX_SRCS := $(CXX_FILES) |
122 |
SRCS := $(C_SRCS) $(CXX_SRCS) |
123 |
|
124 |
DIR:=obj |
125 |
C_OBJS := $(C_FILES:.c=.o) |
126 |
CXX_OBJS := $(CXX_FILES:.cpp=.o) |
127 |
OBJS := $(C_OBJS) $(CXX_OBJS) |
128 |
|
129 |
SUBDIRS = obj |
130 |
|
131 |
# Possible make targets: |
132 |
|
133 |
all: forcer |
134 |
|
135 |
forcer$(EXE) : $(OBJS) |
136 |
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LDADD) $(FFTWLIB) |
137 |
|
138 |
install : $(FORCER) |
139 |
$(MKINSTALLDIRS) $(SHAPES_HOME)/bin |
140 |
$(INSTALL_PROGRAM) -s $(FORCER) $(SHAPES_HOME)/bin/$(FORCER) |
141 |
$(MKINSTALLDIRS) $(VDW_PARAM_DIR) |
142 |
for i in $(VDW_FILES); do \ |
143 |
echo "Installing $$i in $(VDW_PARAM_DIR)\n"; \ |
144 |
$(INSTALL_DATA) $$i $(VDW_PARAM_DIR)/$$i; \ |
145 |
done |
146 |
|
147 |
|
148 |
.PHONY : clean |
149 |
|
150 |
clean : dummy |
151 |
for i in $(SUBDIRS); do \ |
152 |
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
153 |
done |
154 |
$(RM) forcer *.o *.mod *~ Make.temp |
155 |
|
156 |
distclean : dummy |
157 |
for i in $(SUBDIRS); do \ |
158 |
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
159 |
done |
160 |
$(RM) forcer *.o *.mod *~ Make.temp |
161 |
|
162 |
depend : Make.dep |
163 |
|
164 |
Make.dep : |
165 |
echo "Only C dependencies are made automagically!" |
166 |
echo "# DO NOT DELETE THIS LINE - used by make depend" > Make.dep |
167 |
$(CC) $(DEPFLAGS) -MM $(C_SRCS) \ |
168 |
| sed 's/\.o:/\$$(O)\ :/g' > Make.temp |
169 |
$(CXX) $(DEPFLAGS) -MM $(CXX_SRCS) \ |
170 |
| sed 's/\.o:/\$$(O)\ :/g' >> Make.temp |
171 |
cat Make.temp | sed 's/^[a-zA-Z0-9]/obj\/&/g' >> Make.dep |
172 |
$(RM) Make.temp |
173 |
|
174 |
install : dummy |
175 |
|
176 |
links : dummy |
177 |
|
178 |
tests : dummy |
179 |
|
180 |
dummy : |
181 |
|
182 |
include Make.dep |