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 MOVE_LIBS=$(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 #ifdef HAVE_SHARED_GAME_DIR
295 chown ${gameuser} ${archlibdir}/update-game-score
296 chmod u+s ${archlibdir}/update-game-score
297 $(top_srcdir)/mkinstalldirs ${gamedir}
298 chown ${gameuser} ${gamedir}
299 chmod u=rwx,g=rwx,o=rx ${gamedir}
300 /* If you change these, be sure to change the variables in
301 lisp/play/{tetris,snake}.el. */
302 touch ${gamedir}/snake-scores
303 touch ${gamedir}/tetris-scores
305 if [ `(cd ${archlibdir} && /bin/pwd)` \
306 != `(cd ${srcdir} && /bin/pwd)` ]; then \
307 for file in ${SCRIPTS}; do \
308 $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file; \
312 install: ${archlibdir}
314 @echo "Installing utilities for users to run."
315 for file in ${INSTALLABLES} ; do \
316 $(INSTALL_PROGRAM) $(INSTALL_STRIP) $${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM
)'` ; \
317 chmod a+rx ${bindir}/`echo $${file} | sed '$(TRANSFORM
)'`; \
319 for file in ${INSTALLABLE_SCRIPTS} ; do \
320 $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM
)'` ; \
321 chmod a+rx ${bindir}/`echo $${file} | sed '$(TRANSFORM
)'`; \
326 for file in ${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
327 rm -f ${bindir}/`echo $${file} | sed '$(TRANSFORM
)'` ; \
330 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
336 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
337 -rm -f fns*.el *.tab.c *.tab.h
341 -rm -f Makefile Makefile.c blessmail
343 maintainer-clean: distclean
346 extraclean: maintainer-clean
355 /* Test the contents of the directory. */
357 @echo "We don't have any tests for GNU Emacs yet.
"
363 /* This verifies that the non-ASCII characters in the file `testfile'
364 have not been clobbered by whatever means were used to copy and
365 distribute Emacs. If they were clobbered, all the .elc files were
367 test-distrib: ${srcdir}/test-distrib.c
368 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
369 ./test-distrib ${srcdir}/testfile
371 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
372 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
373 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
374 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
375 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
376 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
377 alloca.o: ${srcdir}/alloca.c
378 ${CC} -Demacs -c ${BASE_CFLAGS} ${srcdir}/alloca.c
380 #ifdef REGEXP_IN_LIBC
385 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
388 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
389 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
391 etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
392 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
394 ebrowse: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
395 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
397 /* We depend on etags to assure that parallel makes don't write two
398 etags.o files on top of each other. */
400 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
402 profile: ${srcdir}/profile.c ../src/config.h
403 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
405 make-docfile: ${srcdir}/make-docfile.c ../src/config.h
406 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
408 digest-doc: ${srcdir}/digest-doc.c
409 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
411 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
412 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
414 b2m: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
415 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c -DVERSION="\"${version}\"" \
416 $(GETOPTOBJS) $(LOADLIBES) -o b2m
418 movemail: movemail.o pop.o $(GETOPTDEPS)
419 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBMAIL) $(MOVE_LIBS) -o movemail
421 movemail.o: ${srcdir}/movemail.c ../src/config.h
422 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
424 pop.o: ${srcdir}/pop.c ../src/config.h
425 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
427 cvtmail: ${srcdir}/cvtmail.c
428 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
430 fakemail: ${srcdir}/fakemail.c ../src/config.h
431 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
433 yow: ${srcdir}/yow.c ../src/epaths.h
434 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
436 emacsserver: ${srcdir}/emacsserver.c ../src/config.h
437 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
439 emacsclient: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
440 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
441 -DVERSION=`sed -n -e '/(defconst emacs-version/ s/^[^"]*\
("[^"]*"\).*/\1/p' ${srcdir}/../lisp/version.el` \
442 $(LOADLIBES) -o emacsclient
444 hexl: ${srcdir}/hexl.c ../src/config.h
445 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
447 update-game-score: ${srcdir}/update-game-score.c ../src/config.h
448 $(CC) ${ALL_CFLAGS} ${srcdir}/update-game-score.c $(LOADLIBES) -o update-game-score
450 /* These are NOT included in INSTALLABLES or UTILITIES.
451 See ../src/Makefile.in. */
452 emacstool: ${srcdir}/emacstool.c
453 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
454 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
456 /* For SUN Japanese Language Environment. */
457 nemacstool: ${srcdir}/emacstool.c
458 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
459 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
461 xvetool: ${srcdir}/emacstool.c
462 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
463 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
466 xveterm: ${srcdir}/emacstool.c
467 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
468 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \