File tree 5 files changed +62
-34
lines changed
5 files changed +62
-34
lines changed Original file line number Diff line number Diff line change 3
3
LIB = dfftpack
4
4
5
5
FC = gfortran
6
- FFLAGS = -O2
6
+ FFLAGS = -O2 -fPIC
7
7
8
8
export LIB
9
9
export FC
10
10
export FFLAGS
11
11
12
- .PHONY : all clean test
12
+ .PHONY : build clean test
13
13
14
- all :
15
- $(MAKE ) -f Makefile --directory=src
16
- $(MAKE ) -f Makefile --directory=test
14
+ build :
15
+ $(MAKE ) -f Makefile $@ --directory=src
17
16
18
- test :
19
- $(MAKE ) -f Makefile --directory=test
17
+ test : build
18
+ $(MAKE ) -f Makefile $@ --directory=test
19
+
20
+ bench : build
21
+ $(MAKE ) -f Makefile $@ --directory=example
20
22
21
23
clean :
22
- $(MAKE ) -f Makefile clean --directory=src
23
- $(MAKE ) -f Makefile clean --directory=test
24
+ $(MAKE ) -f Makefile $@ --directory=src
25
+ $(MAKE ) -f Makefile $@ --directory=test
26
+ $(MAKE ) -f Makefile $@ --directory=example
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ fftpack = { git="https://github.com/fortran-lang/fftpack.git" }
31
31
Alternatively, you can build using provided ` Makefile ` :
32
32
``` bash
33
33
make
34
+ make test
34
35
```
35
36
36
37
## Links
Original file line number Diff line number Diff line change
1
+ SRCF90 = \
2
+ bench1.f90
3
+
4
+ OBJ = $(SRCF90:%.f90=%.o )
5
+
6
+ build : bench1.x
7
+
8
+ bench : build
9
+ ./bench1.x
10
+
11
+ bench1.x : $(OBJ )
12
+ $(FC ) $(FFLAGS ) $(OBJ ) -L../src -l$(LIB ) -I../src -o $@
13
+
14
+ % .o : % .f90
15
+ $(FC ) $(FFLAGS ) -I../src -c $<
16
+
17
+ clean :
18
+ rm -f -r * .o * .x
Original file line number Diff line number Diff line change 1
- SRCF = \
1
+ SRCF90 = \
2
2
zfftb.f90\
3
3
cfftb1.f90\
4
4
zfftf.f90\
@@ -47,9 +47,7 @@ SRCF = \
47
47
dsinqi.f90\
48
48
dsint.f90\
49
49
sint1.f90\
50
- dsinti.f90
51
-
52
- SRCF90 = \
50
+ dsinti.f90\
53
51
fftpack.f90\
54
52
fftpack_fft.f90\
55
53
fftpack_ifft.f90\
@@ -59,16 +57,20 @@ SRCF90 = \
59
57
fftpack_ifftshift.f90\
60
58
fftpack_qct.f90\
61
59
fftpack_iqct.f90\
62
- fftpack_dct.f90\
60
+ fftpack_dct.f90
61
+
62
+ SRCFPP = \
63
63
rk.F90
64
64
65
- OBJF := $(SRCF:.f90=.o )
66
- OBJF90 := $(SRCF90:.f90=.o )
65
+ OBJ = $(SRCF90:.f90=.o )
66
+ OBJ += $(SRCFPP:.F90=.o )
67
+
68
+ build : lib$(LIB ) .a lib$(LIB ) .so
67
69
68
- lib$(LIB ) .a : $(OBJF ) $( OBJF90 )
69
- ar -rcs lib$(LIB ) .a $(OBJF ) $( OBJF90 )
70
+ lib$(LIB ) .a : $(OBJ )
71
+ ar -rcs lib$(LIB ) .a $(OBJ )
70
72
71
- shared : $(OBJ )
73
+ lib $( LIB ) .so : $(OBJ )
72
74
$(FC ) -shared -o lib$(LIB ) .so $(OBJ )
73
75
74
76
clean :
Original file line number Diff line number Diff line change 1
1
FETCH = curl -L
2
2
3
- SRC = \
3
+ SRCF90 = \
4
4
test_fftpack_fft.f90 \
5
5
test_fftpack_rfft.f90 \
6
- test_fftpack_qct.f90 \
7
- test_fftpack_dct.f90 \
8
6
test_fftpack_utils.f90 \
9
- test_fftpack.f90 \
7
+ test_fftpack.f90
8
+
9
+ SRCFPP = \
10
+ test_fftpack_qct.F90 \
11
+ test_fftpack_dct.F90 \
10
12
testdrive.F90
11
-
12
- OBJ = $(SRC:.f90=.o )
13
- OBJ := $(OBJ:.F90=.o )
14
13
15
- all : tstfft \
16
- test_fftpack
14
+ OBJ = $(SRCF90:%.f90=%.o )
15
+ OBJ += $(SRCFPP:%.F90=%.o )
16
+
17
+ build : tstfft.x \
18
+ test_fftpack.x
19
+
20
+ test : build
21
+ ./tstfft.x
22
+ ./test_fftpack.x
17
23
18
24
# Orginal test
19
- tstfft : tstfft.f
20
- $(FC ) $(FFLAGS ) $< -L../src -l$(LIB ) -I../src -o $@ .x
21
- time ./tstfft.x
25
+ tstfft.x : tstfft.f
26
+ $(FC ) $(FFLAGS ) $< -L../src -l$(LIB ) -I../src -o $@
22
27
23
28
# `fftpack` fft routines
24
- test_fftpack : $(OBJ )
25
- $(FC ) $(FFLAGS ) $(OBJ ) -L../src -l$(LIB ) -I../src -o $@ .x
26
- ./test_fftpack.x
29
+ test_fftpack.x : $(OBJ )
30
+ $(FC ) $(FFLAGS ) $(OBJ ) -L../src -l$(LIB ) -I../src -o $@
27
31
28
32
testdrive.F90 :
29
33
$(FETCH ) https://github.com/fortran-lang/test-drive/raw/v0.4.0/src/testdrive.F90 > $@
You can’t perform that action at this time.
0 commit comments