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 \ |
|
32 @FFT_DIR@ @LAPACK_DIR@ lapack-xtra linpack minpack \ |
|
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 |
3107
|
40 DISTFILES = Makefile.in ChangeLog Makerules.in $(SOURCES) STOP.patch |
6
|
41 |
2624
|
42 ifeq ($(SHARED_LIBS), true) |
3209
|
43 BINDISTLIBS = libcruft/libcruft |
3029
|
44 BINDISTFILES = libcruft.$(SHLEXT_VER) |
2624
|
45 endif |
|
46 |
4102
|
47 # include BLAS and FFTW just in case some of libcruft depends on them |
|
48 ifeq ($(INCLUDE_LINK_DEPS),true) |
|
49 LINK_DEPS = $(BLAS_LIBS) $(FFTW_LIBS) $(FLIBS) |
|
50 endif |
|
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 \ |
4153
|
63 misc/f77-fcn.o misc/lo-error.o misc/quit.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 |
2811
|
117 install install-strip uninstall clean mostlyclean distclean maintainer-clean:: |
1685
|
118 @$(subdir-for-command) |
1167
|
119 |
|
120 install:: |
3141
|
121 $(top_srcdir)/mkinstalldirs $(octlibdir) |
3034
|
122 if $(STATIC_LIBS); then \ |
3141
|
123 rm -f $(octlibdir)/libcruft.$(LIBEXT) ; \ |
|
124 $(INSTALL_DATA) libcruft.$(LIBEXT) \ |
|
125 $(octlibdir)/libcruft.$(LIBEXT) ; \ |
|
126 $(RANLIB) $(octlibdir)/libcruft.$(LIBEXT) ; \ |
3034
|
127 fi |
1682
|
128 if $(SHARED_LIBS); then \ |
4102
|
129 rm -f $(octlibdir)/libcruft.$(SHLLIB_VER); \ |
2993
|
130 $(INSTALL_PROGRAM) \ |
4102
|
131 libcruft.$(SHLLIB) $(octlibdir)/libcruft.$(SHLLIB_VER); \ |
|
132 rm -f $(octlibdir)/libcruft.$(SHLLIB); \ |
|
133 $(LN_S) libcruft.$(SHLLIB_VER) $(octlibdir)/libcruft.$(SHLLIB); \ |
|
134 if test x$(SHLBIN) != x ; then \ |
4108
|
135 rm -f $(bindir)/libcruft.$(SHLBIN); \ |
4102
|
136 $(INSTALL_PROGRAM) \ |
4108
|
137 libcruft.$(SHLBIN) $(bindir)/libcruft.$(SHLBIN); \ |
4102
|
138 fi; \ |
1682
|
139 fi |
6
|
140 |
2811
|
141 install-strip:: |
|
142 $(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" install |
|
143 |
1167
|
144 uninstall:: |
3141
|
145 rm -f $(octlibdir)/libcruft.$(LIBEXT) |
4102
|
146 rm -f $(octlibdir)/libcruft.$(SHLLIB) |
|
147 rm -f $(octlibdir)/libcruft.$(SHLLIB_VER) |
|
148 if test x$(SHLBIN) != x; then \ |
|
149 rm -f $(bindir)/libcruft.$(SHLBIN); \ |
|
150 rm -f $(bindir)/libcruft.$(SHLBIN_VER); \ |
|
151 fi |
6
|
152 |
1167
|
153 tags TAGS:: $(SOURCES) |
|
154 $(SUBDIR_FOR_COMMAND) |
|
155 |
|
156 tags:: |
6
|
157 ctags $(SOURCES) |
|
158 |
1167
|
159 TAGS:: $(SOURCES) |
6
|
160 etags $(SOURCES) |
|
161 |
1167
|
162 clean mostlyclean:: |
3029
|
163 rm -f *.$(LIBEXT) *.o |
|
164 if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER) *.$(SHLEXT); fi |
6
|
165 |
2047
|
166 distclean:: |
3029
|
167 rm -f *.$(LIBEXT) *.o Makefile Makerules so_locations |
|
168 if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER); fi |
6
|
169 |
2379
|
170 maintainer-clean:: |
3029
|
171 rm -f *.$(LIBEXT) *.o configure Makefile Makerules |
|
172 rm -f so_locations tags TAGS |
|
173 if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER); fi |
6
|
174 |
|
175 dist: |
3700
|
176 for dir in $(DISTSUBDIRS); do mkdir ../`cat ../.fname`/libcruft/$$dir; $(MAKE) -C $$dir $@; done |
6
|
177 ln $(DISTFILES) ../`cat ../.fname`/libcruft |
|
178 .PHONY: dist |
2624
|
179 |
|
180 bin-dist: |
|
181 if [ -n "$(BINDISTFILES)" ]; then \ |
3029
|
182 ln $(BINDISTFILES) ../`cat ../.fname`/libcruft; \ |
2624
|
183 fi |
2686
|
184 if [ -n "$(BINDISTLIBS)" ]; then \ |
3029
|
185 echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES; \ |
2686
|
186 fi |
2624
|
187 .PHONY: bin-dist |
3648
|
188 |
|
189 .NOTPARALLEL: |