(makefile-mode-name): Removed.
[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
54# --libdir option to `../configure'.
b93f2493 55libdir=@libdir@
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
eb4252f7 64# ==================== Emacs-specific directories ====================
c71beb75 65
eb4252f7
RS
66# These variables hold the values Emacs will actually use. They are
67# based on the values of the standard Make variables above.
c71beb75 68
eb4252f7
RS
69# Where to put executables to be run by Emacs rather than the user.
70# This path usually includes the Emacs version and configuration name,
71# so that multiple configurations for multiple versions of Emacs may
72# be installed at once. This can be set with the --archlibdir option
73# to `../configure'.
b93f2493 74archlibdir=@archlibdir@
41f86d5a 75
eb4252f7 76# ==================== Utility Programs for the Build =================
c71beb75 77
eb4252f7 78# ../configure figures out the correct values for these.
b93f2493 79INSTALL = @INSTALL@
b93f2493
BF
80INSTALL_PROGRAM = @INSTALL_PROGRAM@
81INSTALL_DATA = @INSTALL_DATA@
c71beb75 82
eb4252f7 83# ========================== Lists of Files ===========================
f7dbcf3c 84
eb4252f7
RS
85# Things that a user might actually run,
86# which should be installed in bindir.
0d73e8e3
JB
87INSTALLABLES = etags ctags emacsclient b2m
88INSTALLABLE_SCRIPTS = rcs-checkin
f7dbcf3c 89
eb4252f7
RS
90# Things that Emacs runs internally, or during the build process,
91# which should not be installed in bindir.
5aae6601 92UTILITIES= wakeup profile digest-doc \
62039e5a 93 sorted-doc movemail cvtmail fakemail yow emacsserver hexl timer
f7dbcf3c 94
5aae6601
RS
95DONT_INSTALL= test-distrib make-docfile make-path
96
eb4252f7
RS
97# Like UTILITIES, but they're not system-dependent, and should not be
98# deleted by the distclean target.
b7cceaf1
JB
99SCRIPTS= rcs2log vcdiff
100
0d73e8e3 101EXECUTABLES= ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS}
f7dbcf3c 102
41f86d5a
ER
103SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
104 makedoc.com *.[chy] rcs2log vcdiff
105
81f94052
RS
106# Additional -D flags for movemail (add to MOVE_FLAGS if desired):
107# MAIL_USE_POP Support mail retrieval from a POP mailbox.
108# MAIL_USE_MMDF Support MMDF mailboxes.
109# MAIL_USE_FLOCK Use flock for file locking (see the comments
110# about locking in movemail.c)
111# MAIL_UNLINK_SPOOL Unlink the user's spool mailbox after reading
112# it (instead of just emptying it).
113# KERBEROS Support Kerberized POP.
114# KRB5 Support Kerberos Version 5 pop instead of
115# Version 4 (define this in addition to
116# KERBEROS).
117# HESIOD Support Hesiod lookups of user mailboxes.
118# MAILHOST A string, the host name of the default POP
119# mail host for the site.
120MOVE_FLAGS=
121
122# Additional libraries for movemail:
123# For KERBEROS
124# MOVE_LIBS= -lkrb -ldes -lcom_err
125# For KERBEROS + KRB5
126# MOVE_LIBS= -lkrb5 -lcrypto -lisode -lcom_err
127# Add "-lhesiod" if HESIOD is defined.
128MOVE_LIBS=
129
eb4252f7
RS
130# ========================== start of cpp stuff =======================
131/* From here on, comments must be done in C syntax. */
132
133#define NO_SHORTNAMES
134#define THIS_IS_YMAKEFILE
135#define NOT_C_CODE
136#include "../src/config.h"
137
89b3f894
RS
138/* We won't really call alloca;
139 don't let the file name alloca.c get messed up. */
140#ifdef alloca
141#undef alloca
142#endif
143
eb4252f7
RS
144/* Some s/*.h files define this to request special libraries. */
145#ifndef LIBS_SYSTEM
146#define LIBS_SYSTEM
147#endif
148
149/* Some m/*.h files define this to request special libraries. */
150#ifndef LIBS_MACHINE
151#define LIBS_MACHINE
152#endif
153
154#ifndef C_SWITCH_SYSTEM
155#define C_SWITCH_SYSTEM
156#endif
157
158#ifndef C_SWITCH_MACHINE
159#define C_SWITCH_MACHINE
160#endif
161
162#undef MOVEMAIL_NEEDS_BLESSING
163#ifndef MAIL_USE_FLOCK
164#ifndef MAIL_USE_LOCKF
165#define MOVEMAIL_NEEDS_BLESSING
166#endif
167#endif
168
169#ifdef MOVEMAIL_NEEDS_BLESSING
170#define BLESSMAIL blessmail
171#else
172#define BLESSMAIL
173#endif
174
175LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
176
29ed0542
RS
177/* We need to #define emacs to get the right versions of some files.
178 Some other files - those shared with other GNU utilities - need
179 HAVE_CONFIG_H #defined before they know they can take advantage of
180 the information in ../src/config.h. */
82a635f3 181ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
3e883207 182 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
82a635f3 183LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
3e883207 184 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
82a635f3 185CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
b2d7a9c7 186 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
20cda85b
RS
187ALLOCA_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
188 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
29ed0542
RS
189\f
190/* This is the default compilation command.
191 But we should never rely on it, because some make version
192 failed to find it for getopt.o.
193 Using an explicit command made it work. */
c38a040d 194.c.o:
5293b432 195 ${CC} -c ${CPP_CFLAGS} $<
c71beb75 196
4eda59a9 197all: ${UTILITIES} ${INSTALLABLES}
c71beb75 198
c6207d0d 199#ifdef MOVEMAIL_NEEDS_BLESSING
f675ecb5 200blessmail:
2b243866 201 ../src/emacs -batch -l ../lisp/blessmail.el
c6207d0d
KH
202 chmod +x blessmail
203#endif
204
d19f95fe
RS
205maybe-blessmail: BLESSMAIL
206#ifdef MOVEMAIL_NEEDS_BLESSING
207/* Don't charge ahead and do it! Let the installer decide.
208 ./blessmail ${archlibdir}/movemail */
209 @if [ `wc -l <blessmail` != 2 ] ; then \
210 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
211 echo Assuming $$dir is really the mail spool directory, you should; \
fed76e78 212 echo run lib-src/blessmail ${archlibdir}/movemail; \
d19f95fe 213 echo as root, to give movemail appropriate permissions.; \
eb4252f7 214 echo Do that after running make install.; \
d19f95fe
RS
215 fi
216#endif
217
29ed0542
RS
218/* Install the internal utilities. Until they are installed, we can
219 just run them directly from lib-src. */
d19f95fe 220${archlibdir}: all
c71beb75
JB
221 @echo
222 @echo "Installing utilities run internally by Emacs."
223 ./make-path ${archlibdir}
f7d3e7d0 224 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
544d556f 225 for file in ${UTILITIES}; do \
4ef7b413 226 (cd ..; $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \
544d556f 227 done ; \
ad600343
RS
228 fi
229 if [ `(cd ${archlibdir} && /bin/pwd)` \
230 != `(cd ${srcdir} && /bin/pwd)` ]; then \
544d556f 231 for file in ${SCRIPTS}; do \
4ef7b413 232 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \
c71beb75 233 done ; \
0268f19b 234 fi
f7dbcf3c 235
29ed0542
RS
236/* We don't need to install `wakeup' explicitly, because it will be
237 copied when this whole directory is copied. */
c71beb75
JB
238install: ${archlibdir}
239 @echo
240 @echo "Installing utilities for users to run."
b70cff71 241 for file in ${INSTALLABLES} ; do \
4ef7b413 242 (cd ..; $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
0268f19b 243 done
b70cff71 244 for file in ${INSTALLABLE_SCRIPTS} ; do \
4ef7b413 245 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
0268f19b 246 done
f7dbcf3c 247
39b649dd
JB
248uninstall:
249 (cd ${bindir}; \
250 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
251 (cd ${archlibdir}; \
252 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
253
a17d2c25
RS
254mostlyclean:
255 -rm -f core *.o
256
257clean: mostlyclean
5aae6601 258 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
f7dbcf3c 259
39b649dd
JB
260distclean: clean
261 -rm -f ../etc/DOC* *.tab.c *.tab.h aixcc.c TAGS
348c8c1b 262 -rm -f Makefile Makefile.in blessmail
f7dbcf3c
JB
263
264realclean: distclean
39b649dd 265 true
c71beb75
JB
266
267extraclean: realclean
268 -rm -f *~ \#*
f7dbcf3c 269
41f86d5a
ER
270unlock:
271 chmod u+w $(SOURCES)
272
273relock:
274 chmod u-w $(SOURCES)
275
29ed0542 276/* Test the contents of the directory. */
f7dbcf3c
JB
277check:
278 @echo "We don't have any tests for GNU Emacs yet."
279
280TAGS: etags
281 etags *.[ch]
282
29ed0542
RS
283/* This verifies that the non-ASCII characters in the file `testfile'
284 have not been clobbered by whatever means were used to copy and
285 distribute Emacs. If they were clobbered, all the .elc files were
286 clobbered too. */
0d73e8e3 287test-distrib: ${srcdir}/test-distrib.c
c88a7f88 288 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
0d73e8e3 289 ./test-distrib ${srcdir}/testfile
f7dbcf3c 290
c38a040d 291GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
0d73e8e3 292GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
b90589d8 293getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
0268f19b 294 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
b90589d8 295getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
0268f19b 296 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
20cda85b
RS
297alloca.o: ${srcdir}/alloca.c
298 ${CC} -c ${ALLOCA_CFLAGS} ${srcdir}/alloca.c
f7dbcf3c 299
755f5c87 300etags: ${srcdir}/etags.c $(GETOPTDEPS) ../src/config.h
9076a6fc 301 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o etags
f7dbcf3c 302
29ed0542
RS
303/* We depend on etags to assure that parallel makes don't write two
304 etags.o files on top of each other. */
4348b379 305ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags
9076a6fc 306 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
f7dbcf3c 307
0d73e8e3 308wakeup: ${srcdir}/wakeup.c
3e883207 309 $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
f7dbcf3c 310
379fb9c8
RS
311profile: ${srcdir}/profile.c
312 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
313
0d73e8e3 314make-docfile: ${srcdir}/make-docfile.c
3e883207 315 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
f7dbcf3c 316
0d73e8e3 317digest-doc: ${srcdir}/digest-doc.c
3e883207 318 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
f7dbcf3c 319
1e3255d8 320sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
3e883207 321 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
f7dbcf3c 322
0d73e8e3 323b2m: ${srcdir}/b2m.c ../src/config.h
3e883207 324 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
f7dbcf3c 325
81f94052
RS
326movemail: movemail.o pop.o
327 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(LOADLIBES) $(MOVE_LIBS) -o movemail
328
329movemail.o: ${srcdir}/movemail.c ../src/config.h
330 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c
331
332pop.o: ${srcdir}/pop.c
333 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
f7dbcf3c 334
0d73e8e3 335cvtmail: ${srcdir}/cvtmail.c
3e883207 336 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
f7dbcf3c 337
0d73e8e3 338fakemail: ${srcdir}/fakemail.c ../src/config.h
3e883207 339 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
f7dbcf3c 340
0d73e8e3 341yow: ${srcdir}/yow.c ../src/paths.h
3e883207 342 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
f7dbcf3c 343
0d73e8e3 344emacsserver: ${srcdir}/emacsserver.c ../src/config.h
3e883207 345 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
f7dbcf3c 346
0d73e8e3 347emacsclient: ${srcdir}/emacsclient.c ../src/config.h
3e883207 348 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
f7dbcf3c 349
0d73e8e3 350hexl: ${srcdir}/hexl.c
3e883207 351 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
f7dbcf3c 352
9ff5de07 353TIMEROBJS=getdate.o timer.o $(ALLOCA)
0d73e8e3
JB
354getdate.o: ${srcdir}/getdate.y ../src/config.h
355 ${YACC} ${YFLAGS} ${srcdir}/getdate.y
eab5f4fd 356 $(CC) $(CPP_CFLAGS) -c y.tab.c
43bf8b0e 357 mv y.tab.o getdate.o
0d73e8e3 358timer.o: ${srcdir}/timer.c ../src/config.h
eab5f4fd 359 $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
9ff5de07 360timer: ${TIMEROBJS}
3e883207 361 $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
f7dbcf3c 362
a0697435 363make-path: ${srcdir}/make-path.c ../src/config.h
3e883207 364 $(CC) $(ALL_CFLAGS) ${srcdir}/make-path.c -o make-path
ecc798b0 365
29ed0542 366/* These are NOT included in INSTALLABLES or UTILITIES.
1858a206 367 See ../src/Makefile.in.in. */
0d73e8e3 368emacstool: ${srcdir}/emacstool.c
3e883207 369 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
f7dbcf3c
JB
370 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
371
29ed0542 372/* For SUN Japanese Language Environment. */
0d73e8e3 373nemacstool: ${srcdir}/emacstool.c
3e883207 374 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
f7dbcf3c
JB
375 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
376
0d73e8e3 377xvetool: ${srcdir}/emacstool.c
3e883207 378 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
f7dbcf3c
JB
379 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
380 $(LOADLIBES)
381
0d73e8e3 382xveterm: ${srcdir}/emacstool.c
3e883207 383 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
f7dbcf3c
JB
384 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
385 $(LOADLIBES)
386
0d73e8e3 387aixcc: ${srcdir}/aixcc.c
3e883207 388 $(CC) $(ALL_CFLAGS) -o aixcc ${srcdir}/aixcc.c
f7dbcf3c 389
0d73e8e3
JB
390aixcc.c: ${srcdir}/aixcc.lex
391 lex ${srcdir}/aixcc.lex
f7dbcf3c 392 mv lex.yy.c aixcc.c