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)
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.
25 # ==================== Things `configure' will edit ====================
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
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
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.
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
83 archlibdir
=@archlibdir@
88 # ==================== Utility Programs for the Build =================
90 # ../configure figures out the correct values for these.
92 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
93 INSTALL_DATA
= @INSTALL_DATA@
94 # By default, we uphold the dignity of our programs.
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
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.
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
142 #include "../src/config.h"
144 /* We won
't really call alloca;
145 don't let the file name alloca.c
get messed up.
*/
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
156 #ifndef LIB_STANDARD_LIBSRC
157 #define LIB_STANDARD_LIBSRC
161 /* Some s/SYSTEM.h files define this to request special libraries. */
166 /* Some m/MACHINE.h files define this to request special libraries. */
171 #ifndef C_SWITCH_SYSTEM
172 #define C_SWITCH_SYSTEM
175 #ifndef C_SWITCH_MACHINE
176 #define C_SWITCH_MACHINE
179 #undef MOVEMAIL_NEEDS_BLESSING
180 #ifndef MAIL_USE_FLOCK
181 #ifndef MAIL_USE_LOCKF
182 #define MOVEMAIL_NEEDS_BLESSING
186 #ifdef MOVEMAIL_NEEDS_BLESSING
187 #define BLESSMAIL blessmail
203 # ifdef HAVE_LIBDES425
210 # ifdef HAVE_LIBK5CRYPTO
211 CRYPTOLIB = -lk5crypto
213 # ifdef HAVE_LIBCRYPTO
217 # ifdef HAVE_LIBCOM_ERR
218 COM_ERRLIB = -lcom_err
220 #endif /* KERBEROS */
222 /* If HESIOD is defined, set this to "-lhesiod". */
223 #ifdef HAVE_LIBHESIOD
224 # ifdef HAVE_LIBRESOLV
225 HESIODLIB= -lhesiod -lresolv
231 LIBS_MOVE=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(HESIODLIB)
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.
*/
260 ${CC} -c
${CPP_CFLAGS} $<
262 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES}
264 #ifdef MOVEMAIL_NEEDS_BLESSING
266 ..
/src
/emacs
-batch
-l
$(srcdir)/..
/lisp
/mail
/blessmail.el
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.; \
283 /* Install the internal utilities. Until they are installed, we can
284 just run them directly from lib-src. */
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 ; \
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; \
311 install: ${archlibdir}
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
)'`; \
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
)'`; \
325 for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
326 rm -f ${bindir}/`echo $${file} | sed '$(TRANSFORM
)'` ; \
329 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
335 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
336 -rm -f fns*.el *.tab.c *.tab.h
340 -rm -f Makefile Makefile.c blessmail
342 maintainer-clean: distclean
345 extraclean: maintainer-clean
354 /* Test the contents of the directory. */
356 @echo "We don't have any tests for GNU Emacs yet.
"
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
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
384 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
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. */
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 \
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 \