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 |
2482
|
27 CRUFT_DIRS = balgen blas dassl eispack fftpack fsqp lapack linpack \ |
1073
|
28 minpack misc npsol odepack qpsol quadpack ranlib slatec-fn \ |
|
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) |
|
37 BINDISTFILES = libcruft.$(SHLEXT) |
|
38 BINDISTLIBS = $(addprefix libcruft/, libcruft.$(SHLEXT)) |
|
39 endif |
|
40 |
2490
|
41 all: $(SUBDIRS) stamp-shared |
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 |
2036
|
71 stamp-shared: $(CRUFT_PICOBJ) |
1682
|
72 if $(SHARED_LIBS); then \ |
2676
|
73 $(SH_LD) $(SH_LDFLAGS) -o libcruft.$(SHLEXT) $(CRUFT_PICOBJ) ; \ |
2358
|
74 else \ |
|
75 true ; \ |
|
76 fi |
1682
|
77 touch stamp-shared |
|
78 |
6
|
79 $(CRUFT_OBJ): |
|
80 |
|
81 check: all |
|
82 .PHONY: check |
|
83 |
2811
|
84 install install-strip uninstall clean mostlyclean distclean maintainer-clean:: |
1685
|
85 @$(subdir-for-command) |
1167
|
86 |
|
87 install:: |
810
|
88 $(top_srcdir)/mkinstalldirs $(libdir) |
6
|
89 rm -f $(libdir)/libcruft.a |
759
|
90 $(INSTALL_DATA) libcruft.a $(libdir)/libcruft.a |
6
|
91 $(RANLIB) $(libdir)/libcruft.a |
1682
|
92 if $(SHARED_LIBS); then \ |
|
93 rm -f $(libdir)/libcruft.$(SHLEXT); \ |
2487
|
94 $(INSTALL_PROGRAM) libcruft.$(SHLEXT) $(libdir)/libcruft.$(SHLEXT); \ |
1682
|
95 fi |
6
|
96 |
2811
|
97 install-strip:: |
|
98 $(MAKE) INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" install |
|
99 |
1167
|
100 uninstall:: |
6
|
101 rm -f $(libdir)/libcruft.a |
|
102 |
1167
|
103 tags TAGS:: $(SOURCES) |
|
104 $(SUBDIR_FOR_COMMAND) |
|
105 |
|
106 tags:: |
6
|
107 ctags $(SOURCES) |
|
108 |
1167
|
109 TAGS:: $(SOURCES) |
6
|
110 etags $(SOURCES) |
|
111 |
1167
|
112 clean mostlyclean:: |
6
|
113 rm -f *.a *.o |
1717
|
114 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
6
|
115 |
2047
|
116 distclean:: |
2405
|
117 rm -f *.a *.o Makefile Makerules so_locations stamp-shared |
2047
|
118 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
6
|
119 |
2379
|
120 maintainer-clean:: |
2749
|
121 rm -f *.a *.o configure Makefile Makerules so_locations tags TAGS |
2047
|
122 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
6
|
123 |
|
124 dist: |
|
125 for dir in $(SUBDIRS); do mkdir ../`cat ../.fname`/libcruft/$$dir; cd $$dir; $(MAKE) $@; cd ..; done |
|
126 ln $(DISTFILES) ../`cat ../.fname`/libcruft |
|
127 .PHONY: dist |
2624
|
128 |
|
129 bin-dist: |
|
130 if [ -n "$(BINDISTFILES)" ]; then \ |
|
131 ln $(BINDISTFILES) ../`cat ../.fname`/libcruft ; \ |
|
132 fi |
2686
|
133 if [ -n "$(BINDISTLIBS)" ]; then \ |
|
134 echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES ; \ |
|
135 fi |
2624
|
136 .PHONY: bin-dist |