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