860
|
1 # @configure_input@ |
6
|
2 # |
|
3 # Common rules for octave's libcruft directories. |
|
4 # |
5775
|
5 # FIXME -- assumes that the libcruft directory tree is only |
2489
|
6 # one level deep. |
|
7 # |
7017
|
8 # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2003, 2005, |
|
9 # 2006, 2007 John W. Eaton |
|
10 # |
7016
|
11 # This file is part of Octave. |
|
12 # |
|
13 # Octave is free software; you can redistribute it and/or modify it |
|
14 # under the terms of the GNU General Public License as published by the |
|
15 # Free Software Foundation; either version 3 of the License, or (at |
|
16 # your option) any later version. |
|
17 # |
|
18 # Octave is distributed in the hope that it will be useful, but WITHOUT |
|
19 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
20 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
21 # for more details. |
|
22 # |
|
23 # You should have received a copy of the GNU General Public License |
|
24 # along with Octave; see the file COPYING. If not, see |
|
25 # <http://www.gnu.org/licenses/>. |
|
26 |
6
|
27 |
6137
|
28 DLL_CDEFS = @CRUFT_DLL_DEFS@ |
|
29 DLL_CXXDEFS = @CRUFT_DLL_DEFS@ |
6087
|
30 |
6281
|
31 CRUFT_FSRC = $(addprefix $(srcdir)/, $(FSRC)) |
|
32 CRUFT_CSRC = $(addprefix $(srcdir)/, $(CSRC)) |
|
33 CRUFT_CXXSRC = $(addprefix $(srcdir)/, $(CXXSRC)) |
6
|
34 |
6102
|
35 CRUFT_SRC = $(CRUFT_FSRC) $(CRUFT_CSRC) $(CRUFT_CXXSRC) |
6488
|
36 |
|
37 CRUFT_FBASE = $(basename $(notdir $(CRUFT_FSRC))) |
|
38 CRUFT_CBASE = $(basename $(notdir $(CRUFT_CSRC))) |
|
39 CRUFT_CXXBASE = $(basename $(notdir $(CRUFT_CXXSRC))) |
|
40 |
|
41 CRUFT_BASE = $(CRUFT_FBASE) $(CRUFT_CBASE) $(CRUFT_CXXBASE) |
|
42 |
|
43 CRUFT_FOBJ = $(addsuffix .o, $(CRUFT_FBASE) ) |
|
44 CRUFT_COBJ = $(addsuffix .o, $(CRUFT_CBASE) ) |
|
45 CRUFT_CXXOBJ = $(addsuffix .o, $(CRUFT_CXXBASE) ) |
|
46 |
|
47 CRUFT_OBJ = $(CRUFT_FOBJ) $(CRUFT_COBJ) $(CRUFT_CXXOBJ) |
|
48 |
|
49 CRUFT_FDEFS = $(patsubst %.f, %.def, $(notdir $(CRUFT_FSRC))) |
|
50 CRUFT_CDEFS = $(patsubst %.c, %.def, $(notdir $(CRUFT_CSRC))) |
|
51 CRUFT_CXXDEFS = $(patsubst %.cc, %.def, $(notdir $(CRUFT_CXXSRC))) |
|
52 |
|
53 CRUFT_DEFS = $(CRUFT_FDEFS) $(CRUFT_CDEFS) $(CRUFT_CXXDEFS) |
6
|
54 |
6797
|
55 DISTFILES = $(CRUFT_SRC) $(addprefix $(srcdir)/, Makefile.in $(SPECIAL)) |
6281
|
56 |
2036
|
57 ifeq ($(SHARED_LIBS), true) |
|
58 ifdef FPICFLAG |
6488
|
59 CRUFT_FPICOBJ := $(addprefix pic/, $(CRUFT_FOBJ)) |
|
60 else |
|
61 CRUFT_FPICOBJ := $(CRUFT_FOBJ) |
|
62 endif |
|
63 ifdef CPICFLAG |
|
64 CRUFT_CPICOBJ := $(addprefix pic/, $(CRUFT_COBJ)) |
3325
|
65 else |
6488
|
66 CRUFT_CPICOBJ := $(CRUFT_COBJ) |
2036
|
67 endif |
6488
|
68 ifdef CXXPICFLAG |
|
69 CRUFT_CXXPICOBJ := $(addprefix pic/, $(CRUFT_CXXOBJ)) |
|
70 else |
|
71 CRUFT_CXXPICOBJ := $(CRUFT_CXXOBJ) |
|
72 endif |
|
73 CRUFT_PICOBJ := $(CRUFT_FPICOBJ) $(CRUFT_CPICOBJ) $(CRUFT_CXXPICOBJ) |
2036
|
74 endif |
|
75 |
6
|
76 CWD = $(shell pwd) |
|
77 THISDIR = $(notdir $(CWD)) |
|
78 |
3238
|
79 ifeq ($(STATIC_LIBS), true) |
6488
|
80 LIBCRUFT_DEPEND := $(CRUFT_OBJ) |
|
81 .PRECIOUS: $(CRUFT_OBJ) |
3238
|
82 endif |
|
83 |
6488
|
84 ifeq ($(SHARED_LIBS), true) |
|
85 LIBCRUFT_PICDEPEND := $(CRUFT_PICOBJ) |
|
86 .PRECIOUS: $(CRUFT_PICOBJ) |
|
87 endif |
|
88 |
|
89 all: pic $(CRUFT_DEFS) $(LIBCRUFT_DEPEND) $(LIBCRUFT_PICDEPEND) |
3615
|
90 @echo "warning: run make in parent directory to update libraries" |
6
|
91 .PHONY: all |
|
92 |
3615
|
93 stmp-pic: pic |
|
94 @if [ -f stmp-pic ]; then \ |
|
95 true; \ |
|
96 else \ |
|
97 echo "touch stmp-pic"; \ |
|
98 touch stmp-pic; \ |
|
99 fi |
|
100 |
3029
|
101 pic: |
|
102 @if [ -d pic ]; then \ |
|
103 true; \ |
2358
|
104 else \ |
3029
|
105 echo "mkdir pic"; \ |
|
106 mkdir pic; \ |
2358
|
107 fi |
1668
|
108 |
3615
|
109 $(CRUFT_PICOBJ): stmp-pic |
|
110 |
6102
|
111 $(CRUFT_DEFS): $(TOPDIR)/libcruft/mkf77def |
|
112 |
|
113 %.def : %.f |
|
114 @echo "making $@ from $<" |
6152
|
115 @$(TOPDIR)/libcruft/mkf77def < $< > $@-t |
|
116 @$(simple-move-if-change-rule) |
6102
|
117 |
2545
|
118 install:: all |
6
|
119 .PHONY: install |
|
120 |
5223
|
121 install-strip:: all |
|
122 .PHONY: install-strip |
|
123 |
2545
|
124 uninstall:: |
6
|
125 .PHONY: uninstall |
|
126 |
|
127 tags: $(SOURCES) |
|
128 ctags $(SOURCES) |
|
129 |
|
130 TAGS: $(SOURCES) |
|
131 etags $(SOURCES) |
|
132 |
5276
|
133 clean mostlyclean distclean maintainer-clean:: |
6102
|
134 rm -f $(MAKEDEPS) $(CRUFT_OBJ) $(CRUFT_PICOBJ) $(CRUFT_DEFS) |
3615
|
135 -rmdir pic |
|
136 rm -f stmp-pic |
5276
|
137 .PHONY: clean mostlyclean |
6
|
138 |
5276
|
139 distclean maintainer-clean:: |
3029
|
140 rm -f Makefile |
1459
|
141 .PHONY: distclean |
|
142 |
4440
|
143 maintainer-clean:: |
3265
|
144 rm -f tags TAGS |
1393
|
145 .PHONY: maintainer-clean |
6
|
146 |
|
147 dist: |
6467
|
148 ln $(EXTERNAL_DISTFILES) ../../`cat ../../.fname`/libcruft/$(THISDIR) |
6
|
149 .PHONY: dist |