-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
73 lines (53 loc) · 1.11 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
#PFUNIT = /opt/pfunit-gfortran-5
export PFUNIT
# The compiler
F90 = gfortran-5
# flags for debugging or for maximum performance, comment as necessary
INC = ../mod
FCFLAGS = -Og -g -I$(INC) -J$(INC)
LDFLAGS = -Og -g
ARCHIVE = libfiat.a
SRC = ./src
TEST = ./tests
EXE = tests.x
INC = ./mod
TESTINC = $(TEST)/mod
# "make" builds all
all: lib
$(ARCHIVE): lib
lib:
make -C $(SRC) lib
cp $(SRC)/$(ARCHIVE) .
tests: $(EXE)
./$(EXE)
SUT: lib
make -C $(TEST) tests
$(EXE): SUT
$(F90) -o $@ -I$(PFUNIT)/mod -I$(PFUNIT)/include -I$(INC) \
-I$(TEST) -I$(TESTINC) \
$(PFUNIT)/include/driver.F90 $(TEST)/*.o $(FCFLAGS) \
-L. -lfiat -L$(PFUNIT)/lib -lpfunit -fprofile-arcs
gcov: tests
make -C $(SRC) gcov
%: $(ODIR)/%.o
$(FC) $(FCFLAGS) -o $@ $^ $(LDFLAGS)
%.o: %.f
$(FC) $(FCFLAGS) -o $@ -c $<
%.o: %.F
$(FC) $(FCFLAGS) -o $@ -c $<
%.o: %.f90
$(FC) $(FCFLAGS) -o $@ -c $<
%.o: %.F90
$(FC) $(FCFLAGS) -o $@ -c $<
%.o: %.f95
$(FC) $(FCFLAGS) -o $@ -c $<
%.o: %.F95
$(FC) $(FCFLAGS) -o $@ -c $<
clean:
make -C $(SRC) clean
make -C $(TEST) clean
rm $(ARCHIVE)
rm *.gcov
init:
mkdir -p $(ODIR)
mkdir -p $(INC)