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 oopse home |
23 |
SHAPES_HOME=/usr/local/shapes |
24 |
VDW_PARAM_DIR=/usr/local/shapes/share/vdwFiles |
25 |
|
26 |
# C compiler |
27 |
CC=icc8 |
28 |
|
29 |
# C++ compiler |
30 |
CXX=icpc8 |
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 |
# CPP flags |
51 |
CPPFLAGS= |
52 |
|
53 |
# C flags |
54 |
CFLAGS_C= |
55 |
|
56 |
# C++ flags |
57 |
CXXFLAGS_C= |
58 |
|
59 |
# LDFLAGS |
60 |
LDFLAGS= |
61 |
|
62 |
# First do compile-time flags: |
63 |
|
64 |
DECLARE=-DVDW_PATH="$(VDW_PARAM_DIR)" |
65 |
|
66 |
# include paths starting with "." are all relative to the SUBDIRS!!! |
67 |
|
68 |
INCLUDES= -I.. |
69 |
|
70 |
CFLAGS=$(CFLAGS_C) $(INCLUDES) $(DECLARE) |
71 |
CXXFLAGS=$(CXXFLAGS_C) $(INCLUDES) $(DECLARE) |
72 |
DEPFLAGS=$(CFLAGS_C) -I. |
73 |
|
74 |
SRC_DIR := .. |
75 |
|
76 |
FORCER=forcer$(EXE) |
77 |
LDADD=-lz |
78 |
|
79 |
# Then do the compile rules: |
80 |
|
81 |
obj/%.o: %.cpp |
82 |
cd obj; $(CXX) $(CXXFLAGS) -c $(SRC_DIR)/$< |
83 |
|
84 |
obj/%.o: %.c |
85 |
cd obj; $(CC) $(CFLAGS) -c $(SRC_DIR)/$< |
86 |
|
87 |
# Then list what we have to compile |
88 |
# |
89 |
C_FILES = \ |
90 |
$(DIR)/forcerCmd.c \ |
91 |
$(DIR)/MatVec3.c |
92 |
|
93 |
CXX_FILES = \ |
94 |
$(DIR)/forcer.cpp \ |
95 |
$(DIR)/PDBReader.cpp \ |
96 |
$(DIR)/RigidBody.cpp \ |
97 |
$(DIR)/VDWAtom.cpp |
98 |
|
99 |
VDW_FILES= \ |
100 |
amber99.vdw \ |
101 |
charmm27.vdw \ |
102 |
gaff.vdw \ |
103 |
LJ.vdw \ |
104 |
oplsaal.vdw |
105 |
|
106 |
DIR:=. |
107 |
C_SRCS := $(C_FILES) |
108 |
CXX_SRCS := $(CXX_FILES) |
109 |
SRCS := $(C_SRCS) $(CXX_SRCS) |
110 |
|
111 |
DIR:=obj |
112 |
C_OBJS := $(C_FILES:.c=.o) |
113 |
CXX_OBJS := $(CXX_FILES:.cpp=.o) |
114 |
OBJS := $(C_OBJS) $(CXX_OBJS) |
115 |
|
116 |
SUBDIRS = obj |
117 |
|
118 |
# Possible make targets: |
119 |
|
120 |
all: forcer |
121 |
|
122 |
forcer$(EXE) : $(OBJS) |
123 |
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LDADD) |
124 |
|
125 |
install : $(FORCER) |
126 |
$(MKINSTALLDIRS) $(SHAPES_HOME)/bin |
127 |
$(INSTALL_PROGRAM) -s $(FORCER) $(SHAPES_HOME)/bin/$(FORCER) |
128 |
$(MKINSTALLDIRS) $(VDW_PARAM_DIR) |
129 |
for i in $(VDW_FILES); do \ |
130 |
echo "Installing $$i in $(VDW_PARAM_DIR)\n"; \ |
131 |
$(INSTALL_DATA) $$i $(VDW_PARAM_DIR)/$$i; \ |
132 |
done |
133 |
|
134 |
|
135 |
.PHONY : clean |
136 |
|
137 |
clean : dummy |
138 |
for i in $(SUBDIRS); do \ |
139 |
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
140 |
done |
141 |
$(RM) forcer *.o *.mod *~ Make.temp |
142 |
|
143 |
distclean : dummy |
144 |
for i in $(SUBDIRS); do \ |
145 |
(cd $$i; $(RM) *.o *.mod) || exit 1; \ |
146 |
done |
147 |
$(RM) forcer *.o *.mod *~ Make.temp |
148 |
|
149 |
depend : Make.dep |
150 |
|
151 |
Make.dep : |
152 |
echo "Only C dependencies are made automagically!" |
153 |
echo "# DO NOT DELETE THIS LINE - used by make depend" > Make.dep |
154 |
$(CC) $(DEPFLAGS) -MM $(C_SRCS) \ |
155 |
| sed 's/\.o:/\$$(O)\ :/g' > Make.temp |
156 |
$(CXX) $(DEPFLAGS) -MM $(CXX_SRCS) \ |
157 |
| sed 's/\.o:/\$$(O)\ :/g' >> Make.temp |
158 |
cat Make.temp | sed 's/^[a-zA-Z0-9]/obj\/&/g' >> Make.dep |
159 |
$(RM) Make.temp |
160 |
|
161 |
install : dummy |
162 |
|
163 |
links : dummy |
164 |
|
165 |
tests : dummy |
166 |
|
167 |
dummy : |
168 |
|
169 |
include Make.dep |