-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (49 loc) · 1.13 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
name := Efficiency
FC := gfortran
FFLAGS := -O
BINFOLDER := bin
WORKSPACE := tmp
libsuf := .lib
libfdr := xtt-lib
libsrc := elliptic_tools.f90\
field_tools.f90\
constants.f90
libobj := $(addprefix $(WORKSPACE)/,$(libsrc:.f90=$(libsuf)))
libsrc := $(addprefix $(libfdr)/,$(libsrc))
libfile := $(WORKSPACE)/lib$(name).a
libfile_dep := $(libfile)($(notdir $(libobj)))
suf := .o
fdr := src
src := diagnose-real_data.f90\
diagnose-dry_test.f90\
diagnose-whs.f90
obj := $(addprefix $(WORKSPACE)/,$(src:.f90=$(suf)))
src := $(addprefix $(fdr)/,$(src))
.PHONY : all
all: | mkdir $(libfile_dep) main
.PHONY : mkdir
mkdir:
mkdir $(WORKSPACE)
mkdir $(BINFOLDER)
$(libfile_dep): $(libobj)
ar -crs $@ $^
.PHONY : main
main: $(obj)
for filename in $^; do \
echo $${filename}; \
mv $${filename} $(BINFOLDER)/; \
done
$(WORKSPACE)/%$(libsuf): $(libfdr)/%.f90
$(FC) $(FFLAGES) -c -o $@ $<
$(WORKSPACE)/%$(suf): $(fdr)/%.f90
$(FC) $(FFLAGES) -o $@ $< $(libfile)
.PHONY : clean
clean:
-rm *.mod
-rm -r $(BINFOLDER)
-rm -r $(WORKSPACE)
.PHONY : help
help:
@echo "Help of $(name):"
@echo "make"
@echo "make clean"