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 |
41
|
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 |
1668
|
33 DISTFILES = Makefile.in Makerules.in $(SOURCES) STOP.patch |
6
|
34 |
1682
|
35 all: $(SUBDIRS) libcruft.a stamp-shared |
6
|
36 .PHONY: all |
|
37 |
1134
|
38 $(SUBDIRS): |
|
39 echo making all in $@ |
|
40 cd $@; $(MAKE) all |
|
41 .PHONY: $(SUBDIRS) |
6
|
42 |
1914
|
43 MISC_OBJ := misc/d1mach.o misc/dostop.o misc/f77-extern.o misc/lo-error.o |
|
44 |
1682
|
45 CRUFT_FSRC := $(foreach dir, $(SUBDIRS), $(wildcard $(srcdir)/$(dir)/*.f)) |
|
46 CRUFT_OBJ3 := $(patsubst $(srcdir)/%, %, $(CRUFT_FSRC)) |
|
47 CRUFT_OBJ2 := $(patsubst %.f, %.o, $(CRUFT_OBJ3)) |
|
48 CRUFT_OBJ1 := $(subst misc/d1mach.o, , $(CRUFT_OBJ2)) |
1914
|
49 CRUFT_OBJ := $(CRUFT_OBJ1) $(MISC_OBJ) |
1682
|
50 |
|
51 ifeq ($(SHARED_LIBS), true) |
|
52 ifdef FPICFLAG |
|
53 CRUFT_OBJ_DIR := $(dir $(CRUFT_OBJ)) |
|
54 CRUFT_OBJ_PICDIR := $(addsuffix pic/, $(CRUFT_OBJ_DIR)) |
|
55 CRUFT_OBJ_NOTDIR := $(notdir $(CRUFT_OBJ)) |
|
56 CRUFT_PICOBJ := $(join $(CRUFT_OBJ_PICDIR), $(CRUFT_OBJ_NOTDIR)) |
|
57 else |
|
58 CRUFT_PICOBJ := $(CRUFT_OBJ) |
|
59 endif |
|
60 endif |
6
|
61 |
759
|
62 libcruft.a: $(CRUFT_OBJ) |
|
63 rm -f libcruft.a |
|
64 $(AR) $(ARFLAGS) libcruft.a $(CRUFT_OBJ) |
|
65 $(RANLIB) libcruft.a |
6
|
66 |
2036
|
67 stamp-shared: $(CRUFT_PICOBJ) |
1682
|
68 if $(SHARED_LIBS); then \ |
2256
|
69 $(CC) -shared -o libcruft.$(SHLEXT) $(CRUFT_PICOBJ) \ |
2257
|
70 $(SH_FLIBS); \ |
1682
|
71 else true; fi |
|
72 touch stamp-shared |
|
73 |
6
|
74 $(CRUFT_OBJ): |
|
75 |
|
76 check: all |
|
77 .PHONY: check |
|
78 |
1391
|
79 install uninstall clean mostlyclean distclean maintainer-clean:: |
1685
|
80 @$(subdir-for-command) |
1167
|
81 |
|
82 install:: |
810
|
83 $(top_srcdir)/mkinstalldirs $(libdir) |
6
|
84 rm -f $(libdir)/libcruft.a |
759
|
85 $(INSTALL_DATA) libcruft.a $(libdir)/libcruft.a |
6
|
86 $(RANLIB) $(libdir)/libcruft.a |
1682
|
87 if $(SHARED_LIBS); then \ |
|
88 rm -f $(libdir)/libcruft.$(SHLEXT); \ |
|
89 $(INSTALL_DATA) libcruft.$(SHLEXT) $(libdir)/libcruft.$(SHLEXT); \ |
|
90 fi |
6
|
91 |
1167
|
92 uninstall:: |
6
|
93 rm -f $(libdir)/libcruft.a |
|
94 |
1167
|
95 tags TAGS:: $(SOURCES) |
|
96 $(SUBDIR_FOR_COMMAND) |
|
97 |
|
98 tags:: |
6
|
99 ctags $(SOURCES) |
|
100 |
1167
|
101 TAGS:: $(SOURCES) |
6
|
102 etags $(SOURCES) |
|
103 |
1167
|
104 clean mostlyclean:: |
6
|
105 rm -f *.a *.o |
1717
|
106 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
6
|
107 |
2047
|
108 distclean:: |
|
109 rm -f *.a *.o Makefile Makerules so_locations |
|
110 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
6
|
111 |
1459
|
112 maintainer-clean:: distclean |
2047
|
113 rm -f *.a *.o Makefile Makerules so_locations tags TAGS |
|
114 if $(SHARED_LIBS); then rm -f *.$(SHLEXT); fi |
6
|
115 |
|
116 local-dist: |
|
117 for dir in $(SUBDIRS); do mkdir ../`cat ../.fname`/libcruft/$$dir; cd $$dir; $(MAKE) $@; cd ..; done |
|
118 ln $(DISTFILES) ../`cat ../.fname`/libcruft |
|
119 .PHONY: local-dist |
|
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 |