forked from dpzwick/ppiclF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
100 lines (86 loc) · 3.46 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
91
92
93
94
95
96
97
98
99
FC = mpif77 # Valid MPI Fortran compiler
CC = mpicc # Valid MPI C compiler
FFLAGS += -cpp -std=legacy
CPFLAGS += -E
#FFLAGS += -DPPICLC
INSTALL_LOCATION = .
####################
# DO NOT TOUCH BELOW
####################
# PPICLF LIBRARY
SOURCE_ROOT_PPICLF=$(INSTALL_LOCATION)/source
PPICLF_IFLAGS+=-I$(SOURCE_ROOT_PPICLF)
# GSLIB LIBRARY
SOURCE_ROOT_GSLIB=$(INSTALL_LOCATION)/3rd_party/gslib
SOURCE_ROOT_GSLIB_OBJ=$(SOURCE_ROOT_GSLIB)/gslib/src
GSLIB_IFLAGS+=-I$(SOURCE_ROOT_GSLIB)/include
SRC = $(SOURCE_ROOT_PPICLF)/ppiclf_user.f \
$(SOURCE_ROOT_PPICLF)/ppiclf_comm.f \
$(SOURCE_ROOT_PPICLF)/ppiclf_op.f \
$(SOURCE_ROOT_PPICLF)/ppiclf_io.f \
$(SOURCE_ROOT_PPICLF)/ppiclf_solve.f \
$(SOURCE_ROOT_PPICLF)/ppiclf_mxm.f
OBJ = $(SOURCE_ROOT_PPICLF)/ppiclf_user.o \
$(SOURCE_ROOT_PPICLF)/ppiclf_comm.o \
$(SOURCE_ROOT_PPICLF)/ppiclf_op.o \
$(SOURCE_ROOT_PPICLF)/ppiclf_io.o \
$(SOURCE_ROOT_PPICLF)/ppiclf_solve.o \
$(SOURCE_ROOT_PPICLF)/ppiclf_mxm.o
PRE = $(SOURCE_ROOT_PPICLF)/PPICLF_SOLN.h \
$(SOURCE_ROOT_PPICLF)/PPICLF_GRID.h \
$(SOURCE_ROOT_PPICLF)/PPICLF_OPT.h \
$(SOURCE_ROOT_PPICLF)/PPICLF_PARALLEL.h \
$(SOURCE_ROOT_PPICLF)/PPICLF_GEOM.h
POS = $(SOURCE_ROOT_PPICLF)/PPICLF
# Make commands
default: makeThird preProcess getObjs libObjs
libObjs: $(SOURCE_ROOT_PPICLF)/ppiclf.o
@ar crv $(SOURCE_ROOT_PPICLF)/libppiclF.a $(SOURCE_ROOT_PPICLF)/ppiclf.o $(SOURCE_ROOT_GSLIB_OBJ)/*.o
@echo " "
@echo "***********************"
@echo "*** LIBRARY SUCCESS ***"
@echo "***********************"
@echo " "
getObjs: $(SOURCE_ROOT_PPICLF)/ppiclf.f
$(FC) $(FFLAGS) -c $(SOURCE_ROOT_PPICLF)/ppiclf.f $(GSLIB_IFLAGS)
mv *.o $(SOURCE_ROOT_PPICLF)
@echo " "
@echo "******************************"
@echo "*** LIBRARY OBJECT SUCCESS ***"
@echo "******************************"
@echo " "
preProcess: $(PRE)
$(CC) $(CPFLAGS) $(PRE) > $(POS)_tmp
grep "^[^#]" $(POS)_tmp > $(POS)
rm $(POS)_tmp
echo '#include "PPICLF_USER.h"' > $(SOURCE_ROOT_PPICLF)/ppiclf.f
echo '#include "PPICLF_STD.h"' >> $(SOURCE_ROOT_PPICLF)/ppiclf.f
cat $(SRC) >> $(SOURCE_ROOT_PPICLF)/ppiclf.f
@echo " "
@echo "********************"
@echo "*** PREPROCESSED ***"
@echo "********************"
@echo " "
makeThird: $(SOURCE_ROOT_GSLIB)/install
cd $(SOURCE_ROOT_GSLIB); \
./install $(CC) $(FC)
@echo " "
@echo "***********************"
@echo "*** INSTALLED GSLIB ***"
@echo "***********************"
@echo " "
clean:
rm -r $(SOURCE_ROOT_PPICLF)/*.o
rm -r $(SOURCE_ROOT_PPICLF)/ppiclf.f
rm -r $(SOURCE_ROOT_PPICLF)/PPICLF
rm -r $(SOURCE_ROOT_PPICLF)/libppiclF.a
rm -r $(SOURCE_ROOT_GSLIB)/gslib
rm -r $(SOURCE_ROOT_GSLIB)/lib
rm -r $(SOURCE_ROOT_GSLIB)/include
rm -r $(SOURCE_ROOT_GSLIB)/*.tar.gz
rm -r $(INSTALL_LOCATION)/short_tests/*.pyc
rm -r $(INSTALL_LOCATION)/short_tests/lib/*.pyc
rm -r $(INSTALL_LOCATION)/short_tests/test1/test1.log*
rm -r $(INSTALL_LOCATION)/short_tests/test1/*.vtu
cd $(INSTALL_LOCATION)/short_tests/test1/; \
make clean