summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: e6f576ca2c35491548b5202f9ba21e65a865b4c1 (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
-include ./Makefile.conf

MKOCTFILE ?= mkoctfile

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)

AR := $(shell $(MKOCTFILE) -p AR)

PKG_CXXFLAGS := -Wall -Wno-deprecated-declarations $(PKG_CXXFLAGS_APPEND)

all: __control_slicot_functions__.oct \
     __control_helper_functions__.oct

# TODO: Private oct-files for control package.

sltmp/%.f: %.fortran
	mkdir -p sltmp
	cp $< $@

FORTRAN_SOURCES = 	\
	sltmp/AB08NX.f	\
	sltmp/AG08BY.f	\
	sltmp/SB01BY.f	\
	sltmp/SB01FY.f	\
	sltmp/SB06ND.f	\
	sltmp/TB01MD.f	\
	sltmp/TB01ND.f	\
	sltmp/TB01ZD.f	\
	sltmp/TG04BX.f	\
	sltmp/ODLTZM.f

ifeq ($(HAVE_DGGES), 1)
FORTRAN_SOURCES += 	\
	sltmp/SB04OD.f	\
	sltmp/SG03AD.f	\
	sltmp/SG03BD.f
endif

# slicot functions
__control_slicot_functions__.oct: __control_slicot_functions__.cc common.cc $(FORTRAN_SOURCES)
	LDFLAGS="$(LDFLAGS)" \
    $(MKOCTFILE) $(PKG_CXXFLAGS) __control_slicot_functions__.cc common.cc $(FORTRAN_SOURCES) -lslicot

# helper functions
__control_helper_functions__.oct: __control_helper_functions__.cc
	$(MKOCTFILE) $(PKG_CXXFLAGS) __control_helper_functions__.cc

clean:
	$(RM) -r *.o core octave-core *.oct *~ *.f slicot sltmp

realclean: clean
	$(RM) -r *.a

## This should also remove any configure cache which clean should not
## remove according to GNU guidelines.
## https://www.gnu.org/prep/standards/html_node/Standard-Targets.html
distclean: clean realclean