-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmakefile
93 lines (80 loc) · 2.29 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
#!/usr/bin/make
#main building variables
DSRC = src
DOBJ = static/obj/
DMOD = static/mod/
DEXE = static/
FC = gfortran
OPTSC = -c -frealloc-lhs -O2 -D_R16P_SUPPORTED -J static/mod
OPTSL = -O2 -J static/mod
VPATH = $(DSRC) $(DOBJ) $(DMOD)
MKDIRS = $(DOBJ) $(DMOD) $(DEXE)
#auxiliary variables
COTEXT = "Compiling $(<F)"
LITEXT = "Assembling $@"
#building rules
$(DEXE)vecfor.a: $(MKDIRS) $(DOBJ)vecfor.o
@echo $(LITEXT)
@ar -rcs $@ $(DOBJ)*.o ; ranlib $@
#compiling rules
$(DOBJ)vecfor_r16p.o: src/lib/vecfor_R16P.F90 src/lib/vecfor_RPP.INC \
$(DOBJ)penf.o
@echo $(COTEXT)
@$(FC) $(OPTSC) -Isrc/lib $< -o $@
$(DOBJ)vecfor.o: src/lib/vecfor.F90 \
$(DOBJ)vecfor_rpp.o \
$(DOBJ)vecfor_r4p.o \
$(DOBJ)vecfor_r8p.o \
$(DOBJ)vecfor_r16p.o
@echo $(COTEXT)
@$(FC) $(OPTSC) -Isrc/lib $< -o $@
$(DOBJ)vecfor_rpp.o: src/lib/vecfor_RPP.F90 src/lib/vecfor_RPP.INC \
$(DOBJ)penf.o
@echo $(COTEXT)
@$(FC) $(OPTSC) -Isrc/lib $< -o $@
$(DOBJ)vecfor_r4p.o: src/lib/vecfor_R4P.F90 src/lib/vecfor_RPP.INC \
$(DOBJ)penf.o
@echo $(COTEXT)
@$(FC) $(OPTSC) -Isrc/lib $< -o $@
$(DOBJ)vecfor_r8p.o: src/lib/vecfor_R8P.F90 src/lib/vecfor_RPP.INC \
$(DOBJ)penf.o
@echo $(COTEXT)
@$(FC) $(OPTSC) -Isrc/lib $< -o $@
$(DOBJ)penf_stringify.o: src/third_party/PENF/src/lib/penf_stringify.F90 \
$(DOBJ)penf_b_size.o \
$(DOBJ)penf_global_parameters_variables.o
@echo $(COTEXT)
@$(FC) $(OPTSC) -Isrc/lib $< -o $@
$(DOBJ)penf.o: src/third_party/PENF/src/lib/penf.F90 \
$(DOBJ)penf_global_parameters_variables.o \
$(DOBJ)penf_b_size.o \
$(DOBJ)penf_stringify.o
@echo $(COTEXT)
@$(FC) $(OPTSC) -Isrc/lib $< -o $@
$(DOBJ)penf_b_size.o: src/third_party/PENF/src/lib/penf_b_size.F90 \
$(DOBJ)penf_global_parameters_variables.o
@echo $(COTEXT)
@$(FC) $(OPTSC) -Isrc/lib $< -o $@
$(DOBJ)penf_global_parameters_variables.o: src/third_party/PENF/src/lib/penf_global_parameters_variables.F90
@echo $(COTEXT)
@$(FC) $(OPTSC) -Isrc/lib $< -o $@
#phony auxiliary rules
.PHONY : $(MKDIRS)
$(MKDIRS):
@mkdir -p $@
.PHONY : cleanobj
cleanobj:
@echo deleting objects
@rm -fr $(DOBJ)
.PHONY : cleanmod
cleanmod:
@echo deleting mods
@rm -fr $(DMOD)
.PHONY : cleanexe
cleanexe:
@echo deleting exes
@rm -f $(addprefix $(DEXE),$(EXES))
.PHONY : clean
clean: cleanobj cleanmod
.PHONY : cleanall
cleanall: clean cleanexe