]> code.delx.au - gnu-emacs/blob - lib-src/Makefile.in
(${archlibdir}): Be lenient about wc output format.
[gnu-emacs] / lib-src / Makefile.in
1 /* Makefile for lib-src subdirectory in GNU Emacs.
2 Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 #define NO_SHORTNAMES
21 #define THIS_IS_YMAKEFILE
22 #define NOT_C_CODE
23 #include "../src/config.h"
24
25 /* Some s/*.h files define this to request special libraries. */
26 #ifndef LIBS_SYSTEM
27 #define LIBS_SYSTEM
28 #endif
29
30 /* Some m/*.h files define this to request special libraries. */
31 #ifndef LIBS_MACHINE
32 #define LIBS_MACHINE
33 #endif
34
35 #ifndef C_SWITCH_SYSTEM
36 #define C_SWITCH_SYSTEM
37 #endif
38
39 #ifndef C_SWITCH_MACHINE
40 #define C_SWITCH_MACHINE
41 #endif
42
43 #undef MOVEMAIL_NEEDS_BLESSING
44 #ifndef MAIL_USE_FLOCK
45 #ifndef MAIL_USE_LOCKF
46 #define MOVEMAIL_NEEDS_BLESSING
47 #endif
48 #endif
49
50 #ifdef MOVEMAIL_NEEDS_BLESSING
51 #define BLESSMAIL blessmail
52 #else
53 #define BLESSMAIL
54 #endif
55
56 /* Avoid trouble on systems where the `SHELL' variable might be
57 inherited from the environment. */
58 SHELL = /bin/sh
59
60 /* ==================== Things `configure' will edit ==================== */
61
62 CC=@CC@
63 CFLAGS=@CFLAGS@
64 ALLOCA=@ALLOCA@
65 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
66 YACC=@YACC@
67 version=@version@
68 configuration=@configuration@
69
70 /* ==================== Where To Install Things ==================== */
71
72 /* The default location for installation. Everything is placed in
73 subdirectories of this directory. The default values for many of
74 the variables below are expressed in terms of this one, so you may
75 not need to change them. This is set with the --prefix option to
76 `../configure'. */
77 prefix=@prefix@
78
79 /* Like `prefix', but used for architecture-specific files. This is
80 set with the --exec-prefix option to `../configure'. */
81 exec_prefix=@exec_prefix@
82
83 /* Where to install Emacs and other binaries that people will want to
84 run directly (like etags). This is set with the --bindir option
85 to `../configure'. */
86 bindir=@bindir@
87
88 /* Where to install and expect executable files to be run by Emacs
89 rather than directly by users, and other architecture-dependent
90 data. ${archlibdir} is usually below this. This is set with the
91 --libdir option to `../configure'. */
92 libdir=@libdir@
93
94 /* Where to find the source code. This is set by the configure
95 script's `--srcdir' option. However, the value of ${srcdir} in
96 this makefile is not identical to what was specified with --srcdir,
97 since the variable here has `/lib-src' added at the end. */
98 srcdir=@srcdir@
99 VPATH=@srcdir@
100
101 /* ==================== Emacs-specific directories ==================== */
102
103 /* These variables hold the values Emacs will actually use. They are
104 based on the values of the standard Make variables above. */
105
106 /* Where to put executables to be run by Emacs rather than the user.
107 This path usually includes the Emacs version and configuration name,
108 so that multiple configurations for multiple versions of Emacs may
109 be installed at once. This can be set with the --archlibdir option
110 to `../configure'. */
111 archlibdir=@archlibdir@
112
113 /* ==================== Utility Programs for the Build ================= */
114
115 /* ../configure figures out the correct values for these. */
116 INSTALL = @INSTALL@
117 INSTALL_PROGRAM = @INSTALL_PROGRAM@
118 INSTALL_DATA = @INSTALL_DATA@
119
120 /* ============================= Targets ============================== */
121
122 /* Things that a user might actually run,
123 which should be installed in bindir. */
124 INSTALLABLES = etags ctags emacsclient b2m
125 INSTALLABLE_SCRIPTS = rcs-checkin
126
127 /* Things that Emacs runs internally, or during the build process,
128 which should not be installed in bindir. */
129 UTILITIES= test-distrib make-path wakeup profile make-docfile digest-doc \
130 sorted-doc movemail cvtmail fakemail yow emacsserver hexl timer
131
132 /* Like UTILITIES, but they're not system-dependent, and should not be
133 deleted by the distclean target. */
134 SCRIPTS= rcs2log vcdiff
135
136 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
137
138 SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
139 makedoc.com *.[chy] rcs2log vcdiff
140
141 /* We need to #define emacs to get the right versions of some files.
142 Some other files - those shared with other GNU utilities - need
143 HAVE_CONFIG_H #defined before they know they can take advantage of
144 the information in ../src/config.h. */
145 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
146 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
147 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
148 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
149 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
150 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
151 \f
152 /* This is the default compilation command.
153 But we should never rely on it, because some make version
154 failed to find it for getopt.o.
155 Using an explicit command made it work. */
156 .c.o:
157 ${CC} -c ${CPP_CFLAGS} $<
158
159 all: ${UTILITIES} ${INSTALLABLES}
160
161 #ifdef MOVEMAIL_NEEDS_BLESSING
162 blessmail: ../src/emacs
163 ../src/emacs -batch -l blessmail.el
164 chmod +x blessmail
165 #endif
166
167 /* Install the internal utilities. Until they are installed, we can
168 just run them directly from lib-src. */
169 ${archlibdir}: all BLESSMAIL
170 @echo
171 @echo "Installing utilities run internally by Emacs."
172 ./make-path ${archlibdir}
173 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
174 for file in ${UTILITIES}; do \
175 (cd ..; $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \
176 done ; \
177 for file in ${SCRIPTS}; do \
178 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \
179 done ; \
180 fi
181 #ifdef MOVEMAIL_NEEDS_BLESSING
182 /* Don't charge ahead and do it! Let the installer decide.
183 ./blessmail ${archlibdir}/movemail */
184 @if [ `wc -l <blessmail` != 2 ] ; then \
185 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
186 echo Assuming $$dir is really the mail spool directory, you should; \
187 echo run ./blessmail ${archlibdir}/movemail; \
188 echo as root, to give movemail appropriate permissions.; \
189 fi
190 #endif
191
192 /* We don't need to install `wakeup' explicitly, because it will be
193 copied when this whole directory is copied. */
194 install: ${archlibdir}
195 @echo
196 @echo "Installing utilities for users to run."
197 for file in ${INSTALLABLES} ; do \
198 (cd ..; $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
199 done
200 for file in ${INSTALLABLE_SCRIPTS} ; do \
201 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
202 done
203
204 uninstall:
205 (cd ${bindir}; \
206 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
207 (cd ${archlibdir}; \
208 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
209
210 mostlyclean:
211 -rm -f core *.o
212
213 clean: mostlyclean
214 -rm -f ${INSTALLABLES} ${UTILITIES}
215
216 distclean: clean
217 -rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS
218
219 realclean: distclean
220 true
221
222 extraclean: realclean
223 -rm -f *~ \#*
224
225 unlock:
226 chmod u+w $(SOURCES)
227
228 relock:
229 chmod u-w $(SOURCES)
230
231 /* Test the contents of the directory. */
232 check:
233 @echo "We don't have any tests for GNU Emacs yet."
234
235 TAGS: etags
236 etags *.[ch]
237
238 /* This verifies that the non-ASCII characters in the file `testfile'
239 have not been clobbered by whatever means were used to copy and
240 distribute Emacs. If they were clobbered, all the .elc files were
241 clobbered too. */
242 test-distrib: ${srcdir}/test-distrib.c
243 $(CC) -o test-distrib ${srcdir}/test-distrib.c
244 ./test-distrib ${srcdir}/testfile
245
246 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
247 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
248 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
249 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
250 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
251 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
252
253 etags: ${srcdir}/etags.c $(GETOPTDEPS) ../src/config.h
254 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags
255
256 /* We depend on etags to assure that parallel makes don't write two
257 etags.o files on top of each other. */
258 ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags
259 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
260
261 wakeup: ${srcdir}/wakeup.c
262 $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
263
264 profile: ${srcdir}/profile.c
265 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
266
267 make-docfile: ${srcdir}/make-docfile.c
268 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
269
270 digest-doc: ${srcdir}/digest-doc.c
271 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
272
273 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
274 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
275
276 b2m: ${srcdir}/b2m.c ../src/config.h
277 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
278
279 movemail: ${srcdir}/movemail.c ../src/config.h
280 $(CC) ${ALL_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail
281
282 cvtmail: ${srcdir}/cvtmail.c
283 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
284
285 fakemail: ${srcdir}/fakemail.c ../src/config.h
286 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
287
288 yow: ${srcdir}/yow.c ../src/paths.h
289 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
290
291 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
292 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
293
294 emacsclient: ${srcdir}/emacsclient.c ../src/config.h
295 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
296
297 hexl: ${srcdir}/hexl.c
298 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
299
300 TIMEROBJS=getdate.o timer.o $(ALLOCA)
301 getdate.o: ${srcdir}/getdate.y ../src/config.h
302 ${YACC} ${YFLAGS} ${srcdir}/getdate.y
303 $(CC) $(CPP_CFLAGS) -c y.tab.c
304 mv y.tab.o getdate.o
305 timer.o: ${srcdir}/timer.c ../src/config.h
306 $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
307 timer: ${TIMEROBJS}
308 $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
309
310 make-path: ${srcdir}/make-path.c ../src/config.h
311 $(CC) $(ALL_CFLAGS) ${srcdir}/make-path.c -o make-path
312
313 /* These are NOT included in INSTALLABLES or UTILITIES.
314 See ../src/ymakefile. */
315 emacstool: ${srcdir}/emacstool.c
316 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
317 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
318
319 /* For SUN Japanese Language Environment. */
320 nemacstool: ${srcdir}/emacstool.c
321 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
322 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
323
324 xvetool: ${srcdir}/emacstool.c
325 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
326 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
327 $(LOADLIBES)
328
329 xveterm: ${srcdir}/emacstool.c
330 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
331 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
332 $(LOADLIBES)
333
334 aixcc: ${srcdir}/aixcc.c
335 $(CC) $(ALL_CFLAGS) -o aixcc ${srcdir}/aixcc.c
336
337 aixcc.c: ${srcdir}/aixcc.lex
338 lex ${srcdir}/aixcc.lex
339 mv lex.yy.c aixcc.c