blob: 21301748f7b88776f1a6ce7ffef76bdae4cdad8a (
plain)
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
|
SHELL = @SHELL@
ver = @ver@
# Most octave programs will be compiled with $(MKOCTFILE). Those which
# cannot use mkoctfile directly can request the flags that mkoctfile
# would use as follows:
# FLAG = $(shell $(MKOCTFILE) -p FLAG)
# The following flags are for compiling programs that are independent
# of Octave. How confusing.
FFLAGS = $(CPPFLAGS) @FFLAGS@
OCTAVE = @OCTAVE@
OCTAVE_VERSION = @OCTAVE_VERSION@
MKOCTFILE = @MKOCTFILE@ -DHAVE_OCTAVE_$(ver) -v
MKOCTFILE_FORTRAN_90=@MKOCTFILE_FORTRAN_90@
OPTIMINTERP_LIBS=@OPTIMINTERP_LIBS@
OPTIMINTERP_CFLAGS=@OPTIMINTERP_CFLAGS@
%.o: %.c ; $(MKOCTFILE) -c $<
%.o: %.f ; $(MKOCTFILE) -c $<
%.o: %.cc ; $(MKOCTFILE) -c $<
%.oct: %.cc ; $(MKOCTFILE) $<
SOURCES=optiminterp.cc optimal_interpolation.F90 optiminterp_wrapper.F90
OBJECTS=optiminterp.o optimal_interpolation.o optiminterp_wrapper.o
TARGETS=optiminterp.oct
ifndef LAPACK_LIBS
LAPACK_LIBS := $(shell $(MKOCTFILE) -p LAPACK_LIBS)
endif
ifndef BLAS_LIBS
BLAS_LIBS := $(shell $(MKOCTFILE) -p BLAS_LIBS)
endif
ifndef FLIBS
FLIBS := $(shell $(MKOCTFILE) -p FLIBS)
endif
LDFLAGS := $(shell $(MKOCTFILE) -p LDFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
# Rule for compiling Fortran 90 programs
%.o: %.F90
FFLAGS="$(FFLAGS)" $(MKOCTFILE) -c $<
ifeq ($(MKOCTFILE_FORTRAN_90),yes)
all: $(TARGETS)
else
all:
@echo "*** mkoctfile lacks Fortran 90 support"; false
endif
optiminterp.oct: $(OBJECTS)
LDFLAGS="$(LDFLAGS)" \
$(MKOCTFILE) -o $@ $(OBJECTS) $(LIBS) $(LAPACK_LIBS) $(FLIBS)
# make sure to compile optimal_interpolation.o first
optiminterp_wrapper.o: optiminterp_wrapper.F90 optimal_interpolation.o
clean:
rm -f *.o *.oct *~ *.mod
distclean: clean
-rm Makeconf Makefile config.status config.log
.NOTPARALLEL:
|