-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
145 lines (129 loc) · 3.07 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/sh
# $URL: svn+ssh://[email protected]/mnt/shared/repositorio/mefpar/branches/geoacustica/mef/Makefile $
# $Id: Makefile 2 2009-04-03 17:46:50Z helano $
#make
#------------------Variaveis Globais-----------------------
PATH_MOD="src/"
PATH_INCLUDE="include"
PRENAME=mvf
FC=gfortran
OPENMP=yes
DEBUG=no
#------------------gerando o nome do excutavel-------------
ifeq ($(FC),ifort)
COMPILER_NAME=intel
endif
ifeq ($(FC),gfortran)
COMPILER_NAME=gnu
endif
NAME+=$(PRENAME)_$(COMPILER_NAME)
#-------------------Fontes---------------------------------
src_mef = src/Adjacency.f\
src/Assbly.f\
src/BenchMark.f\
src/Celllib.f\
src/cellibAdvec.f\
src/CellibDif.f\
src/CellibPressure.f\
src/CellibSimple.f\
src/CellibTrans.f\
src/Correct.f\
src/Csr.f\
src/CsrToCoo.f\
src/Datastruct.f\
src/ExportCoo.f\
src/EllPack.f\
src/Filenames.f\
src/Graph.f\
src/IdealGas.f\
src/Iterativos.f\
src/Iterativos_omp.f\
src/Main.f\
src/Matvec.f\
src/Matrix_partition.f\
src/Matvec_omp.f\
src/Numeq.f\
src/Pdata.f\
src/Pform.f\
src/Reord.f\
src/Rdata_mvf.f\
src/Shape_matrix.f\
src/Simple.f\
src/Solver.f\
src/Time.f\
src/Transporte.f\
src/Viz.f\
src/Vtk.f\
src/Write_vtk.f
mod_mef=src/Malloc.f
#-------------------Flags necessarios--------------------------------
NFLAGS=-I$(PATH_INCLUDE)
LDFLAGS=
#--------------------compiladores------------------------------------
# intel ifort
ifeq ($(FC),ifort)
LDFLAGS +=
OFLAGS += -module $(PATH_MOD) -W1
ifeq ($(OPENMP),yes)
OFLAGS += -openmp
endif
endif
# gnu gcc
ifeq ($(FC),gfortran)
LDFLAGS +=
OFLAGS += -J$(PATH_MOD) -Wall
ifeq ($(OPENMP),yes)
OFLAGS += -fopenmp
endif
endif
#--------------------------------------------------------------------
#---------------------------Debug------------------------------------
ifeq ($(DEBUG),yes)
OFLAGS += -g
else
OFLAGS += -O3
endif
#--------------------------------------------------------------------
FFLAGS= $(NFLAGS) $(OFLAGS)
.SUFFIXES:
.SUFFIXES: .for .f .h .fi .o
mod_src = $(mod_mef:%.f=%.o)
objs_src= $(mod_src) $(src_mef:%.f=%.o)
build: $(objs_src) $(mod_src)
mkdir -p bin
$(FC) $(FFLAGS) $(objs_src) -o bin/$(NAME) $(LDFLAGS)
tags:
ctags -R src/*.f include/*.fi
.PHONY: cleantags
cleantags:
@rm -fv tags
.PHONY: clean
clean:
@rm -fv src/*.o
@rm -fv src/*.mod
@rm -fv bin/$(NAME)
.PHONY: cleanall
cleanall:
@rm -fv tags
@rm -fv src/*.o
@rm -fv src/*.o
@rm -fv src/*.mod
@rm -fv src/*.f90
@rm -fv bin/$(NAME)
.PHONY: cleanmod
cleanmod:
@rm -fv ../src/*.mod
.PHONY: help
help:
@echo "Autor :$(AUTHOR) "
@echo "Makefile para prepar para sitemas linux. "
@echo -e "\E[7;32mOpcoes:\E[1;0m "
@echo "build - compila o prepar "
@echo "build_modules - gera os modulos "
@echo "tags - gera os tags "
@echo "cleantags - limpa os tags "
@echo "clean - limpa os obj, bin e mod "
@echo "cleaall - limpa tudo obj,bin,mod e tags "
@echo "cleanmod - limpa os modulos "
# DO NOT DELETE
# DO NOT DELETE