-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (29 loc) · 796 Bytes
/
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
all: libdmda_repart.a
PETSC_DIR = ~/opt/petsc
LIBSRC = dmda_repart.c dmda_repart_weights.c
LIBOBJ = $(LIBSRC:.c=.o)
EXSRC = examples/ex1.c examples/ex2.c examples/ex3.c
EXBIN = $(EXSRC:.c=)
SRC = $(LIBSRC) $(EXSRC)
OBJ = $(SRC:.c=.o)
CLEANFILES = $(OBJ) libdmda_repart.a $(EXBIN)
CFLAGS=-I.
include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules
libdmda_repart.a: $(LIBOBJ)
$(AR) rc $@ $?
$(RANLIB) $@
$(EXBIN): %: %.o dmda_repart.h libdmda_repart.a
$(CLINKER) -o $@ $< $(PETSC_LIB) -L. -ldmda_repart
ex1: examples/ex1
ex2: examples/ex2
ex3: examples/ex3
NP?=4
MPI?=mpich
run1: ex1
mpiexec.${MPI} -n ${NP} ./examples/ex1
run2: ex2
mpiexec.${MPI} -n ${NP} ./examples/ex2
run3: ex3
mpiexec.${MPI} -n ${NP} ./examples/ex3
.PHONY: run1 run2 run3