Don't include param.h.
[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
41f86d5a
ER
106SOURCES = COPYING ChangeLog Makefile.in README aixcc.lex emacs.csh \
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
137#define THIS_IS_YMAKEFILE
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
eb4252f7
RS
147/* Some s/*.h files define this to request special libraries. */
148#ifndef LIBS_SYSTEM
149#define LIBS_SYSTEM
150#endif
151
152/* Some m/*.h files define this to request special libraries. */
153#ifndef LIBS_MACHINE
154#define LIBS_MACHINE
155#endif
156
157#ifndef C_SWITCH_SYSTEM
158#define C_SWITCH_SYSTEM
159#endif
160
161#ifndef C_SWITCH_MACHINE
162#define C_SWITCH_MACHINE
163#endif
164
165#undef MOVEMAIL_NEEDS_BLESSING
166#ifndef MAIL_USE_FLOCK
167#ifndef MAIL_USE_LOCKF
168#define MOVEMAIL_NEEDS_BLESSING
169#endif
170#endif
171
172#ifdef MOVEMAIL_NEEDS_BLESSING
173#define BLESSMAIL blessmail
174#else
175#define BLESSMAIL
176#endif
177
178LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
179
29ed0542
RS
180/* We need to #define emacs to get the right versions of some files.
181 Some other files - those shared with other GNU utilities - need
182 HAVE_CONFIG_H #defined before they know they can take advantage of
183 the information in ../src/config.h. */
82a635f3 184ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
3e883207 185 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
82a635f3 186LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
3e883207 187 -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
82a635f3 188CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -Demacs -DHAVE_CONFIG_H \
b2d7a9c7 189 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
20cda85b
RS
190ALLOCA_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
191 -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
29ed0542
RS
192\f
193/* This is the default compilation command.
194 But we should never rely on it, because some make version
195 failed to find it for getopt.o.
196 Using an explicit command made it work. */
c38a040d 197.c.o:
5293b432 198 ${CC} -c ${CPP_CFLAGS} $<
c71beb75 199
4eda59a9 200all: ${UTILITIES} ${INSTALLABLES}
c71beb75 201
c6207d0d 202#ifdef MOVEMAIL_NEEDS_BLESSING
f675ecb5 203blessmail:
2b243866 204 ../src/emacs -batch -l ../lisp/blessmail.el
c6207d0d
KH
205 chmod +x blessmail
206#endif
207
d19f95fe
RS
208maybe-blessmail: BLESSMAIL
209#ifdef MOVEMAIL_NEEDS_BLESSING
210/* Don't charge ahead and do it! Let the installer decide.
211 ./blessmail ${archlibdir}/movemail */
212 @if [ `wc -l <blessmail` != 2 ] ; then \
213 dir=`sed -n -e 's/echo mail directory = \(.*\)/\1/p' blessmail`; \
214 echo Assuming $$dir is really the mail spool directory, you should; \
fed76e78 215 echo run lib-src/blessmail ${archlibdir}/movemail; \
d19f95fe 216 echo as root, to give movemail appropriate permissions.; \
eb4252f7 217 echo Do that after running make install.; \
d19f95fe
RS
218 fi
219#endif
220
29ed0542
RS
221/* Install the internal utilities. Until they are installed, we can
222 just run them directly from lib-src. */
d19f95fe 223${archlibdir}: all
c71beb75
JB
224 @echo
225 @echo "Installing utilities run internally by Emacs."
2d521ee6 226 $(top_srcdir)/mkinstalldirs ${archlibdir}
f7d3e7d0 227 if [ `(cd ${archlibdir} && /bin/pwd)` != `/bin/pwd` ]; then \
544d556f 228 for file in ${UTILITIES}; do \
4ef7b413 229 (cd ..; $(INSTALL_PROGRAM) lib-src/$$file ${archlibdir}/$$file) ; \
544d556f 230 done ; \
ad600343
RS
231 fi
232 if [ `(cd ${archlibdir} && /bin/pwd)` \
233 != `(cd ${srcdir} && /bin/pwd)` ]; then \
544d556f 234 for file in ${SCRIPTS}; do \
4ef7b413 235 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$$file ${archlibdir}/$$file); \
c71beb75 236 done ; \
0268f19b 237 fi
f7dbcf3c 238
29ed0542
RS
239/* We don't need to install `wakeup' explicitly, because it will be
240 copied when this whole directory is copied. */
c71beb75
JB
241install: ${archlibdir}
242 @echo
243 @echo "Installing utilities for users to run."
b70cff71 244 for file in ${INSTALLABLES} ; do \
4ef7b413 245 (cd ..; $(INSTALL_PROGRAM) lib-src/$${file} ${bindir}/$${file}) ; \
0268f19b 246 done
b70cff71 247 for file in ${INSTALLABLE_SCRIPTS} ; do \
4ef7b413 248 (cd ..; $(INSTALL_PROGRAM) ${srcdir}/$${file} ${bindir}/$${file}) ; \
0268f19b 249 done
f7dbcf3c 250
39b649dd
JB
251uninstall:
252 (cd ${bindir}; \
253 rm -f ${INSTALLABLES} ${INSTALLABLE_SCRIPTS})
254 (cd ${archlibdir}; \
255 rm -f ${UTILITIES} ${INSTALLABLES} ${SCRIPTS} ${INSTALLABLE_SCRIPTS})
256
a17d2c25
RS
257mostlyclean:
258 -rm -f core *.o
259
260clean: mostlyclean
5aae6601 261 -rm -f ${INSTALLABLES} ${UTILITIES} ${DONT_INSTALL}
1e8259bb 262 -rm -f ../etc/DOC* *.tab.c *.tab.h
f7dbcf3c 263
39b649dd 264distclean: clean
1e8259bb 265 -rm -f aixcc.c TAGS
348c8c1b 266 -rm -f Makefile Makefile.in blessmail
f7dbcf3c
JB
267
268realclean: distclean
39b649dd 269 true
c71beb75
JB
270
271extraclean: realclean
272 -rm -f *~ \#*
f7dbcf3c 273
41f86d5a
ER
274unlock:
275 chmod u+w $(SOURCES)
276
277relock:
278 chmod u-w $(SOURCES)
279
29ed0542 280/* Test the contents of the directory. */
f7dbcf3c
JB
281check:
282 @echo "We don't have any tests for GNU Emacs yet."
283
284TAGS: etags
285 etags *.[ch]
286
29ed0542
RS
287/* This verifies that the non-ASCII characters in the file `testfile'
288 have not been clobbered by whatever means were used to copy and
289 distribute Emacs. If they were clobbered, all the .elc files were
290 clobbered too. */
0d73e8e3 291test-distrib: ${srcdir}/test-distrib.c
c88a7f88 292 $(CC) ${ALL_CFLAGS} -o test-distrib ${srcdir}/test-distrib.c
0d73e8e3 293 ./test-distrib ${srcdir}/testfile
f7dbcf3c 294
c38a040d 295GETOPTOBJS = getopt.o getopt1.o $(ALLOCA)
0d73e8e3 296GETOPTDEPS = $(GETOPTOBJS) ${srcdir}/getopt.h
b90589d8 297getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
0268f19b 298 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt.c
b90589d8 299getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
0268f19b 300 ${CC} -c ${CPP_CFLAGS} ${srcdir}/getopt1.c
20cda85b
RS
301alloca.o: ${srcdir}/alloca.c
302 ${CC} -c ${ALLOCA_CFLAGS} ${srcdir}/alloca.c
f7dbcf3c 303
66ab94d9
KH
304REGEXPOBJ = regex.o
305REGEXPDEPS = $(REGEXPOBJ) ../src/regex.h
306regex.o: ../src/regex.c ../src/regex.h
3412f303 307 ${CC} -c ${CPP_CFLAGS} -Uemacs -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
66ab94d9
KH
308
309etags: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
310 $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" -DETAGS_REGEXPS ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
f7dbcf3c 311
29ed0542
RS
312/* We depend on etags to assure that parallel makes don't write two
313 etags.o files on top of each other. */
4348b379 314ctags: ${srcdir}/etags.c $(GETOPTDEPS) etags
9076a6fc 315 $(CC) ${ALL_CFLAGS} -DCTAGS -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(LOADLIBES) -o ctags
f7dbcf3c 316
0d73e8e3 317wakeup: ${srcdir}/wakeup.c
3e883207 318 $(CC) ${ALL_CFLAGS} ${srcdir}/wakeup.c $(LOADLIBES) -o wakeup
f7dbcf3c 319
379fb9c8
RS
320profile: ${srcdir}/profile.c
321 $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
322
0d73e8e3 323make-docfile: ${srcdir}/make-docfile.c
3e883207 324 $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
f7dbcf3c 325
0d73e8e3 326digest-doc: ${srcdir}/digest-doc.c
3e883207 327 $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
f7dbcf3c 328
1e3255d8 329sorted-doc: ${srcdir}/sorted-doc.c ${ALLOCA}
3e883207 330 $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c ${ALLOCA} $(LOADLIBES) -o sorted-doc
f7dbcf3c 331
0d73e8e3 332b2m: ${srcdir}/b2m.c ../src/config.h
3e883207 333 $(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m
f7dbcf3c 334
81f94052
RS
335movemail: movemail.o pop.o
336 $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(LOADLIBES) $(MOVE_LIBS) -o movemail
337
338movemail.o: ${srcdir}/movemail.c ../src/config.h
339 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c
340
341pop.o: ${srcdir}/pop.c
342 $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c
f7dbcf3c 343
0d73e8e3 344cvtmail: ${srcdir}/cvtmail.c
3e883207 345 $(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
f7dbcf3c 346
0d73e8e3 347fakemail: ${srcdir}/fakemail.c ../src/config.h
3e883207 348 $(CC) ${ALL_CFLAGS} ${srcdir}/fakemail.c $(LOADLIBES) -o fakemail
f7dbcf3c 349
0d73e8e3 350yow: ${srcdir}/yow.c ../src/paths.h
3e883207 351 $(CC) ${ALL_CFLAGS} ${srcdir}/yow.c $(LOADLIBES) -o yow
f7dbcf3c 352
0d73e8e3 353emacsserver: ${srcdir}/emacsserver.c ../src/config.h
3e883207 354 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsserver.c $(LOADLIBES) -o emacsserver
f7dbcf3c 355
0d73e8e3 356emacsclient: ${srcdir}/emacsclient.c ../src/config.h
3e883207 357 $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(LOADLIBES) -o emacsclient
f7dbcf3c 358
0d73e8e3 359hexl: ${srcdir}/hexl.c
3e883207 360 $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
f7dbcf3c 361
9ff5de07 362TIMEROBJS=getdate.o timer.o $(ALLOCA)
0d73e8e3
JB
363getdate.o: ${srcdir}/getdate.y ../src/config.h
364 ${YACC} ${YFLAGS} ${srcdir}/getdate.y
eab5f4fd 365 $(CC) $(CPP_CFLAGS) -c y.tab.c
43bf8b0e 366 mv y.tab.o getdate.o
0d73e8e3 367timer.o: ${srcdir}/timer.c ../src/config.h
eab5f4fd 368 $(CC) -c $(CPP_CFLAGS) ${srcdir}/timer.c
9ff5de07 369timer: ${TIMEROBJS}
3e883207 370 $(CC) $(LINK_CFLAGS) ${TIMEROBJS} $(LOADLIBES) -o timer
f7dbcf3c 371
29ed0542 372/* These are NOT included in INSTALLABLES or UTILITIES.
1858a206 373 See ../src/Makefile.in.in. */
0d73e8e3 374emacstool: ${srcdir}/emacstool.c
3e883207 375 $(CC) ${srcdir}/emacstool.c -o emacstool ${ALL_CFLAGS} \
f7dbcf3c
JB
376 -lsuntool -lsunwindow -lpixrect $(LOADLIBES)
377
29ed0542 378/* For SUN Japanese Language Environment. */
0d73e8e3 379nemacstool: ${srcdir}/emacstool.c
3e883207 380 $(CC) -o nemacstool -DJLE ${ALL_CFLAGS} ${srcdir}/emacstool.c \
f7dbcf3c
JB
381 -lsuntool -lmle -lsunwindow -lpixrect $(LOADLIBES)
382
0d73e8e3 383xvetool: ${srcdir}/emacstool.c
3e883207 384 $(CC) -o xvetool -DXVIEW ${ALL_CFLAGS} ${srcdir}/emacstool.c \
f7dbcf3c
JB
385 -lxview -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
386 $(LOADLIBES)
387
0d73e8e3 388xveterm: ${srcdir}/emacstool.c
3e883207 389 $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \
f7dbcf3c
JB
390 -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \
391 $(LOADLIBES)
392
0d73e8e3 393aixcc: ${srcdir}/aixcc.c
3e883207 394 $(CC) $(ALL_CFLAGS) -o aixcc ${srcdir}/aixcc.c
f7dbcf3c 395
0d73e8e3
JB
396aixcc.c: ${srcdir}/aixcc.lex
397 lex ${srcdir}/aixcc.lex
f7dbcf3c 398 mv lex.yy.c aixcc.c