3
|
1 # |
|
2 # Makefile for octave's liboctave directory |
|
3 # |
|
4 # John W. Eaton |
1452
|
5 # jwe@bevo.che.wisc.edu |
|
6 # University of Wisconsin-Madison |
3
|
7 # Department of Chemical Engineering |
|
8 |
|
9 TOPDIR = .. |
|
10 |
|
11 srcdir = @srcdir@ |
411
|
12 top_srcdir = @top_srcdir@ |
3
|
13 VPATH = @srcdir@ |
|
14 |
|
15 include $(TOPDIR)/Makeconf |
|
16 |
651
|
17 INSTALL = @INSTALL@ |
|
18 INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
|
19 INSTALL_DATA = @INSTALL_DATA@ |
|
20 |
1904
|
21 LIBOCTAVE_LFLAGS = -L../libcruft -L../readline -L../kpathsea \ |
|
22 -L../glob -L. $(RLD_FLAG) |
|
23 |
|
24 LIBOCTAVE_LIBS = -lcruft -lreadline -lkpathsea -lglob |
|
25 |
1990
|
26 MATRIX_INC := Array.h Array2.h Array3.h DiagArray2.h Array-flags.h \ |
2013
|
27 Array-idx.h Array2-idx.h Array3-idx.h MArray-defs.h \ |
|
28 MArray.h MArray2.h MDiagArray2.h \ |
1990
|
29 Matrix.h base-lu.h mx-base.h mx-defs.h mx-ext.h CColVector.h \ |
|
30 CDiagMatrix.h CMatrix.h CRowVector.h CmplxAEPBAL.h \ |
|
31 CmplxCHOL.h CmplxDET.h CmplxHESS.h CmplxLU.h CmplxQR.h \ |
|
32 CmplxQRP.h CmplxSCHUR.h CmplxSVD.h EIG.h chMatrix.h \ |
535
|
33 dColVector.h dDiagMatrix.h dMatrix.h dRowVector.h dbleAEPBAL.h \ |
|
34 dbleCHOL.h dbleDET.h dbleGEPBAL.h dbleHESS.h dbleLU.h dbleQR.h \ |
|
35 dbleQRP.h dbleSCHUR.h dbleSVD.h |
466
|
36 |
1844
|
37 INCLUDES := Bounds.h CollocWt.h DAE.h DAEFunc.h DASSL.h FEGrid.h FSQP.h \ |
|
38 LinConst.h LP.h LPsolve.h LSODE.h NLConst.h NLEqn.h NLFunc.h \ |
|
39 NLP.h NPSOL.h ODE.h ODEFunc.h Objective.h QP.h QPSOL.h Quad.h \ |
1961
|
40 Range.h base-de.h base-min.h byte-swap.h cmd-hist.h data-conv.h \ |
2316
|
41 dir-ops.h file-ops.h f77-fcn.h getopt.h idx-vector.h lo-error.h \ |
2475
|
42 lo-ieee.h lo-mappers.h lo-utils.h mach-info.h oct-alloc.h \ |
|
43 oct-cmplx.h oct-glob.h oct-math.h oct-term.h pathsearch.h \ |
1968
|
44 prog-args.h statdefs.h str-vec.h sun-utils.h sysdir.h \ |
|
45 $(MATRIX_INC) |
3
|
46 |
1990
|
47 TEMPLATE_SRC := Array.cc Array2.cc Array3.cc DiagArray2.cc \ |
|
48 MArray.cc MArray2.cc MDiagArray2.cc base-lu.cc |
308
|
49 |
2493
|
50 TI_SRC := Array-C.cc Array-b.cc Array-ch.cc Array-i.cc Array-d.cc \ |
|
51 Array-s.cc Array-str.cc \ |
1758
|
52 MArray-C.cc MArray-ch.cc MArray-i.cc MArray-d.cc MArray-s.cc |
759
|
53 |
1904
|
54 MATRIX_SRC := Array-flags.cc CColVector.cc CDiagMatrix.cc CMatrix.cc \ |
1574
|
55 CRowVector.cc CmplxAEPBAL.cc CmplxCHOL.cc CmplxDET.cc \ |
|
56 CmplxHESS.cc CmplxLU.cc CmplxQR.cc CmplxQRP.cc CmplxSCHUR.cc \ |
2386
|
57 CmplxSVD.cc EIG.cc MArray-misc.cc chMatrix.cc dColVector.cc \ |
|
58 dDiagMatrix.cc dMatrix.cc dRowVector.cc dbleAEPBAL.cc \ |
|
59 dbleCHOL.cc dbleDET.cc dbleGEPBAL.cc dbleHESS.cc dbleLU.cc \ |
|
60 dbleQR.cc dbleQRP.cc dbleSCHUR.cc dbleSVD.cc |
466
|
61 |
1844
|
62 SOURCES := Bounds.cc CollocWt.cc DAE.cc DASSL.cc FEGrid.cc FSQP.cc \ |
|
63 LinConst.cc LPsolve.cc LSODE.cc NLEqn.cc NPSOL.cc QPSOL.cc \ |
|
64 Quad.cc Range.cc acosh.c asinh.c atanh.c cmd-hist.cc \ |
1961
|
65 data-conv.cc dir-ops.cc erf.c erfc.c f77-fcn.c file-ops.cc \ |
2316
|
66 filemode.c gamma.c getopt.c getopt1.c idx-vector.cc lgamma.c \ |
|
67 lo-ieee.cc lo-mappers.cc lo-utils.cc mach-info.cc mkdir.c \ |
2475
|
68 oct-alloc.cc oct-glob.cc oct-term.cc pathsearch.cc \ |
|
69 prog-args.cc rename.c rmdir.c str-vec.cc sun-utils.cc \ |
|
70 tempname.c tempnam.c \ |
1533
|
71 $(TEMPLATE_SRC) \ |
|
72 $(TI_SRC) \ |
|
73 $(MATRIX_SRC) |
3
|
74 |
1682
|
75 EXTRAS := mx-inlines.cc |
|
76 |
2452
|
77 DISTFILES := Makefile.in ChangeLog safe-xstat.cin safe-xstat.hin \ |
1773
|
78 $(SOURCES) $(INCLUDES) $(EXTRAS) |
3
|
79 |
1767
|
80 MAKEDEPS_1 := $(patsubst %.cc, %.d, $(SOURCES)) |
|
81 MAKEDEPS := $(patsubst %.c, %.d, $(MAKEDEPS_1)) |
1682
|
82 |
1767
|
83 OBJECTS_1 := $(patsubst %.cc, %.o, $(SOURCES)) |
|
84 OBJECTS := $(patsubst %.c, %.o, $(OBJECTS_1)) |
3
|
85 |
1682
|
86 ifeq ($(SHARED_LIBS), true) |
|
87 ifdef CXXPICFLAG |
|
88 PICOBJ := $(addprefix pic/, $(OBJECTS)) |
|
89 else |
|
90 PICOBJ := $(OBJECTS) |
|
91 endif |
|
92 endif |
3
|
93 |
759
|
94 LIBOCTAVE_DEPEND := $(patsubst %, liboctave.a(%), $(OBJECTS)) |
3
|
95 |
2055
|
96 all: stamp-prereq stamp-picdir liboctave.a stamp-shared |
3
|
97 .PHONY: all |
|
98 |
2055
|
99 stamp-prereq: safe-stat.h safe-lstat.h |
|
100 touch stamp-prereq |
|
101 |
1668
|
102 stamp-picdir: |
2358
|
103 if [ "$(SHARED_LIBS)" = true ]; then \ |
|
104 if [ -n "$(CPICFLAG)" ] || [ -n "$(CXXPICFLAG)" ]; then \ |
|
105 if [ -d pic ]; then \ |
|
106 true ; \ |
|
107 else \ |
|
108 mkdir pic ; \ |
|
109 fi ; \ |
|
110 fi ; \ |
|
111 else \ |
|
112 true ; \ |
|
113 fi |
1668
|
114 touch stamp-picdir |
|
115 |
759
|
116 liboctave.a: $(OBJECTS) |
|
117 $(AR) $(ARFLAGS) liboctave.a $(OBJECTS) |
|
118 $(RANLIB) liboctave.a |
3
|
119 |
1830
|
120 stamp-shared: $(PICOBJ) |
1682
|
121 if $(SHARED_LIBS); then \ |
|
122 $(CXX) -shared -o liboctave.$(SHLEXT) $(PICOBJ) \ |
2358
|
123 $(LIBOCTAVE_LFLAGS) $(LIBOCTAVE_LIBS) ; \ |
|
124 else \ |
|
125 true ; \ |
|
126 fi |
1682
|
127 touch stamp-shared |
|
128 |
1773
|
129 extract_stat = sed 's/@l@//g; s/@L@//g; /@LSTAT_ONLY@/d' |
|
130 extract_lstat = sed 's/@l@/l/g; s/@L@/L/g; s/ *@LSTAT_ONLY@//' |
|
131 |
|
132 safe-lstat.c: safe-xstat.cin |
|
133 @echo "making $@ from $<" |
|
134 @$(extract_lstat) $< > $@.tmp |
|
135 @$(top_srcdir)/move-if-change $@.tmp $@ |
|
136 |
|
137 safe-lstat.h: safe-xstat.hin |
|
138 @echo "making $@ from $<" |
|
139 @$(extract_lstat) $< > $@.tmp |
|
140 @$(top_srcdir)/move-if-change $@.tmp $@ |
|
141 |
|
142 safe-stat.c: safe-xstat.cin |
|
143 @echo "making $@ from $<" |
|
144 @$(extract_stat) $< > $@.tmp |
|
145 @$(top_srcdir)/move-if-change $@.tmp $@ |
|
146 |
|
147 safe-stat.h: safe-xstat.hin |
|
148 @echo "making $@ from $<" |
|
149 @$(extract_stat) $< > $@.tmp |
|
150 @$(top_srcdir)/move-if-change $@.tmp $@ |
|
151 |
|
152 safe-stat.o: safe-stat.h |
|
153 safe-lstat.o: safe-lstat.h safe-stat.h |
|
154 |
3
|
155 check: all |
|
156 .PHONY: check |
|
157 |
2129
|
158 install: install-lib install-inc |
2128
|
159 .PHONY: install |
|
160 |
2129
|
161 install-lib: |
2128
|
162 $(top_srcdir)/mkinstalldirs $(libdir) |
3
|
163 rm -f $(libdir)/liboctave.a |
759
|
164 $(INSTALL_DATA) liboctave.a $(libdir)/liboctave.a |
3
|
165 $(RANLIB) $(libdir)/liboctave.a |
1682
|
166 if $(SHARED_LIBS); then \ |
|
167 rm -f $(libdir)/liboctave.$(SHLEXT); \ |
2301
|
168 $(INSTALL_PROGRAM) liboctave.$(SHLEXT) \ |
|
169 $(libdir)/liboctave.$(SHLEXT); \ |
1682
|
170 fi |
2129
|
171 .PHONY: install-lib |
2128
|
172 |
2129
|
173 install-inc: |
2223
|
174 $(top_srcdir)/mkinstalldirs $(octincludedir) |
308
|
175 for f in $(INCLUDES) $(TEMPLATE_SRC) ; do \ |
2223
|
176 rm -f $(octincludedir)/$$f ; \ |
|
177 $(INSTALL_DATA) $(srcdir)/$$f $(octincludedir)/$$f ; \ |
3
|
178 done |
2223
|
179 linkdir=`echo $(octincludedir) | sed 's/-$(version)$$//'` ; \ |
|
180 if [ "$$linkdir" = $(octincludedir) ] ; then \ |
1980
|
181 true ; \ |
|
182 else \ |
1982
|
183 if [ -d $$linkdir ] ; then \ |
2130
|
184 true ; \ |
1982
|
185 else \ |
|
186 rm -f $$linkdir ; \ |
2223
|
187 $(LN_S) $(octincludedir) $$linkdir ; \ |
1982
|
188 fi ; \ |
|
189 fi |
2129
|
190 .PHONY: install-inc |
3
|
191 |
|
192 uninstall: |
2128
|
193 rm -f $(libdir)/liboctave.a $(libdir)/liboctave.$(SHLEXT) |
2223
|
194 for f in $(INCLUDES) ; do rm -f $(octincludedir)/$$f ; done |
3
|
195 .PHONY: uninstall |
|
196 |
|
197 tags: $(SOURCES) |
|
198 ctags $(SOURCES) |
|
199 |
|
200 TAGS: $(SOURCES) |
|
201 etags $(SOURCES) |
|
202 |
|
203 clean: |
1773
|
204 rm -f safe-stat.h safe-lstat.h *.a *.o *.d pic/*.o |
1717
|
205 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
3
|
206 .PHONY: clean |
|
207 |
|
208 mostlyclean: clean |
|
209 .PHONY: mostlyclean |
|
210 |
|
211 distclean: clean |
2055
|
212 rm -f Makefile so_locations stamp-picdir stamp-shared stamp-prereq |
2053
|
213 -rmdir pic |
3
|
214 .PHONY: distclean |
|
215 |
1391
|
216 maintainer-clean: distclean |
2055
|
217 rm -f tags TAGS stamp-picdir stamp-shared stamp-prereq |
2053
|
218 -rmdir pic |
1391
|
219 .PHONY: maintainer-clean |
3
|
220 |
|
221 local-dist: |
|
222 ln $(DISTFILES) ../`cat ../.fname`/liboctave |
|
223 .PHONY: local-dist |
|
224 |
|
225 dist: |
|
226 ln $(DISTFILES) ../`cat ../.fname`/liboctave |
|
227 .PHONY: dist |
|
228 |
2055
|
229 # If missing, GNU make attempts to create them in the reverse of the |
|
230 # order in which they are listed here. We rely on that fact to ensure |
|
231 # that the safe-stat.h and safe-lstat.h files are created before trying |
|
232 # to create the .d files. Hmm. I wonder if we can count on that... |
|
233 |
1393
|
234 ifndef omit_deps |
2055
|
235 -include $(MAKEDEPS) stamp-prereq |
1319
|
236 endif |