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 |
2452
|
33 DISTFILES = Makefile.in ChangeLog Makerules.in $(SOURCES) STOP.patch |
6
|
34 |
2624
|
35 ifeq ($(SHARED_LIBS), true) |
|
36 BINDISTFILES = libcruft.$(SHLEXT) |
|
37 BINDISTLIBS = $(addprefix libcruft/, libcruft.$(SHLEXT)) |
|
38 endif |
|
39 |
2490
|
40 all: $(SUBDIRS) stamp-shared |
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 |
2036
|
70 stamp-shared: $(CRUFT_PICOBJ) |
1682
|
71 if $(SHARED_LIBS); then \ |
2484
|
72 $(CC) -shared -o libcruft.$(SHLEXT) $(CRUFT_PICOBJ) \ |
|
73 $(SH_FLIBS) -lm ; \ |
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 |
1391
|
84 install 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 |
1167
|
97 uninstall:: |
6
|
98 rm -f $(libdir)/libcruft.a |
|
99 |
1167
|
100 tags TAGS:: $(SOURCES) |
|
101 $(SUBDIR_FOR_COMMAND) |
|
102 |
|
103 tags:: |
6
|
104 ctags $(SOURCES) |
|
105 |
1167
|
106 TAGS:: $(SOURCES) |
6
|
107 etags $(SOURCES) |
|
108 |
1167
|
109 clean mostlyclean:: |
6
|
110 rm -f *.a *.o |
1717
|
111 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
6
|
112 |
2047
|
113 distclean:: |
2405
|
114 rm -f *.a *.o Makefile Makerules so_locations stamp-shared |
2047
|
115 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
6
|
116 |
2379
|
117 maintainer-clean:: |
2047
|
118 rm -f *.a *.o Makefile Makerules so_locations tags TAGS |
|
119 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
6
|
120 |
|
121 dist: |
|
122 for dir in $(SUBDIRS); do mkdir ../`cat ../.fname`/libcruft/$$dir; cd $$dir; $(MAKE) $@; cd ..; done |
|
123 ln $(DISTFILES) ../`cat ../.fname`/libcruft |
|
124 .PHONY: dist |
2624
|
125 |
|
126 bin-dist: |
|
127 if [ -n "$(BINDISTFILES)" ]; then \ |
|
128 ln $(BINDISTFILES) ../`cat ../.fname`/libcruft ; \ |
|
129 fi |
|
130 echo $(BINDISTLIBS) >> ../`cat ../.fname`/LIBRARIES |
|
131 .PHONY: bin-dist |