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