1 |
##################################################### |
2 |
# Makefile for Oopse # |
3 |
##################################################### |
4 |
# You should not change anything here. # |
5 |
##################################################### |
6 |
|
7 |
TOP=.. |
8 |
|
9 |
include $(TOP)/Make.conf |
10 |
|
11 |
.SUFFIXES : .c $(O) |
12 |
|
13 |
# First do compile-time flags: |
14 |
|
15 |
MPI_DECLARES= -DIS_MPI |
16 |
|
17 |
# include paths starting with "." are all relative to the SUBDIRS!!! |
18 |
|
19 |
INCLUDES= -I.. -I../../libBASS -I../../libmdtools |
20 |
MPI_INCLUDES= -I$(MPICH_INC) |
21 |
CXXFLAGS=$(CXXFLAGS_C) $(INCLUDES) $(DECLARES) |
22 |
DEPFLAGS=$(CFLAGS_C) -I. -I$(SPRNG_INC) $(MPI_INCLUDES) -I../libBASS -I../libmdtools |
23 |
MPI_CXXFLAGS=$(CXXFLAGS) $(MPI_INCLUDES) $(MPI_DECLARES) |
24 |
|
25 |
OOPSE=oopse$(EXE) |
26 |
OOPSE_MPI=oopse_MPI$(EXE) |
27 |
|
28 |
BASS_LIB=$(TOP)/libBASS/libBASS.a |
29 |
BASS_MPI_LIB=$(TOP)/libBASS/libBASS_MPI.a |
30 |
MD_LIB=$(TOP)/libmdtools/libmdtools.a |
31 |
MD_MPI_LIB=$(TOP)/libmdtools/libmdtools_MPI.a |
32 |
LIBS=$(BASS_LIB) $(MD_LIB) |
33 |
MPI_LIBS=$(BASS_MPI_LIB) $(MD_MPI_LIB) |
34 |
|
35 |
OOPSE_LDFLAGS=-L$(TOP)/libBASS -L$(TOP)/libmdtools -L$(SPRNG_LIB) |
36 |
OOPSE_LDADD=-lmdtools -lBASS -lsprng $(FLIBS) $(FLIBS_EXTRA) |
37 |
|
38 |
OOPSE_MPI_LDFLAGS=-L$(TOP)/libBASS -L$(TOP)/libmdtools -L$(SPRNG_LIB) -L$(MPICH_LIB) |
39 |
OOPSE_MPI_LDADD=-lmdtools_MPI -lBASS_MPI -lsprng -lpmpich++ -lmpichf90 -lmpich $(FLIBS) $(FLIBS_EXTRA) |
40 |
|
41 |
PREFS=-DOOPSE_HOME=\"$(OOPSE_HOME)\" |
42 |
|
43 |
obj/%.o: %.cpp |
44 |
cd obj; $(CXX) $(CXXFLAGS) -c ../$< |
45 |
|
46 |
MPIobj/%.o: %.cpp |
47 |
cd MPIobj; $(CXX) $(MPI_CXXFLAGS) -c ../$< |
48 |
|
49 |
CXX_FILES = \ |
50 |
$(DIR)/oopse.cpp \ |
51 |
$(DIR)/oose.cpp |
52 |
|
53 |
DIR:=. |
54 |
CXX_SRCS := $(CXX_FILES) |
55 |
|
56 |
DIR:=obj |
57 |
CXX_OBJS := $(CXX_FILES:.cpp=.o) |
58 |
OBJS := $(CXX_OBJS) |
59 |
|
60 |
DIR:=MPIobj |
61 |
CXX_MPIOBJS := $(CXX_FILES:.cpp=.o) |
62 |
MPIOBJS := $(CXX_MPIOBJS) |
63 |
|
64 |
LIBSUBDIRS = \ |
65 |
obj \ |
66 |
MPIobj |
67 |
|
68 |
all : Make.dep $(OOPSE) $(OOPSE_MPI) |
69 |
|
70 |
depend: Make.dep |
71 |
|
72 |
oopse$(EXE) : $(OBJS) $(BASS_LIB) $(MD_LIB) |
73 |
$(FC) $(CFLAGS) $(OBJS) -g -o $@ $(OOPSE_LDFLAGS) $(OOPSE_LDADD) |
74 |
|
75 |
oopse_MPI$(EXE) : $(MPIOBJS) $(BASS_MPI_LIB) $(MD_MPI_LIB) |
76 |
$(FC) $(CFLAGS) $(MPIOBJS) -g -o $@ $(OOPSE_MPI_LDFLAGS) $(OOPSE_MPI_LDADD) |
77 |
|
78 |
install : $(OOPSE) $(OOPSE_MPI) |
79 |
$(MKINSTALLDIRS) $(OOPSE_HOME)/bin |
80 |
$(INSTALL_PROGRAM) -s $(OOPSE) $(OOPSE_HOME)/bin/$(OOPSE) |
81 |
$(INSTALL_PROGRAM) -s $(OOPSE_MPI) $(OOPSE_HOME)/bin/$(OOPSE_MPI) |
82 |
|
83 |
tests : dummy |
84 |
|
85 |
$(OOPSE_HOME)/bin/$(OOPSE) : $(OOPSE) |
86 |
$(MAKE) install |
87 |
|
88 |
$(OOPSE_HOME)/bin/$(OOPSE_MPI) : $(OOPSE_MPI) |
89 |
$(MAKE) install |
90 |
|
91 |
links : $(OOPSE_HOME)/bin/$(OOPSE) $(OOPSE_HOME)/bin/$(OOPSE_MPI) |
92 |
$(MKINSTALLDIRS) $(PREFIX)/bin |
93 |
cd $(PREFIX)/bin; $(RM) $(OOPSE); $(LN_S) $(OOPSE_HOME)/bin/$(OOPSE) $(OOPSE) |
94 |
cd $(PREFIX)/bin; $(RM) $(OOPSE_MPI); $(LN_S) $(OOPSE_HOME)/bin/$(OOPSE_MPI) $(OOPSE_MPI) |
95 |
|
96 |
clean : dummy |
97 |
for i in $(LIBSUBDIRS); do \ |
98 |
(cd $$i; $(RM) *.o) || exit 1; \ |
99 |
done |
100 |
$(RM) $(OOPSE) $(OOPSE_MPI) *.o *~ Make.temp |
101 |
|
102 |
distclean : dummy |
103 |
for i in $(LIBSUBDIRS); do \ |
104 |
(cd $$i; $(RM) *.o) || exit 1; \ |
105 |
done |
106 |
$(RM) $(OOPSE) $(OOPSE_MPI) *.o *~ Make.temp Make.dep |
107 |
|
108 |
devclean : distclean |
109 |
|
110 |
Make.dep : $(CXX_SRCS) |
111 |
echo "# DO NOT DELETE THIS LINE - used by make depend" > Make.dep |
112 |
$(CC) $(DEPFLAGS) -MM $(CXX_SRCS) \ |
113 |
| sed 's/\.o:/\$$(O)\ :/g' > Make.temp |
114 |
cat Make.temp | sed 's/^/obj\//' >> Make.dep |
115 |
cat Make.temp | sed 's/^/MPIobj\//' >> Make.dep |
116 |
$(RM) Make.temp |
117 |
|
118 |
tags : $(CXX_SRCS) |
119 |
ctags $(CXX_SRCS) |
120 |
|
121 |
dummy : |
122 |
|
123 |
# DO NOT DELETE |
124 |
include Make.dep |