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