(interpreter-mode-alist, auto-mode-alist): Don't alter this here.
[bpt/emacs.git] / lib-src / Makefile.in
CommitLineData
eb4252f7
RS
1# Makefile for lib-src subdirectory in GNU Emacs.
2# Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
29ed0542 3
eb4252f7 4# This file is part of GNU Emacs.
29ed0542 5
eb4252f7
RS
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.
29ed0542 10
eb4252f7
RS
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.
29ed0542 15
eb4252f7
RS
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
29ed0542 19
eb4252f7
RS
20# Avoid trouble on systems where the `SHELL' variable might be
21# inherited from the environment.
f7dbcf3c
JB
22SHELL = /bin/sh
23
eb4252f7 24# ==================== Things `configure' will edit ====================
c71beb75 25
b93f2493
BF
26CC=@CC@
27CFLAGS=@CFLAGS@
28ALLOCA=@ALLOCA@
b93f2493
BF
29YACC=@YACC@
30version=@version@
cf770692 31configuration=@configuration@
c71beb75 32
eb4252f7 33# ==================== Where To Install Things ====================
c71beb75 34
eb4252f7
RS
35# The default location for installation. Everything is placed in
36# subdirectories of this directory. The default values for many of
37# the variables below are expressed in terms of this one, so you may
38# not need to change them. This is set with the --prefix option to
39# `../configure'.
b93f2493 40prefix=@prefix@
c71beb75 41
eb4252f7
RS
42# Like `prefix', but used for architecture-specific files. This is
43# set with the --exec-prefix option to `../configure'.
b93f2493 44exec_prefix=@exec_prefix@
c71beb75 45
eb4252f7
RS
46# Where to install Emacs and other binaries that people will want to
47# run directly (like etags). This is set with the --bindir option
48# to `../configure'.
b93f2493 49bindir=@bindir@
c71beb75 50
eb4252f7
RS
51# Where to install and expect executable files to be run by Emacs
52# rather than directly by users, and other architecture-dependent
53# data. ${archlibdir} is usually below this. This is set with the
424b6d2b
RS
54# --libexecdir option to `../configure'.
55libexecdir=@libexecdir@
c71beb75 56
eb4252f7
RS
57# Where to find the source code. This is set by the configure
58# script's `--srcdir' option. However, the value of ${srcdir} in
59# this makefile is not identical to what was specified with --srcdir,
60# since the variable here has `/lib-src' added at the end.
b93f2493
BF
61srcdir=@srcdir@
62VPATH=@srcdir@
c71beb75 63
2d521ee6
DM
64# The top-level source directory, also set by configure.
65top_srcdir=@top_srcdir@
66
eb4252f7 67# ==================== Emacs-specific directories ====================
c71beb75 68
eb4252f7
RS
69# These variables hold the values Emacs will actually use. They are
70# based on the values of the standard Make variables above.
c71beb75 71
eb4252f7
RS
72# Where to put executables to be run by Emacs rather than the user.
73# This path usually includes the Emacs version and configuration name,
74# so that multiple configurations for multiple versions of Emacs may
75# be installed at once. This can be set with the --archlibdir option
76# to `../configure'.
b93f2493 77archlibdir=@archlibdir@
41f86d5a 78
eb4252f7 79# ==================== Utility Programs for the Build =================
c71beb75 80
eb4252f7 81# ../configure figures out the correct values for these.
b93f2493 82INSTALL = @INSTALL@
b93f2493
BF
83INSTALL_PROGRAM = @INSTALL_PROGRAM@
84INSTALL_DATA = @INSTALL_DATA@
c71beb75 85
eb4252f7 86# ========================== Lists of Files ===========================
f7dbcf3c 87
eb4252f7
RS
88# Things that a user might actually run,
89# which should be installed in bindir.
0d73e8e3
JB
90INSTALLABLES = etags ctags emacsclient b2m
91INSTALLABLE_SCRIPTS = rcs-checkin
f7dbcf3c 92
eb4252f7
RS
93# Things that Emacs runs internally, or during the build process,
94# which should not be installed in bindir.
5aae6601 95UTILITIES= wakeup profile digest-doc \
62039e5a 96 sorted-doc movemail cvtmail fakemail yow emacsserver hexl timer
f7dbcf3c 97
2d521ee6 98DONT_INSTALL= test-distrib make-docfile
5aae6601 99
eb4252f7
RS
100# Like UTILITIES, but they're not system-dependent, and should not be
101# deleted by the distclean target.
b7cceaf1
JB
102SCRIPTS= rcs2log vcdiff
103
0d73e8e3 104EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
f7dbcf3c 105
5c579a75 106SOURCES = COPYING ChangeLog Makefile.in README emacs.csh \
41f86d5a
ER
107 makedoc.com *.[chy] rcs2log vcdiff
108
81f94052
RS
109# Additional -D flags for movemail (add to MOVE_FLAGS if desired):
110# MAIL_USE_POP Support mail retrieval from a POP mailbox.
111# MAIL_USE_MMDF Support MMDF mailboxes.
112# MAIL_USE_FLOCK Use flock for file locking (see the comments
113# about locking in movemail.c)
114# MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
115# it (instead of just emptying it).
116# KERBEROS Support Kerberized POP.
117# KRB5 Support Kerberos Version 5 pop instead of
118# Version 4 (define this in addition to
119# KERBEROS).
120# HESIOD Support Hesiod lookups of user mailboxes.
121# MAILHOST A string, the host name of the default POP
122# mail host for the site.
123MOVE_FLAGS=
124
125# Additional libraries for movemail:
126# For KERBEROS
127# MOVE_LIBS= -lkrb -ldes -lcom_err
128# For KERBEROS + KRB5
129# MOVE_LIBS= -lkrb5 -lcrypto -lisode -lcom_err
130# Add "-lhesiod" if HESIOD is defined.
131MOVE_LIBS=
132
eb4252f7
RS
133# ========================== start of cpp stuff =======================
134/* From here on, comments must be done in C syntax. */
135
136#define NO_SHORTNAMES
fcd4533c 137#define THIS_IS_MAKEFILE
eb4252f7
RS
138#define NOT_C_CODE
139#include "../src/config.h"
140
89b3f894
RS
141/* We won't really call alloca;
142 don't let the file name alloca.c get messed up. */
143#ifdef alloca
144#undef alloca
145#endif
146
5e70aa9c
RS
147/* Some machines don't find the standard C libraries in the usual place. */
148#ifndef ORDINARY_LINK
fcd4533c
KH
149#ifndef LIB_STANDARD_LIBSRC
150#define LIB_STANDARD_LIBSRC -lc
5e70aa9c
RS
151#endif
152#else
fcd4533c
KH
153#ifndef LIB_STANDARD_LIBSRC
154#define LIB_STANDARD_LIBSRC
5e70aa9c
RS
155#endif
156#endif
157
eb4252f7
RS
158/* Some s/*.h files define this to request special libraries. */
159#ifndef LIBS_SYSTEM
160#define LIBS_SYSTEM
161#endif
162
163/* Some m/*.h files define this to request special libraries. */
164#ifndef LIBS_MACHINE
165#define LIBS_MACHINE
166#endif
167
168#ifndef C_SWITCH_SYSTEM
169#define C_SWITCH_SYSTEM
170#endif
171
172#ifndef C_SWITCH_MACHINE
173#define C_SWITCH_MACHINE
174#endif
175
176#undef MOVEMAIL_NEEDS_BLESSING
177#ifndef MAIL_USE_FLOCK
178#ifndef MAIL_USE_LOCKF
179#define MOVEMAIL_NEEDS_BLESSING
180#endif
181#endif
182
183#ifdef MOVEMAIL_NEEDS_BLESSING
184#define BLESSMAIL blessmail
185#else
186#define BLESSMAIL
187#endif
188
fcd4533c 189LOADLIBES=LIBS_SYSTEM LIBS_MACHINE LIB_STANDARD_LIBSRC
eb4252f7 190
29ed0542
RS
191/* We need to #define emacs to get the right versions of some files.
192 Some other files - those shared with other GNU utilities - need
193 HAVE_CONFIG_H #defined before they know they can take advantage of
194 the information in ../src/config.h. */
56bdb2f5 195ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
3e883207 196 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
56bdb2f5 197LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
3e883207 198 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
56bdb2f5 199CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
b2d7a9c7 200 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
56bdb2f5
RS
201/* This was all of CPP_CFLAGS except -Demacs.
202 Now that -Demacs has been deleted from CPP_CFLAGS,
203 this is actually the same as CPP_CFLAGS, but let's not delete it yet. */
1d0b600d 204BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
20cda85b 205 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
29ed0542
RS
206\f
207/* This is the default compilation command.
208 But we should never rely on it, because some make version
209 failed to find it for getopt.o.
210 Using an explicit command made it work. */
c38a040d 211.c.o:
5293b432 212 ${CC} -c ${CPP_CFLAGS} $<
c71beb75 213
0731825e 214all: ${DONT_INSTALL} ${UTILITIES} ${INSTALLABLES}
c71beb75 215
c6207d0d 216#ifdef MOVEMAIL_NEEDS_BLESSING
f675ecb5 217blessmail:
2b243866 218 ../src/emacs -batch -l ../lisp/blessmail.el
c6207d0d
KH
219 chmod +x blessmail
220#endif
221
d19f95fe
RS
222maybe-blessmail: BLESSMAIL
223#ifdef MOVEMAIL_NEEDS_BLESSING
224/* Don't charge ahead and do it! Let the installer decide.
225 ./blessmail ${archlibdir}/movemail */
226 @if [ `wc -l <blessmail` != 2 ] ; then \
227 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
228 echo Assuming $$dir is really the mail spool directory, you should; \
fed76e78 229 echo run lib-src/blessmail ${archlibdir}/movemail; \
d19f95fe 230 echo as root, to give movemail appropriate permissions.; \
eb4252f7 231 echo Do that after running make install.; \
d19f95fe
RS
232 fi
233#endif
234
29ed0542
RS
235/* Install the internal utilities. Until they are installed, we can
236 just run them directly from lib-src. */
d19f95fe 237${archlibdir}: all
c71beb75
JB
238 @echo
239 @echo "Installing utilities run internally by Emacs."
2d521ee6 240 $(top_srcdir)/mkinstalldirs ${archlibdir}
f7d3e7d0 241 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
544d556f 242 for file in ${UTILITIES}; do \
c61a529e 243 $(INSTALL_PROGRAM) $$file ${archlibdir}/$$file ; \
544d556f 244 done ; \
ad600343
RS
245 fi
246 if [ `(cd ${archlibdir} && /bin/pwd)` \
247 != `(cd ${srcdir} && /bin/pwd)` ]; then \
544d556f 248 for file in ${SCRIPTS}; do \
c61a529e 249 $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file; \
c71beb75 250 done ; \
0268f19b 251 fi
f7dbcf3c 252
29ed0542
RS
253/* We don't need to install `wakeup' explicitly, because it will be
254 copied when this whole directory is copied. */
c71beb75
JB
255install: ${archlibdir}
256 @echo
257 @echo "Installing utilities for users to run."
b70cff71 258 for file in ${INSTALLABLES} ; do \
c61a529e 259 $(INSTALL_PROGRAM) $${file} ${bindir}/$${file} ; \
c37a4294 260 chmod a+rx ${bindir}/$${file}; \
0268f19b 261 done
b70cff71 262 for file in ${INSTALLABLE_SCRIPTS} ; do \
c61a529e 263 $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file} ; \
c37a4294 264 chmod a+rx ${bindir}/$${file}; \
0268f19b 265 done
f7dbcf3c 266
39b649dd
JB
267uninstall:
268 (cd ${bindir}; \
269 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
270 (cd ${archlibdir}; \
271 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
272
a17d2c25
RS
273mostlyclean:
274 -rm -f core *.o
275
276clean: mostlyclean
5aae6601 277 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
1e8259bb 278 -rm -f ../etc/DOC* *.tab.c *.tab.h
f7dbcf3c 279
39b649dd 280distclean: clean
5c579a75 281 -rm -f TAGS
b2959c9d 282 -rm -f Makefile Makefile.c blessmail
f7dbcf3c 283
26873b72 284maintainer-clean: distclean
39b649dd 285 true
c71beb75 286
a01c76d7 287extraclean: maintainer-clean
c71beb75 288 -rm -f *~ \#*
f7dbcf3c 289
41f86d5a
ER
290unlock:
291 chmod u+w $(SOURCES)
292
293relock:
294 chmod u-w $(SOURCES)
295
29ed0542 296/* Test the contents of the directory. */
f7dbcf3c
JB
297check:
298 @echo "We don't have any tests for GNU Emacs yet."
299
93548af1 300tags: TAGS
f7dbcf3c
JB
301TAGS: etags
302 etags *.[ch]
303
29ed0542
RS
304/* This verifies that the non-ASCII characters in the file `testfile'
305 have not been clobbered by whatever means were used to copy and
306 distribute Emacs. If they were clobbered, all the .elc files were
307 clobbered too. */
0d73e8e3 308test-distrib: ${srcdir}/test-distrib.c
c88a7f88 309 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
0d73e8e3 310 ./test-distrib ${srcdir}/testfile
f7dbcf3c 311
c38a040d 312GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
0d73e8e3 313GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
b90589d8 314getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
0268f19b 315 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
b90589d8 316getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
0268f19b 317 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
20cda85b 318alloca.o: ${srcdir}/alloca.c
1d0b600d 319 ${CC} -c ${BASE_CFLAGS} ${srcdir}/alloca.c
f7dbcf3c 320
e63ceebf
RS
321#ifdef REGEXP_IN_LIBC
322REGEXPOBJ =
323REGEXPDEPS =
324#else
66ab94d9
KH
325REGEXPOBJ = regex.o
326REGEXPDEPS = $(REGEXPOBJ) ../src/regex.h
e63ceebf
RS
327#endif
328
641acd26 329regex.o: ../src/regex.c ../src/regex.h ../src/config.h
1d0b600d 330 ${CC} -c ${BASE_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
66ab94d9
KH
331
332etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
333 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" -DETAGS_REGEXPS ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
f7dbcf3c 334
29ed0542
RS
335/* We depend on etags to assure that parallel makes don't write two
336 etags.o files on top of each other. */
1ff164dd
FP
337ctags: etags
338 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" -DETAGS_REGEXPS ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
f7dbcf3c 339
0d73e8e3 340wakeup: ${srcdir}/wakeup.c
3e883207 341 $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
f7dbcf3c 342
379fb9c8
RS
343profile: ${srcdir}/profile.c
344 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
345
0d73e8e3 346make-docfile: ${srcdir}/make-docfile.c
3e883207 347 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
f7dbcf3c 348
0d73e8e3 349digest-doc: ${srcdir}/digest-doc.c
3e883207 350 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
f7dbcf3c 351
1e3255d8 352sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
3e883207 353 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
f7dbcf3c 354
0d73e8e3 355b2m: ${srcdir}/b2m.c ../src/config.h
3e883207 356 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
f7dbcf3c 357
81f94052
RS
358movemail: movemail.o pop.o
359 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(LOADLIBES) $(MOVE_LIBS) -o movemail
360
361movemail.o: ${srcdir}/movemail.c ../src/config.h
56bdb2f5 362 $(CC) -c ${CPP_CFLAGS} -Demacs ${MOVE_FLAGS} ${srcdir}/movemail.c
81f94052
RS
363
364pop.o: ${srcdir}/pop.c
365 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
f7dbcf3c 366
0d73e8e3 367cvtmail: ${srcdir}/cvtmail.c
3e883207 368 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
f7dbcf3c 369
0d73e8e3 370fakemail: ${srcdir}/fakemail.c ../src/config.h
3e883207 371 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
f7dbcf3c 372
0d73e8e3 373yow: ${srcdir}/yow.c ../src/paths.h
3e883207 374 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
f7dbcf3c 375
0d73e8e3 376emacsserver: ${srcdir}/emacsserver.c ../src/config.h
3e883207 377 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
f7dbcf3c 378
0d73e8e3 379emacsclient: ${srcdir}/emacsclient.c ../src/config.h
3e883207 380 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
f7dbcf3c 381
0d73e8e3 382hexl: ${srcdir}/hexl.c
3e883207 383 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
f7dbcf3c 384
9ff5de07 385TIMEROBJS=getdate.o timer.o $(ALLOCA)
361b7640
RS
386$(srcdir)/getdate.c: ${srcdir}/getdate.y
387 cd $(srcdir); ${YACC} ${YFLAGS} getdate.y
388 cd $(srcdir); mv y.tab.c getdate.c
389getdate.o: ${srcdir}/getdate.c ../src/config.h
56bdb2f5 390 $(CC) $(CPP_CFLAGS) -Demacs -c ${srcdir}/getdate.c
361b7640 391
0d73e8e3 392timer.o: ${srcdir}/timer.c ../src/config.h
eab5f4fd 393 $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
9ff5de07 394timer: ${TIMEROBJS}
3e883207 395 $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
f7dbcf3c 396
29ed0542 397/* These are NOT included in INSTALLABLES or UTILITIES.
b2959c9d 398 See ../src/Makefile.in. */
0d73e8e3 399emacstool: ${srcdir}/emacstool.c
3e883207 400 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
f7dbcf3c
JB
401 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
402
29ed0542 403/* For SUN Japanese Language Environment. */
0d73e8e3 404nemacstool: ${srcdir}/emacstool.c
3e883207 405 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
f7dbcf3c
JB
406 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
407
0d73e8e3 408xvetool: ${srcdir}/emacstool.c
3e883207 409 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
f7dbcf3c
JB
410 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
411 $(LOADLIBES)
412
0d73e8e3 413xveterm: ${srcdir}/emacstool.c
3e883207 414 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
f7dbcf3c
JB
415 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
416 $(LOADLIBES)