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