1 | # Copyright (C) 1994,1995 Free Software Foundation, Inc. |
---|
2 | # |
---|
3 | # This program is free software; you can redistribute it and/or modify |
---|
4 | # it under the terms of the GNU General Public License as published by |
---|
5 | # the Free Software Foundation; either version 2, or (at your option) |
---|
6 | # any later version. |
---|
7 | # |
---|
8 | # This program is distributed in the hope that it will be useful, |
---|
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
11 | # GNU General Public License for more details. |
---|
12 | # |
---|
13 | # You should have received a copy of the GNU General Public License |
---|
14 | # along with this software; see the file COPYING. If not, write to |
---|
15 | # the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
16 | |
---|
17 | |
---|
18 | SHELL = /bin/sh |
---|
19 | |
---|
20 | subdirs=@existingdirs@ |
---|
21 | |
---|
22 | localfiles = ANNOUNCE \ |
---|
23 | COPYING \ |
---|
24 | Makefile.in \ |
---|
25 | configure \ |
---|
26 | configure.in \ |
---|
27 | config.sub \ |
---|
28 | config.guess \ |
---|
29 | install-sh |
---|
30 | |
---|
31 | localtreats = ANN.BX |
---|
32 | |
---|
33 | # `all' |
---|
34 | # Compile the entire program. This should be the default target. |
---|
35 | # This target need not rebuild any documentation files; info files |
---|
36 | # should normally be included in the distribution, and DVI files |
---|
37 | # should be made only when explicitly asked for. |
---|
38 | all: |
---|
39 | @for dir in ${subdirs}; do \ |
---|
40 | cd $$dir; \ |
---|
41 | ${MAKE} all; \ |
---|
42 | cd .. ;\ |
---|
43 | done |
---|
44 | |
---|
45 | #`install' |
---|
46 | # Compile the program and copy the executables, libraries, and so on |
---|
47 | # to the file names where they should reside for actual use. If |
---|
48 | # there is a simple test to verify that a program is properly |
---|
49 | # installed then run that test. |
---|
50 | # |
---|
51 | # Use `-' before any command for installing a man page, so that |
---|
52 | # `make' will ignore any errors. This is in case there are systems |
---|
53 | # that don't have the Unix man page documentation system installed. |
---|
54 | # |
---|
55 | # In the future, when we have a standard way of installing info |
---|
56 | # files, `install' targets will be the proper place to do so. |
---|
57 | # |
---|
58 | subdir-inst-target=install-nobuild |
---|
59 | |
---|
60 | install: all |
---|
61 | ${MAKE} subdir-inst-target=install install-nobuild |
---|
62 | |
---|
63 | install-nobuild: |
---|
64 | for dir in ${subdirs}; do \ |
---|
65 | cd $$dir; \ |
---|
66 | ${MAKE} ${subdir-inst-target}; \ |
---|
67 | cd .. ;\ |
---|
68 | done |
---|
69 | |
---|
70 | #`uninstall' |
---|
71 | # Delete all the installed files that the `install' target would |
---|
72 | # create (but not the noninstalled files such as `make all' would |
---|
73 | # create). |
---|
74 | uninstall: |
---|
75 | for dir in ${subdirs}; do \ |
---|
76 | cd $$dir; \ |
---|
77 | ${MAKE} uninstall; \ |
---|
78 | cd .. ;\ |
---|
79 | done |
---|
80 | |
---|
81 | |
---|
82 | #`clean' |
---|
83 | # Delete all files from the current directory that are normally |
---|
84 | # created by building the program. Don't delete the files that |
---|
85 | # record the configuration. Also preserve files that could be made |
---|
86 | # by building, but normally aren't because the distribution comes |
---|
87 | # with them. |
---|
88 | # |
---|
89 | # Delete `.dvi' files here if they are not part of the distribution. |
---|
90 | # |
---|
91 | clean: |
---|
92 | for dir in ${subdirs}; do \ |
---|
93 | cd $$dir; \ |
---|
94 | ${MAKE} clean; \ |
---|
95 | cd .. ;\ |
---|
96 | done |
---|
97 | |
---|
98 | #`distclean' |
---|
99 | # Delete all files from the current directory that are created by |
---|
100 | # configuring or building the program. If you have unpacked the |
---|
101 | # source and built the program without creating any other files, |
---|
102 | # `make distclean' should leave only the files that were in the |
---|
103 | # distribution. |
---|
104 | distclean: |
---|
105 | rm -f config.cache |
---|
106 | rm -f config.log |
---|
107 | rm -f config.status |
---|
108 | rm -f Makefile |
---|
109 | for dir in ${subdirs}; do \ |
---|
110 | cd $$dir; \ |
---|
111 | ${MAKE} distclean; \ |
---|
112 | cd .. ;\ |
---|
113 | done |
---|
114 | |
---|
115 | |
---|
116 | #`mostlyclean' |
---|
117 | # Like `clean', but may refrain from deleting a few files that people |
---|
118 | # normally don't want to recompile. For example, the `mostlyclean' |
---|
119 | # target for GCC does not delete `libgcc.a', because recompiling it |
---|
120 | # is rarely necessary and takes a lot of time. |
---|
121 | mostlyclean: |
---|
122 | for dir in ${subdirs}; do \ |
---|
123 | cd $$dir; \ |
---|
124 | ${MAKE} mostlyclean; \ |
---|
125 | cd .. ;\ |
---|
126 | done |
---|
127 | |
---|
128 | |
---|
129 | #`realclean' |
---|
130 | # Delete everything from the current directory that can be |
---|
131 | # reconstructed with this Makefile. This typically includes |
---|
132 | # everything deleted by distclean, plus more: C source files |
---|
133 | # produced by Bison, tags tables, info files, and so on. |
---|
134 | # |
---|
135 | # One exception, however: `make realclean' should not delete |
---|
136 | # `configure' even if `configure' can be remade using a rule in the |
---|
137 | # Makefile. More generally, `make realclean' should not delete |
---|
138 | # anything that needs to exist in order to run `configure' and then |
---|
139 | # begin to build the program. |
---|
140 | realclean: |
---|
141 | for dir in ${subdirs}; do \ |
---|
142 | cd $$dir; \ |
---|
143 | ${MAKE} realclean; \ |
---|
144 | cd .. ;\ |
---|
145 | done |
---|
146 | |
---|
147 | |
---|
148 | #`TAGS' |
---|
149 | # Update a tags table for this program. |
---|
150 | TAGS: |
---|
151 | for dir in ${subdirs}; do \ |
---|
152 | cd $$dir; \ |
---|
153 | ${MAKE} TAGS; \ |
---|
154 | cd .. ;\ |
---|
155 | done |
---|
156 | |
---|
157 | #`info' |
---|
158 | # Generate any info files needed. The best way to write the rules |
---|
159 | # is as follows: |
---|
160 | # |
---|
161 | # info: foo.info |
---|
162 | # |
---|
163 | # foo.info: $(srcdir)/foo.texi $(srcdir)/chap1.texi $(srcdir)/chap2.texi |
---|
164 | # $(MAKEINFO) $(srcdir)/foo.texi |
---|
165 | # |
---|
166 | # You must define the variable `MAKEINFO' in the Makefile. It |
---|
167 | # should run the Makeinfo program, which is part of the Texinfo2 |
---|
168 | # distribution. |
---|
169 | info: |
---|
170 | for dir in ${subdirs}; do \ |
---|
171 | cd $$dir; \ |
---|
172 | ${MAKE} info; \ |
---|
173 | cd .. ;\ |
---|
174 | done |
---|
175 | |
---|
176 | |
---|
177 | #`dvi' |
---|
178 | # Generate DVI files for all TeXinfo documentation. For example: |
---|
179 | # |
---|
180 | # dvi: foo.dvi |
---|
181 | # |
---|
182 | # foo.dvi: $(srcdir)/foo.texi $(srcdir)/chap1.texi $(srcdir)/chap2.texi |
---|
183 | # $(TEXI2DVI) $(srcdir)/foo.texi |
---|
184 | # |
---|
185 | # You must define the variable `TEXI2DVI' in the Makefile. It should |
---|
186 | # run the program `texi2dvi', which is part of the Texinfo2 |
---|
187 | # distribution. Alternatively, write just the dependencies, and |
---|
188 | # allow GNU Make to provide the command. |
---|
189 | dvi: |
---|
190 | for dir in ${subdirs}; do \ |
---|
191 | cd $$dir; \ |
---|
192 | ${MAKE} dvi; \ |
---|
193 | cd .. ;\ |
---|
194 | done |
---|
195 | |
---|
196 | #`dist' |
---|
197 | # Create a distribution tar file for this program. The tar file |
---|
198 | # should be set up so that the file names in the tar file start with |
---|
199 | # a subdirectory name which is the name of the package it is a |
---|
200 | # distribution for. This name can include the version number. |
---|
201 | # |
---|
202 | # For example, the distribution tar file of GCC version 1.40 unpacks |
---|
203 | # into a subdirectory named `gcc-1.40'. |
---|
204 | # |
---|
205 | # The easiest way to do this is to create a subdirectory |
---|
206 | # appropriately named, use `ln' or `cp' to install the proper files |
---|
207 | # in it, and then `tar' that subdirectory. |
---|
208 | # |
---|
209 | # The `dist' target should explicitly depend on all non-source files |
---|
210 | # that are in the distribution, to make sure they are up to date in |
---|
211 | # the distribution. *Ref Making Releases: (standards)Releases. |
---|
212 | distname = brand-x |
---|
213 | distdir = $(distname) |
---|
214 | treats = $(localtreats) |
---|
215 | announcefile = ANN.BX |
---|
216 | |
---|
217 | manifest-file: |
---|
218 | rm -f MANIFEST |
---|
219 | cp $(announcefile) ANNOUNCE |
---|
220 | for treat in $(localfiles) $(treats) ; \ |
---|
221 | do echo $$treat >> MANIFEST ; \ |
---|
222 | done |
---|
223 | for subdir in $(subdirs) ; do \ |
---|
224 | make -s -f $$subdir/Makefile.in SUBDIR=$$subdir manifest >> MANIFEST ; \ |
---|
225 | done |
---|
226 | sed -e "s%^%$(distdir)/%" MANIFEST > M2 |
---|
227 | sed -e "/Entering dir/d" -e "/Leaving dir/d" M2 > MANIFEST |
---|
228 | rm M2 |
---|
229 | |
---|
230 | |
---|
231 | |
---|
232 | dist: manifest-file |
---|
233 | mkdir $(distdir) |
---|
234 | - cd $(distdir); \ |
---|
235 | for file in $(localfiles) $(treats) $(subdirs); do ln -s ../$$file; done; \ |
---|
236 | cd ..; \ |
---|
237 | tar -zhcvf $(distname).tar.gz --files-from MANIFEST |
---|
238 | rm -rf $(distdir) |
---|
239 | -tar ztvf $(distname).tar.gz | grep ".*~" > BACKUPS |
---|
240 | test -s BACKUPS && (echo WARNING -- MANIFEST INCLUDES BACK FILES; cat BACKUPS) |
---|
241 | |
---|
242 | #`check' |
---|
243 | # Perform self-tests (if any). The user must build the program |
---|
244 | # before running the tests, but need not install the program; you |
---|
245 | # should write the self-tests so that they work when the program is |
---|
246 | # built but not installed. |
---|
247 | check: |
---|
248 | for dir in ${subdirs}; do \ |
---|
249 | cd $$dir; \ |
---|
250 | ${MAKE} check; \ |
---|
251 | cd .. ;\ |
---|
252 | done |
---|
253 | |
---|
254 | |
---|
255 | #`installcheck' |
---|
256 | # Perform installation tests (if any). The user must build and |
---|
257 | # install the program before running the tests. You should not |
---|
258 | # assume that `$(bindir)' is in the search path. |
---|
259 | installcheck: |
---|
260 | for dir in ${subdirs}; do \ |
---|
261 | cd $$dir; \ |
---|
262 | ${MAKE} installcheck; \ |
---|
263 | cd .. ;\ |
---|
264 | done |
---|
265 | |
---|
266 | |
---|
267 | #`installdirs' |
---|
268 | # It's useful to add a target named `installdirs' to create the |
---|
269 | # directories where files are installed, and their parent |
---|
270 | # directories. There is a script called `mkinstalldirs' which is |
---|
271 | # convenient for this; find it in the Texinfo package.You can use a |
---|
272 | # rule like this: |
---|
273 | # |
---|
274 | # # Make sure all installation directories, e.g. $(bindir) actually exist by |
---|
275 | # # making them if necessary. |
---|
276 | # installdirs: mkinstalldirs |
---|
277 | # $(srcdir)/mkinstalldirs $(bindir) $(datadir) $(libdir) \ |
---|
278 | # $(infodir) $(mandir) |
---|
279 | installdirs: |
---|
280 | for dir in ${subdirs}; do \ |
---|
281 | cd $$dir; \ |
---|
282 | ${MAKE} installdirs; \ |
---|
283 | cd .. ;\ |
---|
284 | done |
---|
285 | |
---|
286 | |
---|
287 | |
---|
288 | # Cygnus extention: |
---|
289 | # |
---|
290 | # `Makefile' |
---|
291 | # Calls `./config.status' to rebuild the `Makefile' in this |
---|
292 | # directory. |
---|
293 | Makefile: |
---|
294 | ${SHELL-/bin/sh} config.status |
---|