forked from ESMCI/mpi-serial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
93 lines (62 loc) · 1.52 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
SHELL = /bin/sh
###############################
include Makefile.conf
VPATH=$(SRCDIR)/mpi-serial
# SOURCE FILES
MODULE = mpi-serial
SRCS_F90 = fort.F90 \
mpif.F90
SRCS_C = mpi.c \
send.c \
recv.c \
collective.c \
req.c \
list.c \
handles.c \
comm.c \
error.c \
ic_merge.c \
group.c \
time.c \
pack.c \
type.c \
type_const.c \
copy.c \
op.c \
cart.c \
getcount.c \
probe.c \
info.c
OBJS_ALL = $(SRCS_C:.c=.o) \
$(SRCS_F90:.F90=.o)
INCPATH:= -I .
###############################
# TARGETS
default: lib$(MODULE).a
fort.o: mpif.h
lib$(MODULE).a: $(OBJS_ALL)
echo $(OBJS_ALL)
$(RM) $@
$(AR) $@ $(OBJS_ALL)
$(RANLIB) $@
LIB = lib$(MODULE).a
###############################
#RULES
.SUFFIXES:
.SUFFIXES: .F90 .c .o
.c.o:
$(CC) -c $(INCPATH) $(DEFS) $(CPPDEFS) $(CFLAGS) $<
.F90.o:
$(FC) -c $(INCFLAG) . $(INCPATH) $(DEFS) $(FPPDEFS) $(FCFLAGS) $(MPEUFLAGS) $<
MYF90FLAGS=$(INCPATH) $(DEFS) $(FCFLAGS) $(MPEUFLAGS)
.PHONY: clean tests install
clean:
/bin/rm -f *.o ctest ftest $(LIB) mpi.mod config.log config.status
cd tests ; $(MAKE) clean
tests:
cd tests; make
install: lib
$(MKINSTALLDIRS) $(libdir) $(includedir)
$(INSTALL) lib$(MODULE).a -m 644 $(libdir)
$(INSTALL) mpi.h -m 644 $(includedir)
$(INSTALL) mpif.h -m 644 $(includedir)