6
|
1 # |
|
2 # Makefile for octave's libcruft directory |
|
3 # |
|
4 # John W. Eaton |
1452
|
5 # jwe@bevo.che.wisc.edu |
|
6 # University of Wisconsin-Madison |
6
|
7 # Department of Chemical Engineering |
|
8 |
|
9 TOPDIR = .. |
|
10 |
|
11 srcdir = @srcdir@ |
411
|
12 top_srcdir = @top_srcdir@ |
6
|
13 VPATH = @srcdir@ |
|
14 |
|
15 include $(TOPDIR)/Makeconf |
|
16 |
651
|
17 INSTALL = @INSTALL@ |
|
18 INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
|
19 INSTALL_DATA = @INSTALL_DATA@ |
|
20 |
6
|
21 # List of the directories that contain Fortran source. Simply copying |
|
22 # a new .f file into one of these directories is sufficient to have it |
|
23 # added to libcruft.a. If you add a new directory here, you also need |
1668
|
24 # generate a new configure script in the top-level directory (edit |
|
25 # configure.in and run autoconf). |
6
|
26 |
3690
|
27 # Some of the directories in libcruft may be only optionally built, |
|
28 # e.g. if they are already present on the system. For these, their |
|
29 # dirname is substituted by configure and may be the empty string. |
|
30 |
3989
|
31 CRUFT_DIRS = amos @BLAS_DIR@ blas-xtra daspk dasrt dassl \ |
4329
|
32 @FFT_DIR@ @LAPACK_DIR@ lapack-xtra minpack \ |
5173
|
33 misc odepack ordered-qz quadpack ranlib \ |
3989
|
34 slatec-err slatec-fn villad |
6
|
35 |
|
36 SUBDIRS = $(CRUFT_DIRS) |
|
37 |
3852
|
38 DISTSUBDIRS = $(sort $(CRUFT_DIRS) blas fftpack lapack) |
3700
|
39 |
4441
|
40 CLEAN_SUBDIRS = $(DISTSUBDIRS) |
|
41 |
3107
|
42 DISTFILES = Makefile.in ChangeLog Makerules.in $(SOURCES) STOP.patch |
6
|
43 |
4102
|
44 # include BLAS and FFTW just in case some of libcruft depends on them |
4760
|
45 LINK_DEPS = $(BLAS_LIBS) $(FFTW_LIBS) $(FLIBS) |
4102
|
46 |
3615
|
47 all: libraries |
6
|
48 .PHONY: all |
|
49 |
1134
|
50 $(SUBDIRS): |
3297
|
51 $(MAKE) -C $@ all |
1134
|
52 .PHONY: $(SUBDIRS) |
6
|
53 |
2490
|
54 # XXX FIXME XXX -- this should build the shared library directly from |
|
55 # a normal archive file (created from PIC code, though). |
|
56 |
3808
|
57 MISC_OBJ := misc/machar.o misc/f77-extern.o \ |
4571
|
58 misc/f77-fcn.o misc/lo-error.o misc/quit.o misc/cquit.o |
1914
|
59 |
1682
|
60 CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f)) |
2512
|
61 CRUFT_OBJ2 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC)) |
2425
|
62 CRUFT_OBJ1 := $(patsubst %.f, %.o, $(CRUFT_OBJ2)) |
1914
|
63 CRUFT_OBJ := $(CRUFT_OBJ1) $(MISC_OBJ) |
1682
|
64 |
|
65 ifeq ($(SHARED_LIBS), true) |
|
66 ifdef FPICFLAG |
|
67 CRUFT_OBJ_DIR := $(dir $(CRUFT_OBJ)) |
|
68 CRUFT_OBJ_PICDIR := $(addsuffix pic/, $(CRUFT_OBJ_DIR)) |
|
69 CRUFT_OBJ_NOTDIR := $(notdir $(CRUFT_OBJ)) |
|
70 CRUFT_PICOBJ := $(join $(CRUFT_OBJ_PICDIR), $(CRUFT_OBJ_NOTDIR)) |
|
71 else |
|
72 CRUFT_PICOBJ := $(CRUFT_OBJ) |
|
73 endif |
|
74 endif |
6
|
75 |
3029
|
76 ifeq ($(SHARED_LIBS), true) |
3615
|
77 ifeq ($(STATIC_LIBS), true) |
4102
|
78 LIBRARIES = libcruft.$(LIBEXT) libcruft.$(SHLEXT_VER) |
3615
|
79 else |
4102
|
80 LIBRARIES = libcruft.$(SHLEXT_VER) |
3615
|
81 endif |
3029
|
82 else |
3615
|
83 ifeq ($(STATIC_LIBS), true) |
3647
|
84 LIBRARIES = libcruft.$(LIBEXT) |
3615
|
85 else |
3647
|
86 LIBRARIES = |
3615
|
87 endif |
3029
|
88 endif |
3647
|
89 |
|
90 libraries: $(SUBDIRS) |
|
91 $(MAKE) $(LIBRARIES) |
3615
|
92 .PHONY: libraries |
|
93 |
|
94 libcruft.$(LIBEXT): $(CRUFT_OBJ) |
|
95 rm -f $@ |
|
96 $(AR) $(ARFLAGS) $@ $^ |
|
97 $(RANLIB) $@ |
3029
|
98 |
4102
|
99 libcruft.$(SHLEXT_VER): libcruft.$(SHLEXT) |
3049
|
100 rm -f $@ |
3036
|
101 $(LN_S) $< $@ |
3029
|
102 |
4102
|
103 libcruft.$(SHLEXT): $(CRUFT_PICOBJ) |
3615
|
104 rm -f $@ |
4102
|
105 $(SH_LD) $(SH_LDFLAGS) $(SONAME_FLAGS) -o $@ $^ $(LINK_DEPS) |
1682
|
106 |
6
|
107 $(CRUFT_OBJ): |
|
108 |
|
109 check: all |
|
110 .PHONY: check |
|
111 |
4442
|
112 install install-strip uninstall:: |
1685
|
113 @$(subdir-for-command) |
1167
|
114 |
4441
|
115 clean mostlyclean distclean maintainer-clean:: |
|
116 @$(foreach d, $(CLEAN_SUBDIRS), $(do-subdir-for-command)) |
|
117 |
1167
|
118 install:: |
4413
|
119 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(octlibdir) |
3034
|
120 if $(STATIC_LIBS); then \ |
4413
|
121 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(LIBEXT) ; \ |
3141
|
122 $(INSTALL_DATA) libcruft.$(LIBEXT) \ |
4413
|
123 $(DESTDIR)$(octlibdir)/libcruft.$(LIBEXT) ; \ |
|
124 $(RANLIB) $(DESTDIR)$(octlibdir)/libcruft.$(LIBEXT) ; \ |
3034
|
125 fi |
1682
|
126 if $(SHARED_LIBS); then \ |
4413
|
127 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB_VER); \ |
4473
|
128 $(INSTALL) \ |
4413
|
129 libcruft.$(SHLLIB) $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB_VER); \ |
|
130 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB); \ |
5451
|
131 (cd $(DESTDIR)$(octlibdir); \ |
|
132 $(LN_S) libcruft.$(SHLLIB_VER) $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB)); \ |
4102
|
133 if test x$(SHLBIN) != x ; then \ |
4413
|
134 rm -f $(DESTDIR)$(bindir)/libcruft.$(SHLBIN); \ |
4473
|
135 $(INSTALL_PROGRAM) \ |
4413
|
136 libcruft.$(SHLBIN) $(DESTDIR)$(bindir)/libcruft.$(SHLBIN); \ |
4102
|
137 fi; \ |
1682
|
138 fi |
6
|
139 |
2811
|
140 install-strip:: |
|
141 $(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" install |
|
142 |
1167
|
143 uninstall:: |
4413
|
144 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(LIBEXT) |
|
145 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB) |
|
146 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB_VER) |
4102
|
147 if test x$(SHLBIN) != x; then \ |
4413
|
148 rm -f $(DESTDIR)$(bindir)/libcruft.$(SHLBIN); \ |
|
149 rm -f $(DESTDIR)$(bindir)/libcruft.$(SHLBIN_VER); \ |
4102
|
150 fi |
6
|
151 |
1167
|
152 tags TAGS:: $(SOURCES) |
|
153 $(SUBDIR_FOR_COMMAND) |
|
154 |
|
155 tags:: |
6
|
156 ctags $(SOURCES) |
|
157 |
1167
|
158 TAGS:: $(SOURCES) |
6
|
159 etags $(SOURCES) |
|
160 |
5276
|
161 clean mostlyclean distclean:: |
|
162 rm -f libcruft.$(LIBEXT) $(CRUFT_OBJ) |
|
163 rm -f libcruft.$(SHLEXT_VER) libcruft.$(SHLEXT) |
6
|
164 |
5276
|
165 distclean maintainer-clean:: |
|
166 rm -f Makefile Makerules so_locations |
6
|
167 |
2379
|
168 maintainer-clean:: |
5276
|
169 rm -f tags TAGS |
6
|
170 |
|
171 dist: |
3700
|
172 for dir in $(DISTSUBDIRS); do mkdir ../`cat ../.fname`/libcruft/$$dir; $(MAKE) -C $$dir $@; done |
6
|
173 ln $(DISTFILES) ../`cat ../.fname`/libcruft |
|
174 .PHONY: dist |
2624
|
175 |
3648
|
176 .NOTPARALLEL: |