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 |
3219
|
27 CRUFT_DIRS = amos blas dassl fftpack lapack linpack minpack misc odepack \ |
|
28 ordered-qz quadpack ranlib slatec-err slatec-fn villad |
6
|
29 |
|
30 SUBDIRS = $(CRUFT_DIRS) |
|
31 |
3107
|
32 DISTFILES = Makefile.in ChangeLog Makerules.in $(SOURCES) STOP.patch |
6
|
33 |
2624
|
34 ifeq ($(SHARED_LIBS), true) |
3209
|
35 BINDISTLIBS = libcruft/libcruft |
3029
|
36 BINDISTFILES = libcruft.$(SHLEXT_VER) |
2624
|
37 endif |
|
38 |
3615
|
39 all: libraries |
6
|
40 .PHONY: all |
|
41 |
1134
|
42 $(SUBDIRS): |
3297
|
43 $(MAKE) -C $@ all |
1134
|
44 .PHONY: $(SUBDIRS) |
6
|
45 |
2490
|
46 # XXX FIXME XXX -- this should build the shared library directly from |
|
47 # a normal archive file (created from PIC code, though). |
|
48 |
2551
|
49 MISC_OBJ := misc/machar.o misc/dostop.o misc/f77-extern.o \ |
|
50 misc/f77-fcn.o misc/lo-error.o |
1914
|
51 |
1682
|
52 CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f)) |
2512
|
53 CRUFT_OBJ2 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC)) |
2425
|
54 CRUFT_OBJ1 := $(patsubst %.f, %.o, $(CRUFT_OBJ2)) |
1914
|
55 CRUFT_OBJ := $(CRUFT_OBJ1) $(MISC_OBJ) |
1682
|
56 |
|
57 ifeq ($(SHARED_LIBS), true) |
|
58 ifdef FPICFLAG |
|
59 CRUFT_OBJ_DIR := $(dir $(CRUFT_OBJ)) |
|
60 CRUFT_OBJ_PICDIR := $(addsuffix pic/, $(CRUFT_OBJ_DIR)) |
|
61 CRUFT_OBJ_NOTDIR := $(notdir $(CRUFT_OBJ)) |
|
62 CRUFT_PICOBJ := $(join $(CRUFT_OBJ_PICDIR), $(CRUFT_OBJ_NOTDIR)) |
|
63 else |
|
64 CRUFT_PICOBJ := $(CRUFT_OBJ) |
|
65 endif |
|
66 endif |
6
|
67 |
3029
|
68 ifeq ($(SHARED_LIBS), true) |
3615
|
69 ifeq ($(STATIC_LIBS), true) |
3647
|
70 LIBRARIES = libcruft.$(LIBEXT) libcruft.$(SHLEXT) |
3615
|
71 else |
3647
|
72 LIBRARIES = libcruft.$(SHLEXT) |
3615
|
73 endif |
3029
|
74 else |
3615
|
75 ifeq ($(STATIC_LIBS), true) |
3647
|
76 LIBRARIES = libcruft.$(LIBEXT) |
3615
|
77 else |
3647
|
78 LIBRARIES = |
3615
|
79 endif |
3029
|
80 endif |
3647
|
81 |
|
82 libraries: $(SUBDIRS) |
|
83 $(MAKE) $(LIBRARIES) |
3615
|
84 .PHONY: libraries |
|
85 |
|
86 libcruft.$(LIBEXT): $(CRUFT_OBJ) |
|
87 rm -f $@ |
|
88 $(AR) $(ARFLAGS) $@ $^ |
|
89 $(RANLIB) $@ |
3029
|
90 |
|
91 libcruft.$(SHLEXT): libcruft.$(SHLEXT_VER) |
3049
|
92 rm -f $@ |
3036
|
93 $(LN_S) $< $@ |
3029
|
94 |
|
95 libcruft.$(SHLEXT_VER): $(CRUFT_PICOBJ) |
3615
|
96 rm -f $@ |
3039
|
97 $(SH_LD) $(SH_LDFLAGS) $(SONAME_FLAGS) -o $@ $^ |
1682
|
98 |
6
|
99 $(CRUFT_OBJ): |
|
100 |
|
101 check: all |
|
102 .PHONY: check |
|
103 |
2811
|
104 install install-strip uninstall clean mostlyclean distclean maintainer-clean:: |
1685
|
105 @$(subdir-for-command) |
1167
|
106 |
|
107 install:: |
3141
|
108 $(top_srcdir)/mkinstalldirs $(octlibdir) |
3034
|
109 if $(STATIC_LIBS); then \ |
3141
|
110 rm -f $(octlibdir)/libcruft.$(LIBEXT) ; \ |
|
111 $(INSTALL_DATA) libcruft.$(LIBEXT) \ |
|
112 $(octlibdir)/libcruft.$(LIBEXT) ; \ |
|
113 $(RANLIB) $(octlibdir)/libcruft.$(LIBEXT) ; \ |
3034
|
114 fi |
1682
|
115 if $(SHARED_LIBS); then \ |
3141
|
116 rm -f $(octlibdir)/libcruft.$(SHLEXT_VER); \ |
2993
|
117 $(INSTALL_PROGRAM) \ |
3141
|
118 libcruft.$(SHLEXT_VER) $(octlibdir)/libcruft.$(SHLEXT_VER); \ |
|
119 cd $(octlibdir); \ |
3029
|
120 rm -f libcruft.$(SHLEXT); \ |
|
121 $(LN_S) libcruft.$(SHLEXT_VER) libcruft.$(SHLEXT); \ |
1682
|
122 fi |
3141
|
123 $(mk-libdir-link) |
6
|
124 |
2811
|
125 install-strip:: |
|
126 $(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" install |
|
127 |
1167
|
128 uninstall:: |
3141
|
129 rm -f $(octlibdir)/libcruft.$(LIBEXT) |
|
130 rm -f $(octlibdir)/libcruft.$(SHLEXT) |
|
131 rm -f $(octlibdir)/libcruft.$(SHLEXT_VER) |
6
|
132 |
1167
|
133 tags TAGS:: $(SOURCES) |
|
134 $(SUBDIR_FOR_COMMAND) |
|
135 |
|
136 tags:: |
6
|
137 ctags $(SOURCES) |
|
138 |
1167
|
139 TAGS:: $(SOURCES) |
6
|
140 etags $(SOURCES) |
|
141 |
1167
|
142 clean mostlyclean:: |
3029
|
143 rm -f *.$(LIBEXT) *.o |
|
144 if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER) *.$(SHLEXT); fi |
6
|
145 |
2047
|
146 distclean:: |
3029
|
147 rm -f *.$(LIBEXT) *.o Makefile Makerules so_locations |
|
148 if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER); fi |
6
|
149 |
2379
|
150 maintainer-clean:: |
3029
|
151 rm -f *.$(LIBEXT) *.o configure Makefile Makerules |
|
152 rm -f so_locations tags TAGS |
|
153 if $(SHARED_LIBS); then rm -f *.$(SHLEXT_VER); fi |
6
|
154 |
|
155 dist: |
3297
|
156 for dir in $(SUBDIRS); do mkdir ../`cat ../.fname`/libcruft/$$dir; $(MAKE) -C $$dir $@; done |
6
|
157 ln $(DISTFILES) ../`cat ../.fname`/libcruft |
|
158 .PHONY: dist |
2624
|
159 |
|
160 bin-dist: |
|
161 if [ -n "$(BINDISTFILES)" ]; then \ |
3029
|
162 ln $(BINDISTFILES) ../`cat ../.fname`/libcruft; \ |
2624
|
163 fi |
2686
|
164 if [ -n "$(BINDISTLIBS)" ]; then \ |
3029
|
165 echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES; \ |
2686
|
166 fi |
2624
|
167 .PHONY: bin-dist |