File tree 6 files changed +63
-47
lines changed
6 files changed +63
-47
lines changed Original file line number Diff line number Diff line change 71
71
if : contains(matrix.os, 'ubuntu') && contains(matrix.gcc_v, '9')
72
72
run : |
73
73
make -f Makefile.manual
74
+ make -f Makefile.manual test
75
+ make -f Makefile.manual clean
Original file line number Diff line number Diff line change 1
1
# Fortran stdlib Makefile
2
2
3
3
FC = gfortran
4
- FCFLAGS=-O0
4
+ FCFLAGS = -Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all
5
5
6
- .PHONY: all clean
6
+ export FC
7
+ export FCFLAGS
7
8
8
- all: stdlib tests
9
+ .PHONY: all clean test
9
10
10
- stdlib:
11
- $(MAKE) -f Makefile.manual FC=${FC} FCFLAGS=${FCFLAGS} --directory=src
11
+ all:
12
+ $(MAKE) -f Makefile.manual --directory=src
13
+ $(MAKE) -f Makefile.manual --directory=src/tests
12
14
13
- tests: stdlib
14
- $(MAKE) -f Makefile.manual FC=${FC} FCFLAGS=${FCFLAGS} --directory=src/tests
15
+ test:
16
+ $(MAKE) -f Makefile.manual --directory=src/tests test
17
+ @echo
18
+ @echo "All tests passed."
15
19
16
20
clean:
17
21
$(MAKE) -f Makefile.manual clean --directory=src
Original file line number Diff line number Diff line change
1
+ LIB = libstdlib.a
2
+
1
3
OBJS = stdlib_experimental_ascii.o \
2
4
stdlib_experimental_error.o \
3
- stdlib_experimental_io.o \
5
+ stdlib_experimental_io.o
4
6
5
7
.PHONY: all clean
6
- .SUFFIXES: .f90 .o
7
-
8
- all: $(OBJS)
9
-
10
- .f90.o:
11
- $(FC) $(FCFLAGS) -c $<
8
+ .SUFFIXES: $(SUFFIXES) .f90 .o
12
9
13
- %.o: %.mod
10
+ all: $(LIB)
14
11
15
- stdlib_experimental_ascii.o: stdlib_experimental_ascii.f90
16
- stdlib_experimental_error.o: stdlib_experimental_error.f90
17
- stdlib_experimental_io.o: stdlib_experimental_io.f90
12
+ $(LIB): $(OBJS)
13
+ ar rcs $@ $(OBJS)
18
14
19
15
clean:
20
- $(RM) *.o *.mod
16
+ $(RM) $(LIB) $(OBJS) *.mod
17
+
18
+ %.o: %.f90
19
+ $(FC) $(FCFLAGS) -c $<
Original file line number Diff line number Diff line change 1
- .PHONY: all clean
1
+ .PHONY: all clean test
2
2
3
- all: ascii/test_ascii loadtxt/test_loadtxt
4
-
5
- ascii/test_ascii:
3
+ all:
6
4
$(MAKE) -f Makefile.manual --directory=ascii
7
-
8
- loadtxt/test_loadtxt:
9
5
$(MAKE) -f Makefile.manual --directory=loadtxt
10
6
7
+ test:
8
+ $(MAKE) -f Makefile.manual --directory=ascii test
9
+ $(MAKE) -f Makefile.manual --directory=loadtxt test
10
+
11
11
clean:
12
12
$(MAKE) -f Makefile.manual --directory=ascii clean
13
13
$(MAKE) -f Makefile.manual --directory=loadtxt clean
Original file line number Diff line number Diff line change
1
+ PROG = test_ascii
2
+ OBJS = test_ascii.o
3
+
1
4
CPPFLAGS = -I../..
2
- OBJS = ../../stdlib_experimental_ascii.o \
3
- ../../stdlib_experimental_error.o
5
+ LDFLAGS = -L../.. -lstdlib
4
6
5
- .PHONY: all clean
6
- .SUFFIXES: .f90 .o
7
+ .PHONY: all clean test
8
+ .SUFFIXES: $(SUFFIXES) .f90 .o
7
9
8
- all: test_ascii
10
+ all: $(PROG)
9
11
10
- test_ascii: test_ascii.f90 $(OBJS)
11
- $(FC) $(FCFLAGS) $(CPPFLAGS) $< -o $@ $(OBJS)
12
+ $(PROG): $(OBJS)
13
+ $(FC) $(FCFLAGS) $(CPPFLAGS) -o $@ $(OBJS) $(LDFLAGS )
12
14
13
- %.o: %.mod
15
+ test:
16
+ ./$(PROG)
14
17
15
18
clean:
16
- $(RM) test_ascii
17
- $(RM) *.o *.mod
19
+ $(RM) $(PROG) $(OBJS) *.mod
20
+
21
+ %.o: %.f90
22
+ $(FC) $(FCFLAGS) $(CPPFLAGS) -c $<
Original file line number Diff line number Diff line change 1
1
CPPFLAGS = -I../..
2
- OBJS = ../../stdlib_experimental_error.o \
3
- ../../stdlib_experimental_io.o
2
+ LDFLAGS = -L../.. -lstdlib
4
3
5
- .PHONY: all clean
6
- .SUFFIXES: .f90 .o
4
+ .PHONY: all clean test
5
+ .SUFFIXES: $(SUFFIXES) .f90 .o
7
6
8
- all: test_loadtxt test_savetxt
7
+ PROGS = test_loadtxt test_savetxt test_loadtxt_qp test_savetxt_qp
8
+ OBJS = $(PROGS:=.o)
9
9
10
- test_loadtxt: test_loadtxt.f90 $(OBJS)
11
- $(FC) $(FCFLAGS) $(CPPFLAGS) $< -o $@ $(OBJS)
12
10
13
- test_savetxt: test_savetxt.f90 $(OBJS)
14
- $(FC) $(FCFLAGS) $(CPPFLAGS) $< -o $@ $(OBJS)
11
+ all: $(PROGS)
15
12
16
- %.o: %.mod
13
+ $(PROGS): %: %.o
14
+ $(FC) $(FCFLAGS) $(CPPFLAGS) -o $@ $^ $(LDFLAGS)
15
+
16
+ test:
17
+ ./test_loadtxt
18
+ ./test_loadtxt_qp
19
+ ./test_savetxt
20
+ ./test_savetxt_qp
17
21
18
22
clean:
19
- $(RM) test_loadtxt test_savetxt
20
- $(RM) *.o *.mod
23
+ $(RM) $(PROGS) $(OBJS) tmp.dat tmp_qp.dat
24
+
25
+ %.o: %.f90
26
+ $(FC) $(FCFLAGS) $(CPPFLAGS) -c $<
You can’t perform that action at this time.
0 commit comments