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