ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/Makefile
Revision: 1281
Committed: Mon Jun 21 13:38:55 2004 UTC (20 years ago) by chrisfen
File size: 3214 byte(s)
Log Message:
Now calculates energies and builds the grid files.  There are still bugs, but
it compiles and runs...

File Contents

# Content
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=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 # 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 $(DIR)/GridBuilder.cpp
99
100 VDW_FILES= \
101 amber99.vdw \
102 charmm27.vdw \
103 gaff.vdw \
104 LJ.vdw \
105 oplsaal.vdw
106
107 DIR:=.
108 C_SRCS := $(C_FILES)
109 CXX_SRCS := $(CXX_FILES)
110 SRCS := $(C_SRCS) $(CXX_SRCS)
111
112 DIR:=obj
113 C_OBJS := $(C_FILES:.c=.o)
114 CXX_OBJS := $(CXX_FILES:.cpp=.o)
115 OBJS := $(C_OBJS) $(CXX_OBJS)
116
117 SUBDIRS = obj
118
119 # Possible make targets:
120
121 all: forcer
122
123 forcer$(EXE) : $(OBJS)
124 $(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LDADD)
125
126 install : $(FORCER)
127 $(MKINSTALLDIRS) $(SHAPES_HOME)/bin
128 $(INSTALL_PROGRAM) -s $(FORCER) $(SHAPES_HOME)/bin/$(FORCER)
129 $(MKINSTALLDIRS) $(VDW_PARAM_DIR)
130 for i in $(VDW_FILES); do \
131 echo "Installing $$i in $(VDW_PARAM_DIR)\n"; \
132 $(INSTALL_DATA) $$i $(VDW_PARAM_DIR)/$$i; \
133 done
134
135
136 .PHONY : clean
137
138 clean : dummy
139 for i in $(SUBDIRS); do \
140 (cd $$i; $(RM) *.o *.mod) || exit 1; \
141 done
142 $(RM) forcer *.o *.mod *~ Make.temp
143
144 distclean : dummy
145 for i in $(SUBDIRS); do \
146 (cd $$i; $(RM) *.o *.mod) || exit 1; \
147 done
148 $(RM) forcer *.o *.mod *~ Make.temp
149
150 depend : Make.dep
151
152 Make.dep :
153 echo "Only C dependencies are made automagically!"
154 echo "# DO NOT DELETE THIS LINE - used by make depend" > Make.dep
155 $(CC) $(DEPFLAGS) -MM $(C_SRCS) \
156 | sed 's/\.o:/\$$(O)\ :/g' > Make.temp
157 $(CXX) $(DEPFLAGS) -MM $(CXX_SRCS) \
158 | sed 's/\.o:/\$$(O)\ :/g' >> Make.temp
159 cat Make.temp | sed 's/^[a-zA-Z0-9]/obj\/&/g' >> Make.dep
160 $(RM) Make.temp
161
162 install : dummy
163
164 links : dummy
165
166 tests : dummy
167
168 dummy :
169
170 include Make.dep