(regex_tag_multiline, readline): Never pass pfnote a
[bpt/emacs.git] / lib-src / Makefile.in
1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002 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, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
20
21 # Avoid trouble on systems where the `SHELL' variable might be
22 # inherited from the environment.
23 SHELL = /bin/sh
24
25 # ==================== Things `configure' will edit ====================
26
27 CC=@CC@
28 CFLAGS=@CFLAGS@
29 ALLOCA=@ALLOCA@
30 YACC=@YACC@
31 version=@version@
32 configuration=@configuration@
33
34 # Program name transformation.
35 TRANSFORM = @program_transform_name@
36
37 # ==================== Where To Install Things ====================
38
39 # The default location for installation. Everything is placed in
40 # subdirectories of this directory. The default values for many of
41 # the variables below are expressed in terms of this one, so you may
42 # not need to change them. This is set with the --prefix option to
43 # `../configure'.
44 prefix=@prefix@
45
46 # Like `prefix', but used for architecture-specific files. This is
47 # set with the --exec-prefix option to `../configure'.
48 exec_prefix=@exec_prefix@
49
50 # Where to install Emacs and other binaries that people will want to
51 # run directly (like etags). This is set with the --bindir option
52 # to `../configure'.
53 bindir=@bindir@
54
55 # Where to install and expect executable files to be run by Emacs
56 # rather than directly by users, and other architecture-dependent
57 # data. ${archlibdir} is usually below this. This is set with the
58 # --libexecdir option to `../configure'.
59 libexecdir=@libexecdir@
60
61 # Directory for local state files for all programs.
62 localstatedir=@localstatedir@
63
64 # Where to find the source code. This is set by the configure
65 # script's `--srcdir' option. However, the value of ${srcdir} in
66 # this makefile is not identical to what was specified with --srcdir,
67 # since the variable here has `/lib-src' added at the end.
68
69 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
70 srcdir=@srcdir@
71 VPATH=@srcdir@
72
73 # The top-level source directory, also set by configure.
74 top_srcdir=@top_srcdir@
75
76 # ==================== Emacs-specific directories ====================
77
78 # These variables hold the values Emacs will actually use. They are
79 # based on the values of the standard Make variables above.
80
81 # Where to put executables to be run by Emacs rather than the user.
82 # This path usually includes the Emacs version and configuration name,
83 # so that multiple configurations for multiple versions of Emacs may
84 # be installed at once. This can be set with the --archlibdir option
85 # to `../configure'.
86 archlibdir=@archlibdir@
87
88 gamedir=@gamedir@
89 gameuser=@gameuser@
90
91 # ==================== Utility Programs for the Build =================
92
93 # ../configure figures out the correct values for these.
94 INSTALL = @INSTALL@
95 INSTALL_PROGRAM = @INSTALL_PROGRAM@
96 INSTALL_DATA = @INSTALL_DATA@
97 # By default, we uphold the dignity of our programs.
98 INSTALL_STRIP =
99
100 # ========================== Lists of Files ===========================
101
102 # Things that a user might actually run,
103 # which should be installed in bindir.
104 INSTALLABLES = etags ctags emacsclient b2m ebrowse
105 INSTALLABLE_SCRIPTS = rcs-checkin grep-changelog
106
107 # Things that Emacs runs internally, or during the build process,
108 # which should not be installed in bindir.
109 UTILITIES= profile digest-doc sorted-doc movemail cvtmail fakemail \
110 yow emacsserver hexl update-game-score
111
112 DONT_INSTALL= test-distrib make-docfile
113
114 # Like UTILITIES, but they're not system-dependent, and should not be
115 # deleted by the distclean target.
116 SCRIPTS= rcs2log vcdiff
117
118 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
119
120 SOURCES = COPYING ChangeLog Makefile.in README emacs.csh \
121 makedoc.com *.[chy] rcs2log vcdiff
122
123 # Additional -D flags for movemail (add to MOVE_FLAGS if desired):
124 # MAIL_USE_POP Support mail retrieval from a POP mailbox.
125 # MAIL_USE_MMDF Support MMDF mailboxes.
126 # MAIL_USE_FLOCK Use flock for file locking (see the comments
127 # about locking in movemail.c)
128 # MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
129 # it (instead of just emptying it).
130 # KERBEROS Support Kerberized POP.
131 # KRB5 Support Kerberos Version 5 pop instead of
132 # Version 4 (define this in addition to
133 # KERBEROS).
134 # HESIOD Support Hesiod lookups of user mailboxes.
135 # MAILHOST A string, the host name of the default POP
136 # mail host for the site.
137 MOVE_FLAGS=
138
139 # ========================== start of cpp stuff =======================
140 /* From here on, comments must be done in C syntax. */
141
142 #define NO_SHORTNAMES
143 #define THIS_IS_MAKEFILE
144 #define NOT_C_CODE
145 #include "../src/config.h"
146
147 /* We won't really call alloca;
148 don't let the file name alloca.c get messed up. */
149 #ifdef alloca
150 #undef alloca
151 #endif
152
153 /* Some machines don't find the standard C libraries in the usual place. */
154 #ifndef ORDINARY_LINK
155 #ifndef LIB_STANDARD_LIBSRC
156 #define LIB_STANDARD_LIBSRC -lc
157 #endif
158 #else
159 #ifndef LIB_STANDARD_LIBSRC
160 #define LIB_STANDARD_LIBSRC
161 #endif
162 #endif
163
164 /* Some s/SYSTEM.h files define this to request special libraries. */
165 #ifndef LIBS_SYSTEM
166 #define LIBS_SYSTEM
167 #endif
168
169 /* Some m/MACHINE.h files define this to request special libraries. */
170 #ifndef LIBS_MACHINE
171 #define LIBS_MACHINE
172 #endif
173
174 #ifndef C_SWITCH_SYSTEM
175 #define C_SWITCH_SYSTEM
176 #endif
177
178 #ifndef C_SWITCH_MACHINE
179 #define C_SWITCH_MACHINE
180 #endif
181
182 #undef MOVEMAIL_NEEDS_BLESSING
183 #ifndef MAIL_USE_FLOCK
184 #ifndef MAIL_USE_LOCKF
185 #define MOVEMAIL_NEEDS_BLESSING
186 #endif
187 #endif
188
189 #ifdef MOVEMAIL_NEEDS_BLESSING
190 #define BLESSMAIL blessmail
191 #else
192 #define BLESSMAIL
193 #endif
194
195 #ifdef KERBEROS
196 # ifdef HAVE_LIBKRB
197 KRB4LIB = -lkrb
198 # else
199 # ifdef HAVE_LIBKRB4
200 KRB4LIB = -lkrb4
201 # endif
202 # endif
203 # ifdef HAVE_LIBDES
204 DESLIB = -ldes
205 # else
206 # ifdef HAVE_LIBDES425
207 DESLIB = -ldes425
208 # endif
209 # endif
210 # ifdef HAVE_LIBKRB5
211 KRB5LIB = -lkrb5
212 # endif
213 # ifdef HAVE_LIBK5CRYPTO
214 CRYPTOLIB = -lk5crypto
215 # else
216 # ifdef HAVE_LIBCRYPTO
217 CRYPTOLIB = -lcrypto
218 # endif
219 # endif
220 # ifdef HAVE_LIBCOM_ERR
221 COM_ERRLIB = -lcom_err
222 # endif
223 #endif /* KERBEROS */
224
225 /* If HESIOD is defined, set this to "-lhesiod". */
226 #ifdef HAVE_LIBHESIOD
227 # ifdef HAVE_LIBRESOLV
228 HESIODLIB= -lhesiod -lresolv
229 # else
230 HESIODLIB= -lhesiod
231 # endif
232 #endif
233
234 LIBS_MOVE=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(HESIODLIB)
235
236 #ifdef HAVE_LIBMAIL
237 LIBS_MAIL=-lmail
238 #endif
239
240 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD_LIBSRC
241
242 /* We need to #define emacs to get the right versions of some files.
243 Some other files - those shared with other GNU utilities - need
244 HAVE_CONFIG_H #defined before they know they can take advantage of
245 the information in ../src/config.h. */
246 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
247 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
248 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
249 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
250 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
251 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
252 /* This was all of CPP_CFLAGS except -Demacs.
253 Now that -Demacs has been deleted from CPP_CFLAGS,
254 this is actually the same as CPP_CFLAGS, but let's not delete it yet. */
255 BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
256 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
257 \f
258 /* This is the default compilation command.
259 But we should never rely on it, because some make version
260 failed to find it for getopt.o.
261 Using an explicit command made it work. */
262 .c.o:
263 ${CC} -c ${CPP_CFLAGS} $<
264
265 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES}
266
267 #ifdef MOVEMAIL_NEEDS_BLESSING
268 blessmail:
269 ../src/emacs -batch -l $(srcdir)/../lisp/mail/blessmail.el
270 chmod +x blessmail
271 #endif
272
273 maybe-blessmail: BLESSMAIL
274 #ifdef MOVEMAIL_NEEDS_BLESSING
275 /* Don't charge ahead and do it! Let the installer decide.
276 ./blessmail ${archlibdir}/movemail */
277 @if [ `wc -l <blessmail` != 2 ] ; then \
278 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
279 echo Assuming $$dir is really the mail spool directory, you should; \
280 echo run lib-src/blessmail ${archlibdir}/movemail; \
281 echo as root, to give movemail appropriate permissions.; \
282 echo Do that after running make install.; \
283 fi
284 #endif
285
286 /* Install the internal utilities. Until they are installed, we can
287 just run them directly from lib-src. */
288 ${archlibdir}: all
289 @echo
290 @echo "Installing utilities run internally by Emacs."
291 $(top_srcdir)/mkinstalldirs ${archlibdir}
292 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
293 for file in ${UTILITIES}; do \
294 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $$file ${archlibdir}/$$file ; \
295 done ; \
296 fi
297 /* If the following commands fail, that is not a big deal.
298 update-game-score will detect at runtime that it is not setuid,
299 and handle things accordingly. */
300 if test ${gamedir} != no && chown ${gameuser} ${archlibdir}/update-game-score && chmod u+s ${archlibdir}/update-game-score; then \
301 $(top_srcdir)/mkinstalldirs ${gamedir}; \
302 chown ${gameuser} ${gamedir}; \
303 chmod u=rwx,g=rwx,o=rx ${gamedir}; \
304 touch ${gamedir}/snake-scores; \
305 touch ${gamedir}/tetris-scores; \
306 fi
307 if [ `(cd ${archlibdir} && /bin/pwd)` \
308 != `(cd ${srcdir} && /bin/pwd)` ]; then \
309 for file in ${SCRIPTS}; do \
310 $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file; \
311 done ; \
312 fi
313
314 install: ${archlibdir}
315 @echo
316 @echo "Installing utilities for users to run."
317 for file in ${INSTALLABLES} ; do \
318 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
319 chmod a+rx ${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
320 done
321 for file in ${INSTALLABLE_SCRIPTS} ; do \
322 $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
323 chmod a+rx ${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
324 done
325
326 uninstall:
327 (cd ${bindir}; \
328 for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
329 rm -f ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
330 done)
331 (cd ${archlibdir}; \
332 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
333
334 mostlyclean:
335 -rm -f core *.o
336
337 clean: mostlyclean
338 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
339 -rm -f fns*.el *.tab.c *.tab.h
340
341 distclean: clean
342 -rm -f TAGS
343 -rm -f Makefile Makefile.c blessmail
344
345 maintainer-clean: distclean
346 true
347
348 extraclean: maintainer-clean
349 -rm -f *~ \#*
350
351 unlock:
352 chmod u+w $(SOURCES)
353
354 relock:
355 chmod u-w $(SOURCES)
356
357 /* Test the contents of the directory. */
358 check:
359 @echo "We don't have any tests for GNU Emacs yet."
360
361 tags: TAGS
362 TAGS: etags
363 etags *.[ch]
364
365 /* This verifies that the non-ASCII characters in the file `testfile'
366 have not been clobbered by whatever means were used to copy and
367 distribute Emacs. If they were clobbered, all the .elc files were
368 clobbered too. */
369 test-distrib: ${srcdir}/test-distrib.c
370 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
371 ./test-distrib ${srcdir}/testfile
372
373 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
374 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
375 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
376 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
377 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
378 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
379 alloca.o: ${srcdir}/alloca.c
380 ${CC} -Demacs -c ${BASE_CFLAGS} ${srcdir}/alloca.c
381
382 #ifdef REGEXP_IN_LIBC
383 REGEXPOBJ =
384 REGEXPDEPS =
385 #else
386 REGEXPOBJ = regex.o
387 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
388 #endif
389
390 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
391 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
392
393 etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
394 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
395
396 ebrowse: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
397 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
398
399 /* We depend on etags to assure that parallel makes don't write two
400 etags.o files on top of each other. */
401 ctags: etags
402 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
403
404 profile: ${srcdir}/profile.c ../src/config.h
405 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
406
407 make-docfile: ${srcdir}/make-docfile.c ../src/config.h
408 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
409
410 digest-doc: ${srcdir}/digest-doc.c
411 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
412
413 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
414 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
415
416 b2m: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
417 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c -DVERSION="\"${version}\"" \
418 $(GETOPTOBJS) $(LOADLIBES) -o b2m
419
420 movemail: movemail.o pop.o $(GETOPTDEPS)
421 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail
422
423 movemail.o: ${srcdir}/movemail.c ../src/config.h
424 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
425
426 pop.o: ${srcdir}/pop.c ../src/config.h
427 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
428
429 cvtmail: ${srcdir}/cvtmail.c
430 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
431
432 fakemail: ${srcdir}/fakemail.c ../src/config.h
433 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
434
435 yow: ${srcdir}/yow.c ../src/epaths.h
436 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
437
438 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
439 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
440
441 emacsclient: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
442 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
443 -DVERSION=`sed -n -e '/(defconst emacs-version/ s/^[^"]*\("[^"]*"\).*/\1/p' ${srcdir}/../lisp/version.el` \
444 $(LOADLIBES) -o emacsclient
445
446 hexl: ${srcdir}/hexl.c ../src/config.h
447 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
448
449 update-game-score: ${srcdir}/update-game-score.c ../src/config.h
450 $(CC) ${ALL_CFLAGS} ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score
451
452 /* These are NOT included in INSTALLABLES or UTILITIES.
453 See ../src/Makefile.in. */
454 emacstool: ${srcdir}/emacstool.c
455 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
456 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
457
458 /* For SUN Japanese Language Environment. */
459 nemacstool: ${srcdir}/emacstool.c
460 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
461 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
462
463 xvetool: ${srcdir}/emacstool.c
464 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
465 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
466 $(LOADLIBES)
467
468 xveterm: ${srcdir}/emacstool.c
469 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
470 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
471 $(LOADLIBES)