1 # Makefile for lib-src subdirectory in GNU Emacs.
2 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002 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 ====================
31 configuration
=@configuration@
33 # Program name transformation.
34 TRANSFORM
= @program_transform_name@
36 # ==================== Where To Install Things ====================
38 # The default location for installation. Everything is placed in
39 # subdirectories of this directory. The default values for many of
40 # the variables below are expressed in terms of this one, so you may
41 # not need to change them. This is set with the --prefix option to
45 # Like `prefix', but used for architecture-specific files. This is
46 # set with the --exec-prefix option to `../configure'.
47 exec_prefix=@
exec_prefix@
49 # Where to install Emacs and other binaries that people will want to
50 # run directly (like etags). This is set with the --bindir option
54 # Where to install and expect executable files to be run by Emacs
55 # rather than directly by users, and other architecture-dependent
56 # data. ${archlibdir} is usually below this. This is set with the
57 # --libexecdir option to `../configure'.
58 libexecdir
=@libexecdir@
60 # Directory for local state files for all programs.
61 localstatedir
=@localstatedir@
63 # Where to find the source code. This is set by the configure
64 # script's `--srcdir' option. However, the value of ${srcdir} in
65 # this makefile is not identical to what was specified with --srcdir,
66 # since the variable here has `/lib-src' added at the end.
68 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
72 # The top-level source directory, also set by configure.
73 top_srcdir
=@top_srcdir@
75 # ==================== Emacs-specific directories ====================
77 # These variables hold the values Emacs will actually use. They are
78 # based on the values of the standard Make variables above.
80 # Where to put executables to be run by Emacs rather than the user.
81 # This path usually includes the Emacs version and configuration name,
82 # so that multiple configurations for multiple versions of Emacs may
83 # be installed at once. This can be set with the --archlibdir option
85 archlibdir
=@archlibdir@
90 # ==================== Utility Programs for the Build =================
92 # ../configure figures out the correct values for these.
94 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
95 INSTALL_DATA
= @INSTALL_DATA@
96 # By default, we uphold the dignity of our programs.
99 # ========================== Lists of Files ===========================
101 # Things that a user might actually run,
102 # which should be installed in bindir.
103 INSTALLABLES
= etags@EXEEXT@ ctags@EXEEXT@ emacsclient@EXEEXT@ b2m@EXEEXT@ ebrowse@EXEEXT@
104 INSTALLABLE_SCRIPTS
= rcs-checkin grep-changelog
106 # Things that Emacs runs internally, or during the build process,
107 # which should not be installed in bindir.
108 UTILITIES
= profile@EXEEXT@ digest-doc@EXEEXT@ sorted-doc@EXEEXT@ movemail@EXEEXT@ cvtmail@EXEEXT@ fakemail@EXEEXT@ \
109 yow@EXEEXT@ hexl@EXEEXT@ update-game-score@EXEEXT@
111 DONT_INSTALL
= test-distrib@EXEEXT@ make-docfile@EXEEXT@
113 # Like UTILITIES, but they're not system-dependent, and should not be
114 # deleted by the distclean target.
115 SCRIPTS
= rcs2log vcdiff
117 EXECUTABLES
= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
119 SOURCES
= COPYING ChangeLog Makefile.in README emacs.csh \
120 makedoc.com
*.
[chy
] rcs2log vcdiff
122 # Additional -D flags for movemail (add to MOVE_FLAGS if desired):
123 # MAIL_USE_POP Support mail retrieval from a POP mailbox.
124 # MAIL_USE_MMDF Support MMDF mailboxes.
125 # MAIL_USE_FLOCK Use flock for file locking (see the comments
126 # about locking in movemail.c)
127 # MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
128 # it (instead of just emptying it).
129 # KERBEROS Support Kerberized POP.
130 # KRB5 Support Kerberos Version 5 pop instead of
131 # Version 4 (define this in addition to
133 # HESIOD Support Hesiod lookups of user mailboxes.
134 # MAILHOST A string, the host name of the default POP
135 # mail host for the site.
138 # ========================== start of cpp stuff =======================
139 /* From here on
, comments must be done in C syntax.
*/
141 #define NO_SHORTNAMES
142 #define THIS_IS_MAKEFILE
144 #include "../src/config.h"
146 /* We won
't really call alloca;
147 don't let the file name alloca.c
get messed up.
*/
152 /* Some machines don
\'t find the standard C libraries in the usual place.
*/
153 #ifndef ORDINARY_LINK
154 #ifndef LIB_STANDARD_LIBSRC
155 #define LIB_STANDARD_LIBSRC -lc
158 #ifndef LIB_STANDARD_LIBSRC
159 #define LIB_STANDARD_LIBSRC
163 /* Some s
/SYSTEM.h files
define this to request special libraries.
*/
168 /* Some m
/MACHINE.h files
define this to request special libraries.
*/
173 #ifndef C_SWITCH_SYSTEM
174 #define C_SWITCH_SYSTEM
177 #ifndef C_SWITCH_MACHINE
178 #define C_SWITCH_MACHINE
181 #undef MOVEMAIL_NEEDS_BLESSING
182 #ifndef MAIL_USE_FLOCK
183 #ifndef MAIL_USE_LOCKF
184 #define MOVEMAIL_NEEDS_BLESSING
188 #ifdef MOVEMAIL_NEEDS_BLESSING
189 #define BLESSMAIL blessmail
205 # ifdef HAVE_LIBDES425
212 # ifdef HAVE_LIBK5CRYPTO
213 CRYPTOLIB
= -lk5crypto
215 # ifdef HAVE_LIBCRYPTO
219 # ifdef HAVE_LIBCOM_ERR
220 COM_ERRLIB
= -lcom_err
222 #endif /* KERBEROS */
224 /* If HESIOD is defined
, set this to
"-lhesiod".
*/
225 #ifdef HAVE_LIBHESIOD
226 # ifdef HAVE_LIBRESOLV
227 HESIODLIB
= -lhesiod
-lresolv
233 LIBS_MOVE
=$(KRB4LIB
) $(DESLIB
) $(KRB5LIB
) $(CRYPTOLIB
) $(COM_ERRLIB
) $(HESIODLIB
)
239 LOADLIBES
=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD_LIBSRC
241 /* We need to
#define emacs to get the right versions of some files.
242 Some other files
- those shared with other GNU utilities
- need
243 HAVE_CONFIG_H
#defined before they know they can take advantage of
244 the information in ..
/src
/config.h.
*/
245 ALL_CFLAGS
= C_SWITCH_SYSTEM C_SWITCH_MACHINE
-DHAVE_CONFIG_H \
246 -I.
-I..
/src
-I
${srcdir} -I
${srcdir}/..
/src
${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
247 LINK_CFLAGS
= C_SWITCH_SYSTEM C_SWITCH_MACHINE
-DHAVE_CONFIG_H \
248 -I.
-I..
/src
-I
${srcdir} -I
${srcdir}/..
/src
${LDFLAGS} ${CFLAGS}
249 CPP_CFLAGS
= C_SWITCH_SYSTEM C_SWITCH_MACHINE
-DHAVE_CONFIG_H \
250 -I.
-I..
/src
-I
${srcdir} -I
${srcdir}/..
/src
${CPPFLAGS} ${CFLAGS}
251 /* This was
all of CPP_CFLAGS except
-Demacs.
252 Now that
-Demacs has been deleted from CPP_CFLAGS
,
253 this is actually the same
as CPP_CFLAGS
, but let
\'s not delete it yet.
*/
254 BASE_CFLAGS
= C_SWITCH_SYSTEM C_SWITCH_MACHINE
-DHAVE_CONFIG_H \
255 -I.
-I..
/src
-I
${srcdir} -I
${srcdir}/..
/src
${CPPFLAGS} ${CFLAGS}
257 /* This is the default compilation command.
258 But we should never rely on it
, because some make version
259 failed to find it for getopt.o.
260 Using an explicit command made it work.
*/
262 ${CC} -c
${CPP_CFLAGS} $<
264 all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
266 /* These targets copy the scripts into the build directory
267 so that they can be run from there in an uninstalled Emacs.
*/
268 rcs2log
: $(srcdir)/rcs2log
269 cp
-p
$(srcdir)/rcs2log rcs2log
271 rcs-checkin
: $(srcdir)/rcs-checkin
272 cp
-p
$(srcdir)/rcs-checkin rcs-checkin
274 grep-changelog
: $(srcdir)/grep-changelog
275 cp
-p
$(srcdir)/grep-changelog grep-changelog
277 vcdiff
: $(srcdir)/vcdiff
278 cp
-p
$(srcdir)/vcdiff vcdiff
280 #ifdef MOVEMAIL_NEEDS_BLESSING
282 ..
/src
/emacs
-batch
-l
$(srcdir)/..
/lisp
/mail
/blessmail.el
286 maybe-blessmail
: BLESSMAIL
287 #ifdef MOVEMAIL_NEEDS_BLESSING
288 /* Don
\'t charge ahead and do it
! Let the installer decide.
289 .
/blessmail
${archlibdir}/movemail@EXEEXT@
*/
290 @if
[ `wc -l <blessmail` != 2 ] ; then \
291 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
292 echo Assuming
$$dir is really the mail spool directory
, you should
; \
293 echo run lib-src
/blessmail
${archlibdir}/movemail@EXEEXT@
; \
294 echo
as root
, to give movemail@EXEEXT@ appropriate permissions.
; \
295 echo Do that after running make
install.
; \
299 /* Install the internal utilities. Until they are installed
, we can
300 just run them directly from lib-src.
*/
303 @echo
"Installing utilities run internally by Emacs."
304 $(top_srcdir
)/mkinstalldirs
${archlibdir}
305 if
[ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
306 for file in
${UTILITIES}; do \
307 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $$file ${archlibdir}/$$file ; \
310 $(top_srcdir
)/mkinstalldirs
${gamedir}
311 touch
${gamedir}/snake-scores
312 touch
${gamedir}/tetris-scores
313 /* If the following commands fail
, that is not a big deal.
314 update-game-score will detect at runtime that it is not setuid
,
315 and handle things accordingly.
*/
316 -if chown
${gameuser} ${archlibdir}/update-game-score
&& chmod u
+s
${archlibdir}/update-game-score
; then \
317 chown
${gameuser} ${gamedir}; \
318 chmod u
=rwx
,g
=rwx
,o
=rx
${gamedir}; \
320 if
[ `(cd ${archlibdir} && /bin/pwd)` \
321 != `(cd ${srcdir} && /bin/pwd)` ]; then \
322 for file in
${SCRIPTS}; do \
323 $(INSTALL_PROGRAM
) ${srcdir}/$$file ${archlibdir}/$$file; \
327 install: ${archlibdir}
329 @echo
"Installing utilities for users to run."
330 for file in
${INSTALLABLES} ; do \
331 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
332 chmod a
+rx
${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
334 for file in
${INSTALLABLE_SCRIPTS} ; do \
335 $(INSTALL_PROGRAM
) ${srcdir}/$${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
336 chmod a
+rx
${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
341 for file in
${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
342 rm -f
${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
345 rm -f
${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
351 -rm -f
${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
352 -rm -f fns
*.el
*.tab.c
*.tab.h
356 -rm -f Makefile Makefile.c blessmail
358 maintainer-clean
: distclean
361 extraclean
: maintainer-clean
370 /* Test the contents of the directory.
*/
372 @echo
"We don't have any tests for GNU Emacs yet."
378 /* This verifies that the non-ASCII characters in the file \
`testfile\'
379 have not been clobbered by whatever means were used to copy and
380 distribute Emacs. If they were clobbered, all the .elc files were
382 test-distrib@EXEEXT@: ${srcdir}/test-distrib.c
383 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
384 ./test-distrib ${srcdir}/testfile
386 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
387 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
388 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
389 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
390 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
391 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
392 alloca.o: ${srcdir}/alloca.c
393 ${CC} -Demacs -c ${BASE_CFLAGS} ${srcdir}/alloca.c
395 #ifdef REGEXP_IN_LIBC
400 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
403 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
404 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
406 etags@EXEEXT@: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
407 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
409 ebrowse@EXEEXT@: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
410 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
412 /* We depend on etags to assure that parallel makes don\'t write two
413 etags.o files on top of each other. */
414 ctags@EXEEXT@: etags@EXEEXT@
415 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
417 profile@EXEEXT@: ${srcdir}/profile.c ../src/config.h
418 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
420 make-docfile@EXEEXT@: ${srcdir}/make-docfile.c ../src/config.h
421 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
423 digest-doc@EXEEXT@: ${srcdir}/digest-doc.c
424 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
426 sorted-doc@EXEEXT@: ${srcdir}/sorted-doc.c ${ALLOCA}
427 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
429 b2m@EXEEXT@: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
430 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c -DVERSION="\"${version}\"" \
431 $(GETOPTOBJS) $(LOADLIBES) -o b2m
433 movemail@EXEEXT@: movemail.o pop.o $(GETOPTDEPS)
434 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail
436 movemail.o: ${srcdir}/movemail.c ../src/config.h
437 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
439 pop.o: ${srcdir}/pop.c ../src/config.h
440 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
442 cvtmail@EXEEXT@: ${srcdir}/cvtmail.c
443 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
445 fakemail@EXEEXT@: ${srcdir}/fakemail.c ../src/config.h
446 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
448 yow@EXEEXT@: ${srcdir}/yow.c ../src/epaths.h
449 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
451 emacsclient@EXEEXT@: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
452 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
453 -DVERSION=`sed
-n
-e
'/(defconst emacs-version/ s/^[^"]*\("[^"]*"\).*/\1/p' ${srcdir}/..
/lisp
/version.el
` \
454 $(LOADLIBES) -o emacsclient
456 hexl@EXEEXT@: ${srcdir}/hexl.c ../src/config.h
457 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
459 update-game-score@EXEEXT@: ${srcdir}/update-game-score.c ../src/config.h
460 $(CC) ${ALL_CFLAGS} ${srcdir}/update-game-score.c \
461 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
462 $(LOADLIBES) -o update-game-score
464 /* These are NOT included in INSTALLABLES or UTILITIES.
465 See ../src/Makefile.in. */
466 emacstool@EXEEXT@: ${srcdir}/emacstool.c
467 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
468 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
470 /* For SUN Japanese Language Environment. */
471 nemacstool@EXEEXT@: ${srcdir}/emacstool.c
472 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
473 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
475 xvetool@EXEEXT@: ${srcdir}/emacstool.c
476 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
477 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
480 xveterm@EXEEXT@: ${srcdir}/emacstool.c
481 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
482 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \