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 \ |
3989
|
33 misc odepack odessa ordered-qz quadpack ranlib \ |
|
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 |
2624
|
44 ifeq ($(SHARED_LIBS), true) |
3209
|
45 BINDISTLIBS = libcruft/libcruft |
3029
|
46 BINDISTFILES = libcruft.$(SHLEXT_VER) |
2624
|
47 endif |
|
48 |
4102
|
49 # include BLAS and FFTW just in case some of libcruft depends on them |
|
50 ifeq ($(INCLUDE_LINK_DEPS),true) |
|
51 LINK_DEPS = $(BLAS_LIBS) $(FFTW_LIBS) $(FLIBS) |
|
52 endif |
|
53 |
3615
|
54 all: libraries |
6
|
55 .PHONY: all |
|
56 |
1134
|
57 $(SUBDIRS): |
3297
|
58 $(MAKE) -C $@ all |
1134
|
59 .PHONY: $(SUBDIRS) |
6
|
60 |
2490
|
61 # XXX FIXME XXX -- this should build the shared library directly from |
|
62 # a normal archive file (created from PIC code, though). |
|
63 |
3808
|
64 MISC_OBJ := misc/machar.o misc/f77-extern.o \ |
4153
|
65 misc/f77-fcn.o misc/lo-error.o misc/quit.o |
1914
|
66 |
1682
|
67 CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f)) |
2512
|
68 CRUFT_OBJ2 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC)) |
2425
|
69 CRUFT_OBJ1 := $(patsubst %.f, %.o, $(CRUFT_OBJ2)) |
1914
|
70 CRUFT_OBJ := $(CRUFT_OBJ1) $(MISC_OBJ) |
1682
|
71 |
|
72 ifeq ($(SHARED_LIBS), true) |
|
73 ifdef FPICFLAG |
|
74 CRUFT_OBJ_DIR := $(dir $(CRUFT_OBJ)) |
|
75 CRUFT_OBJ_PICDIR := $(addsuffix pic/, $(CRUFT_OBJ_DIR)) |
|
76 CRUFT_OBJ_NOTDIR := $(notdir $(CRUFT_OBJ)) |
|
77 CRUFT_PICOBJ := $(join $(CRUFT_OBJ_PICDIR), $(CRUFT_OBJ_NOTDIR)) |
|
78 else |
|
79 CRUFT_PICOBJ := $(CRUFT_OBJ) |
|
80 endif |
|
81 endif |
6
|
82 |
3029
|
83 ifeq ($(SHARED_LIBS), true) |
3615
|
84 ifeq ($(STATIC_LIBS), true) |
4102
|
85 LIBRARIES = libcruft.$(LIBEXT) libcruft.$(SHLEXT_VER) |
3615
|
86 else |
4102
|
87 LIBRARIES = libcruft.$(SHLEXT_VER) |
3615
|
88 endif |
3029
|
89 else |
3615
|
90 ifeq ($(STATIC_LIBS), true) |
3647
|
91 LIBRARIES = libcruft.$(LIBEXT) |
3615
|
92 else |
3647
|
93 LIBRARIES = |
3615
|
94 endif |
3029
|
95 endif |
3647
|
96 |
|
97 libraries: $(SUBDIRS) |
|
98 $(MAKE) $(LIBRARIES) |
3615
|
99 .PHONY: libraries |
|
100 |
|
101 libcruft.$(LIBEXT): $(CRUFT_OBJ) |
|
102 rm -f $@ |
|
103 $(AR) $(ARFLAGS) $@ $^ |
|
104 $(RANLIB) $@ |
3029
|
105 |
4102
|
106 libcruft.$(SHLEXT_VER): libcruft.$(SHLEXT) |
3049
|
107 rm -f $@ |
3036
|
108 $(LN_S) $< $@ |
3029
|
109 |
4102
|
110 libcruft.$(SHLEXT): $(CRUFT_PICOBJ) |
3615
|
111 rm -f $@ |
4102
|
112 $(SH_LD) $(SH_LDFLAGS) $(SONAME_FLAGS) -o $@ $^ $(LINK_DEPS) |
1682
|
113 |
6
|
114 $(CRUFT_OBJ): |
|
115 |
|
116 check: all |
|
117 .PHONY: check |
|
118 |
4442
|
119 install install-strip uninstall:: |
1685
|
120 @$(subdir-for-command) |
1167
|
121 |
4441
|
122 clean mostlyclean distclean maintainer-clean:: |
|
123 @$(foreach d, $(CLEAN_SUBDIRS), $(do-subdir-for-command)) |
|
124 |
1167
|
125 install:: |
4413
|
126 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(octlibdir) |
3034
|
127 if $(STATIC_LIBS); then \ |
4413
|
128 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(LIBEXT) ; \ |
3141
|
129 $(INSTALL_DATA) libcruft.$(LIBEXT) \ |
4413
|
130 $(DESTDIR)$(octlibdir)/libcruft.$(LIBEXT) ; \ |
|
131 $(RANLIB) $(DESTDIR)$(octlibdir)/libcruft.$(LIBEXT) ; \ |
3034
|
132 fi |
1682
|
133 if $(SHARED_LIBS); then \ |
4413
|
134 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB_VER); \ |
2993
|
135 $(INSTALL_PROGRAM) \ |
4413
|
136 libcruft.$(SHLLIB) $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB_VER); \ |
|
137 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB); \ |
|
138 $(LN_S) libcruft.$(SHLLIB_VER) $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB); \ |
4102
|
139 if test x$(SHLBIN) != x ; then \ |
4413
|
140 rm -f $(DESTDIR)$(bindir)/libcruft.$(SHLBIN); \ |
4102
|
141 $(INSTALL_PROGRAM) \ |
4413
|
142 libcruft.$(SHLBIN) $(DESTDIR)$(bindir)/libcruft.$(SHLBIN); \ |
4102
|
143 fi; \ |
1682
|
144 fi |
6
|
145 |
2811
|
146 install-strip:: |
|
147 $(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" install |
|
148 |
1167
|
149 uninstall:: |
4413
|
150 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(LIBEXT) |
|
151 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB) |
|
152 rm -f $(DESTDIR)$(octlibdir)/libcruft.$(SHLLIB_VER) |
4102
|
153 if test x$(SHLBIN) != x; then \ |
4413
|
154 rm -f $(DESTDIR)$(bindir)/libcruft.$(SHLBIN); \ |
|
155 rm -f $(DESTDIR)$(bindir)/libcruft.$(SHLBIN_VER); \ |
4102
|
156 fi |
6
|
157 |
1167
|
158 tags TAGS:: $(SOURCES) |
|
159 $(SUBDIR_FOR_COMMAND) |
|
160 |
|
161 tags:: |
6
|
162 ctags $(SOURCES) |
|
163 |
1167
|
164 TAGS:: $(SOURCES) |
6
|
165 etags $(SOURCES) |
|
166 |
1167
|
167 clean mostlyclean:: |
3029
|
168 rm -f *.$(LIBEXT) *.o |
|
169 if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER) *.$(SHLEXT); fi |
6
|
170 |
2047
|
171 distclean:: |
3029
|
172 rm -f *.$(LIBEXT) *.o Makefile Makerules so_locations |
4440
|
173 if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER) *.$(SHLEXT); fi |
6
|
174 |
2379
|
175 maintainer-clean:: |
3029
|
176 rm -f *.$(LIBEXT) *.o configure Makefile Makerules |
|
177 rm -f so_locations tags TAGS |
4440
|
178 if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER) *.$(SHLEXT); fi |
6
|
179 |
|
180 dist: |
3700
|
181 for dir in $(DISTSUBDIRS); do mkdir ../`cat ../.fname`/libcruft/$$dir; $(MAKE) -C $$dir $@; done |
6
|
182 ln $(DISTFILES) ../`cat ../.fname`/libcruft |
|
183 .PHONY: dist |
2624
|
184 |
|
185 bin-dist: |
|
186 if [ -n "$(BINDISTFILES)" ]; then \ |
3029
|
187 ln $(BINDISTFILES) ../`cat ../.fname`/libcruft; \ |
2624
|
188 fi |
2686
|
189 if [ -n "$(BINDISTLIBS)" ]; then \ |
3029
|
190 echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES; \ |
2686
|
191 fi |
2624
|
192 .PHONY: bin-dist |
3648
|
193 |
|
194 .NOTPARALLEL: |