(x_error_quitter): Add newline to error message.
[emacs.git] / lib-src / Makefile.in
blob27bd6f2e6488ed554fe8acf6c5adb8fc36fd9a07
1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
4 # This file is part of GNU Emacs.
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.
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.
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.
21 # Avoid trouble on systems where the `SHELL' variable might be
22 # inherited from the environment.
23 SHELL = /bin/sh
25 # ==================== Things `configure' will edit ====================
27 CC=@CC@
28 CFLAGS=@CFLAGS@
29 ALLOCA=@ALLOCA@
30 YACC=@YACC@
31 version=@version@
32 configuration=@configuration@
34 # ==================== Where To Install Things ====================
36 # The default location for installation. Everything is placed in
37 # subdirectories of this directory. The default values for many of
38 # the variables below are expressed in terms of this one, so you may
39 # not need to change them. This is set with the --prefix option to
40 # `../configure'.
41 prefix=@prefix@
43 # Like `prefix', but used for architecture-specific files. This is
44 # set with the --exec-prefix option to `../configure'.
45 exec_prefix=@exec_prefix@
47 # Where to install Emacs and other binaries that people will want to
48 # run directly (like etags). This is set with the --bindir option
49 # to `../configure'.
50 bindir=@bindir@
52 # Where to install and expect executable files to be run by Emacs
53 # rather than directly by users, and other architecture-dependent
54 # data. ${archlibdir} is usually below this. This is set with the
55 # --libexecdir option to `../configure'.
56 libexecdir=@libexecdir@
58 # Where to find the source code. This is set by the configure
59 # script's `--srcdir' option. However, the value of ${srcdir} in
60 # this makefile is not identical to what was specified with --srcdir,
61 # since the variable here has `/lib-src' added at the end.
62 srcdir=@srcdir@
63 VPATH=@srcdir@
65 # The top-level source directory, also set by configure.
66 top_srcdir=@top_srcdir@
68 # ==================== Emacs-specific directories ====================
70 # These variables hold the values Emacs will actually use. They are
71 # based on the values of the standard Make variables above.
73 # Where to put executables to be run by Emacs rather than the user.
74 # This path usually includes the Emacs version and configuration name,
75 # so that multiple configurations for multiple versions of Emacs may
76 # be installed at once. This can be set with the --archlibdir option
77 # to `../configure'.
78 archlibdir=@archlibdir@
80 # ==================== Utility Programs for the Build =================
82 # ../configure figures out the correct values for these.
83 INSTALL = @INSTALL@
84 INSTALL_PROGRAM = @INSTALL_PROGRAM@
85 INSTALL_DATA = @INSTALL_DATA@
87 # ========================== Lists of Files ===========================
89 # Things that a user might actually run,
90 # which should be installed in bindir.
91 INSTALLABLES = etags ctags emacsclient b2m
92 INSTALLABLE_SCRIPTS = rcs-checkin
94 # Things that Emacs runs internally, or during the build process,
95 # which should not be installed in bindir.
96 UTILITIES= wakeup profile digest-doc \
97 sorted-doc movemail cvtmail fakemail yow emacsserver hexl timer
99 DONT_INSTALL= test-distrib make-docfile
101 # Like UTILITIES, but they're not system-dependent, and should not be
102 # deleted by the distclean target.
103 SCRIPTS= rcs2log vcdiff
105 EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
107 SOURCES = COPYING ChangeLog Makefile.in README emacs.csh \
108 makedoc.com *.[chy] rcs2log vcdiff
110 # Additional -D flags for movemail (add to MOVE_FLAGS if desired):
111 # MAIL_USE_POP Support mail retrieval from a POP mailbox.
112 # MAIL_USE_MMDF Support MMDF mailboxes.
113 # MAIL_USE_FLOCK Use flock for file locking (see the comments
114 # about locking in movemail.c)
115 # MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
116 # it (instead of just emptying it).
117 # KERBEROS Support Kerberized POP.
118 # KRB5 Support Kerberos Version 5 pop instead of
119 # Version 4 (define this in addition to
120 # KERBEROS).
121 # HESIOD Support Hesiod lookups of user mailboxes.
122 # MAILHOST A string, the host name of the default POP
123 # mail host for the site.
124 MOVE_FLAGS=
126 # Additional libraries for movemail:
127 # For KERBEROS
128 # MOVE_LIBS= -lkrb -ldes -lcom_err
129 # For KERBEROS + KRB5
130 # MOVE_LIBS= -lkrb5 -lcrypto -lisode -lcom_err
131 # Add "-lhesiod" if HESIOD is defined.
132 MOVE_LIBS=
134 # ========================== start of cpp stuff =======================
135 /* From here on, comments must be done in C syntax. */
137 #define NO_SHORTNAMES
138 #define THIS_IS_MAKEFILE
139 #define NOT_C_CODE
140 #include "../src/config.h"
142 /* We won't really call alloca;
143 don't let the file name alloca.c get messed up. */
144 #ifdef alloca
145 #undef alloca
146 #endif
148 /* Some machines don't find the standard C libraries in the usual place. */
149 #ifndef ORDINARY_LINK
150 #ifndef LIB_STANDARD_LIBSRC
151 #define LIB_STANDARD_LIBSRC -lc
152 #endif
153 #else
154 #ifndef LIB_STANDARD_LIBSRC
155 #define LIB_STANDARD_LIBSRC
156 #endif
157 #endif
159 /* Some s/*.h files define this to request special libraries. */
160 #ifndef LIBS_SYSTEM
161 #define LIBS_SYSTEM
162 #endif
164 /* Some m/*.h files define this to request special libraries. */
165 #ifndef LIBS_MACHINE
166 #define LIBS_MACHINE
167 #endif
169 #ifndef C_SWITCH_SYSTEM
170 #define C_SWITCH_SYSTEM
171 #endif
173 #ifndef C_SWITCH_MACHINE
174 #define C_SWITCH_MACHINE
175 #endif
177 #undef MOVEMAIL_NEEDS_BLESSING
178 #ifndef MAIL_USE_FLOCK
179 #ifndef MAIL_USE_LOCKF
180 #define MOVEMAIL_NEEDS_BLESSING
181 #endif
182 #endif
184 #ifdef MOVEMAIL_NEEDS_BLESSING
185 #define BLESSMAIL blessmail
186 #else
187 #define BLESSMAIL
188 #endif
190 LOADLIBES=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD_LIBSRC
192 /* We need to #define emacs to get the right versions of some files.
193 Some other files - those shared with other GNU utilities - need
194 HAVE_CONFIG_H #defined before they know they can take advantage of
195 the information in ../src/config.h. */
196 ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
197 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
198 LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
199 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
200 CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
201 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
202 /* This was all of CPP_CFLAGS except -Demacs.
203 Now that -Demacs has been deleted from CPP_CFLAGS,
204 this is actually the same as CPP_CFLAGS, but let's not delete it yet. */
205 BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
206 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
208 /* This is the default compilation command.
209 But we should never rely on it, because some make version
210 failed to find it for getopt.o.
211 Using an explicit command made it work. */
212 .c.o:
213 ${CC} -c ${CPP_CFLAGS} $<
215 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES}
217 #ifdef MOVEMAIL_NEEDS_BLESSING
218 blessmail:
219 ../src/emacs -batch -l ../lisp/blessmail.el
220 chmod +x blessmail
221 #endif
223 maybe-blessmail: BLESSMAIL
224 #ifdef MOVEMAIL_NEEDS_BLESSING
225 /* Don't charge ahead and do it! Let the installer decide.
226 ./blessmail ${archlibdir}/movemail */
227 @if [ `wc -l <blessmail` != 2 ] ; then \
228 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
229 echo Assuming $$dir is really the mail spool directory, you should; \
230 echo run lib-src/blessmail ${archlibdir}/movemail; \
231 echo as root, to give movemail appropriate permissions.; \
232 echo Do that after running make install.; \
234 #endif
236 /* Install the internal utilities. Until they are installed, we can
237 just run them directly from lib-src. */
238 ${archlibdir}: all
239 @echo
240 @echo "Installing utilities run internally by Emacs."
241 $(top_srcdir)/mkinstalldirs ${archlibdir}
242 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
243 for file in ${UTILITIES}; do \
244 $(INSTALL_PROGRAM) $$file ${archlibdir}/$$file ; \
245 done ; \
247 if [ `(cd ${archlibdir} && /bin/pwd)` \
248 != `(cd ${srcdir} && /bin/pwd)` ]; then \
249 for file in ${SCRIPTS}; do \
250 $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file; \
251 done ; \
254 /* We don't need to install `wakeup' explicitly, because it will be
255 copied when this whole directory is copied. */
256 install: ${archlibdir}
257 @echo
258 @echo "Installing utilities for users to run."
259 for file in ${INSTALLABLES} ; do \
260 $(INSTALL_PROGRAM) $${file} ${bindir}/$${file} ; \
261 chmod a+rx ${bindir}/$${file}; \
262 done
263 for file in ${INSTALLABLE_SCRIPTS} ; do \
264 $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file} ; \
265 chmod a+rx ${bindir}/$${file}; \
266 done
268 uninstall:
269 (cd ${bindir}; \
270 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
271 (cd ${archlibdir}; \
272 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
274 mostlyclean:
275 -rm -f core *.o
277 clean: mostlyclean
278 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
279 -rm -f ../etc/DOC* *.tab.c *.tab.h
281 distclean: clean
282 -rm -f TAGS
283 -rm -f Makefile Makefile.c blessmail
285 maintainer-clean: distclean
286 true
288 extraclean: maintainer-clean
289 -rm -f *~ \#*
291 unlock:
292 chmod u+w $(SOURCES)
294 relock:
295 chmod u-w $(SOURCES)
297 /* Test the contents of the directory. */
298 check:
299 @echo "We don't have any tests for GNU Emacs yet."
301 tags: TAGS
302 TAGS: etags
303 etags *.[ch]
305 /* This verifies that the non-ASCII characters in the file `testfile'
306 have not been clobbered by whatever means were used to copy and
307 distribute Emacs. If they were clobbered, all the .elc files were
308 clobbered too. */
309 test-distrib: ${srcdir}/test-distrib.c
310 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
311 ./test-distrib ${srcdir}/testfile
313 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
314 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
315 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
316 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
317 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
318 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
319 alloca.o: ${srcdir}/alloca.c
320 ${CC} -c ${BASE_CFLAGS} ${srcdir}/alloca.c
322 #ifdef REGEXP_IN_LIBC
323 REGEXPOBJ =
324 REGEXPDEPS =
325 #else
326 REGEXPOBJ = regex.o
327 REGEXPDEPS = $(REGEXPOBJ) ../src/regex.h
328 #endif
330 regex.o: ../src/regex.c ../src/regex.h ../src/config.h
331 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
333 etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
334 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" -DETAGS_REGEXPS ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
336 /* We depend on etags to assure that parallel makes don't write two
337 etags.o files on top of each other. */
338 ctags: etags
339 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" -DETAGS_REGEXPS ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
341 wakeup: ${srcdir}/wakeup.c
342 $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
344 profile: ${srcdir}/profile.c
345 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
347 make-docfile: ${srcdir}/make-docfile.c
348 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
350 digest-doc: ${srcdir}/digest-doc.c
351 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
353 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
354 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
356 b2m: ${srcdir}/b2m.c ../src/config.h
357 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
359 movemail: movemail.o pop.o
360 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(LOADLIBES) $(MOVE_LIBS) -o movemail
362 movemail.o: ${srcdir}/movemail.c ../src/config.h
363 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
365 pop.o: ${srcdir}/pop.c
366 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
368 cvtmail: ${srcdir}/cvtmail.c
369 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
371 fakemail: ${srcdir}/fakemail.c ../src/config.h
372 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
374 yow: ${srcdir}/yow.c ../src/paths.h
375 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
377 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
378 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
380 emacsclient: ${srcdir}/emacsclient.c ../src/config.h
381 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
383 hexl: ${srcdir}/hexl.c
384 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
386 TIMEROBJS=getdate.o timer.o $(ALLOCA)
387 $(srcdir)/getdate.c: ${srcdir}/getdate.y
388 cd $(srcdir); ${YACC} ${YFLAGS} getdate.y
389 cd $(srcdir); mv y.tab.c getdate.c
390 getdate.o: ${srcdir}/getdate.c ../src/config.h
391 $(CC) $(CPP_CFLAGS) -Demacs -c ${srcdir}/getdate.c
393 timer.o: ${srcdir}/timer.c ../src/config.h
394 $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
395 timer: ${TIMEROBJS}
396 $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
398 /* These are NOT included in INSTALLABLES or UTILITIES.
399 See ../src/Makefile.in. */
400 emacstool: ${srcdir}/emacstool.c
401 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
402 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
404 /* For SUN Japanese Language Environment. */
405 nemacstool: ${srcdir}/emacstool.c
406 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
407 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
409 xvetool: ${srcdir}/emacstool.c
410 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
411 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
412 $(LOADLIBES)
414 xveterm: ${srcdir}/emacstool.c
415 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
416 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
417 $(LOADLIBES)