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 ctags emacsclient b2m ebrowse
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 digest-doc sorted-doc movemail cvtmail fakemail \
109 yow hexl update-game-score
111 DONT_INSTALL
= test-distrib make-docfile
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}
266 #ifdef MOVEMAIL_NEEDS_BLESSING
268 ..
/src
/emacs
-batch
-l
$(srcdir)/..
/lisp
/mail
/blessmail.el
272 maybe-blessmail
: BLESSMAIL
273 #ifdef MOVEMAIL_NEEDS_BLESSING
274 /* Don
\'t charge ahead and do it
! Let the installer decide.
275 .
/blessmail
${archlibdir}/movemail
*/
276 @if
[ `wc -l <blessmail` != 2 ] ; then \
277 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
278 echo Assuming
$$dir is really the mail spool directory
, you should
; \
279 echo run lib-src
/blessmail
${archlibdir}/movemail
; \
280 echo
as root
, to give movemail appropriate permissions.
; \
281 echo Do that after running make
install.
; \
285 /* Install the internal utilities. Until they are installed
, we can
286 just run them directly from lib-src.
*/
289 @echo
"Installing utilities run internally by Emacs."
290 $(top_srcdir
)/mkinstalldirs
${archlibdir}
291 if
[ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
292 for file in
${UTILITIES}; do \
293 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $$file ${archlibdir}/$$file ; \
296 $(top_srcdir
)/mkinstalldirs
${gamedir}
297 touch
${gamedir}/snake-scores
298 touch
${gamedir}/tetris-scores
299 /* If the following commands fail
, that is not a big deal.
300 update-game-score will detect at runtime that it is not setuid
,
301 and handle things accordingly.
*/
302 -if chown
${gameuser} ${archlibdir}/update-game-score
&& chmod u
+s
${archlibdir}/update-game-score
; then \
303 chown
${gameuser} ${gamedir}; \
304 chmod u
=rwx
,g
=rwx
,o
=rx
${gamedir}; \
306 if
[ `(cd ${archlibdir} && /bin/pwd)` \
307 != `(cd ${srcdir} && /bin/pwd)` ]; then \
308 for file in
${SCRIPTS}; do \
309 $(INSTALL_PROGRAM
) ${srcdir}/$$file ${archlibdir}/$$file; \
313 install: ${archlibdir}
315 @echo
"Installing utilities for users to run."
316 for file in
${INSTALLABLES} ; do \
317 $(INSTALL_PROGRAM
) $(INSTALL_STRIP
) $${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
318 chmod a
+rx
${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
320 for file in
${INSTALLABLE_SCRIPTS} ; do \
321 $(INSTALL_PROGRAM
) ${srcdir}/$${file} ${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
322 chmod a
+rx
${bindir}/`echo $${file} | sed '$(TRANSFORM)'`; \
327 for file in
${INSTALLABLES} ${INSTALLABLE_SCRIPTS}; do \
328 rm -f
${bindir}/`echo $${file} | sed '$(TRANSFORM)'` ; \
331 rm -f
${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
337 -rm -f
${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
338 -rm -f fns
*.el
*.tab.c
*.tab.h
342 -rm -f Makefile Makefile.c blessmail
344 maintainer-clean
: distclean
347 extraclean
: maintainer-clean
356 /* Test the contents of the directory.
*/
358 @echo
"We don't have any tests for GNU Emacs yet."
364 /* This verifies that the non-ASCII characters in the file \
`testfile\'
365 have not been clobbered by whatever means were used to copy and
366 distribute Emacs. If they were clobbered, all the .elc files were
368 test-distrib: ${srcdir}/test-distrib.c
369 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
370 ./test-distrib ${srcdir}/testfile
372 GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
373 GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
374 getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
375 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
376 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
377 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
378 alloca.o: ${srcdir}/alloca.c
379 ${CC} -Demacs -c ${BASE_CFLAGS} ${srcdir}/alloca.c
381 #ifdef REGEXP_IN_LIBC
386 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
389 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
390 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
392 etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
393 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
395 ebrowse: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
396 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
398 /* We depend on etags to assure that parallel makes don\'t write two
399 etags.o files on top of each other. */
401 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
403 profile: ${srcdir}/profile.c ../src/config.h
404 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
406 make-docfile: ${srcdir}/make-docfile.c ../src/config.h
407 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
409 digest-doc: ${srcdir}/digest-doc.c
410 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
412 sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
413 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
415 b2m: ${srcdir}/b2m.c ../src/config.h $(GETOPTDEPS)
416 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c -DVERSION="\"${version}\"" \
417 $(GETOPTOBJS) $(LOADLIBES) -o b2m
419 movemail: movemail.o pop.o $(GETOPTDEPS)
420 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MAIL) $(LIBS_MOVE) -o movemail
422 movemail.o: ${srcdir}/movemail.c ../src/config.h
423 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
425 pop.o: ${srcdir}/pop.c ../src/config.h
426 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
428 cvtmail: ${srcdir}/cvtmail.c
429 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
431 fakemail: ${srcdir}/fakemail.c ../src/config.h
432 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
434 yow: ${srcdir}/yow.c ../src/epaths.h
435 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
437 emacsclient: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
438 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
439 -DVERSION=`sed
-n
-e
'/(defconst emacs-version/ s/^[^"]*\("[^"]*"\).*/\1/p' ${srcdir}/..
/lisp
/version.el
` \
440 $(LOADLIBES) -o emacsclient
442 hexl: ${srcdir}/hexl.c ../src/config.h
443 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
445 update-game-score: ${srcdir}/update-game-score.c ../src/config.h
446 $(CC) ${ALL_CFLAGS} ${srcdir}/update-game-score.c \
447 -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
448 $(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 \