(EmacsFrameSetCharSize): Once again preserve x and y pos,
[bpt/emacs.git] / src / Makefile.in
CommitLineData
b06f07c0
RS
1# Makefile for GNU Emacs.
2# Copyright (C) 1985, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
ec558adc 3
b06f07c0 4# This file is part of GNU Emacs.
ae3bed12 5
b06f07c0
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.
ae3bed12 10
b06f07c0
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.
ae3bed12 15
b06f07c0
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. */
ae3bed12 19
b06f07c0 20# Here are the things that we expect ../configure to edit.
ae3bed12
BF
21srcdir=@srcdir@
22VPATH=@srcdir@
23CC=@CC@
24CPP=@CPP@
25CFLAGS=@CFLAGS@
ae3bed12 26LN_S=@LN_S@
b06f07c0
RS
27# Substitute an assignment for the MAKE variable, because
28# BSD doesn't have it as a default.
3bdaa06a 29@SET_MAKE@
ae3bed12 30
b06f07c0 31# On Xenix and the IBM RS6000, double-dot gets screwed up.
ae3bed12
BF
32dot = .
33lispdir = ${srcdir}/$(dot)$(dot)/lisp/
34libsrc = $(dot)$(dot)/lib-src/
35etc = $(dot)$(dot)/etc/
36shortnamesdir = $(dot)$(dot)/shortnames/
37cppdir = $(dot)$(dot)/cpp/
38oldXMenudir = $(dot)$(dot)/oldXMenu/
3e285e4d 39lwlibdir = $(dot)$(dot)/lwlib/
2a3c6d11 40
b06f07c0 41# Configuration files for .o files to depend on.
2a3c6d11
RS
42M_FILE = ${srcdir}/@machfile@
43S_FILE = ${srcdir}/@opsysfile@
44config_h = config.h $(M_FILE) $(S_FILE)
ae3bed12 45
b06f07c0
RS
46# ========================== start of cpp stuff ======================= */
47/* From here on, comments must be done in C syntax. */
48
02e8e167
RS
49CPPFLAGS=
50LDFLAGS=
51C_SWITCH_SYSTEM=
52
ae3bed12
BF
53/* just to be sure the sh is used */
54SHELL=/bin/sh
55
56#define NO_SHORTNAMES
57#define THIS_IS_YMAKEFILE
58#define NOT_C_CODE
59#include "config.h"
60
61/* Use HAVE_X11 as an alias for X11 in this file
62 to avoid problems with X11 as a subdirectory name
63 in -I and other such options which pass through this file. */
64
65#ifdef X11
66#define HAVE_X11
67#undef X11
68#endif
69
70/* On some machines #define register is done in config;
71 don't let it interfere with this file. */
72#undef register
73
74/* On some systems we may not be able to use the system make command. */
75#ifdef MAKE_COMMAND
76MAKE = MAKE_COMMAND
ae3bed12
BF
77#endif
78
79#ifdef C_COMPILER
80CC = C_COMPILER
81#endif
82
83/* Some machines don't find the standard C libraries in the usual place. */
84#ifndef ORDINARY_LINK
85#ifndef LIB_STANDARD
86#define LIB_STANDARD -lc
87#endif
88#else
89#ifndef LIB_STANDARD
90#define LIB_STANDARD
91#endif
92#endif
93
94/* Unless inhibited or changed, use -lg to link for debugging. */
95#ifndef LIBS_DEBUG
96#define LIBS_DEBUG -lg
97#endif
98
99/* Some s/*.h files define this to request special libraries. */
100#ifndef LIBS_SYSTEM
101#define LIBS_SYSTEM
102#endif
103
104/* Some m/*.h files define this to request special libraries. */
105#ifndef LIBS_MACHINE
106#define LIBS_MACHINE
107#endif
108
109#ifndef LIB_MATH
110# ifdef LISP_FLOAT_TYPE
111# define LIB_MATH -lm
112# else /* ! defined (LISP_FLOAT_TYPE) */
113# define LIB_MATH
114# endif /* ! defined (LISP_FLOAT_TYPE) */
115#endif /* LIB_MATH */
116
117/* Some s/*.h files define this to request special switches in ld. */
118#ifndef LD_SWITCH_SYSTEM
119#if !defined (__GNUC__) && (defined(COFF_ENCAPSULATE) || (defined (BSD) && !defined (COFF)))
120#define LD_SWITCH_SYSTEM -X
121#else /* ! defined(COFF_ENCAPSULATE) || (defined (BSD) && !defined (COFF)) */
122#define LD_SWITCH_SYSTEM
123#endif /* ! defined(COFF_ENCAPSULATE) || (defined (BSD) && !defined (COFF)) */
124#endif /* LD_SWITCH_SYSTEM */
125
126/* Some m/*.h files define this to request special switches in ld. */
127#ifndef LD_SWITCH_MACHINE
128#define LD_SWITCH_MACHINE
129#endif
130
131/* Some m/*.h files define this to request special switches in cc. */
132#ifndef C_SWITCH_MACHINE
133#define C_SWITCH_MACHINE
134#endif
135
136/* Some s/*.h files define this to request special switches in cc. */
137#ifndef C_SWITCH_SYSTEM
138#define C_SWITCH_SYSTEM
139#endif
140
141/* These macros are for switches specifically related to X Windows. */
142#ifndef C_SWITCH_X_MACHINE
143#define C_SWITCH_X_MACHINE
144#endif
145
146#ifndef C_SWITCH_X_SYSTEM
147#define C_SWITCH_X_SYSTEM
148#endif
149
150#ifndef C_SWITCH_X_SITE
151#define C_SWITCH_X_SITE
152#endif
153
154#ifndef LD_SWITCH_X_SITE
155#define LD_SWITCH_X_SITE
156#endif
157
158/* These can be passed in from config.h to define special load and
159 compile switches needed by individual sites */
160#ifndef LD_SWITCH_SITE
161#define LD_SWITCH_SITE
162#endif
163
164#ifndef C_SWITCH_SITE
165#define C_SWITCH_SITE
166#endif
167
168#ifndef ORDINARY_LINK
9e012fc3 169
ae3bed12
BF
170#ifndef CRT0_COMPILE
171#define CRT0_COMPILE $(CC) -c $(ALL_CFLAGS) C_SWITCH_ASM
172#endif
173
174#ifndef START_FILES
175#ifdef NO_REMAP
176#ifdef COFF_ENCAPSULATE
177#define START_FILES pre-crt0.o /usr/local/lib/gcc-crt0.o
178#else /* ! defined (COFF_ENCAPSULATE) */
179#define START_FILES pre-crt0.o /lib/crt0.o
180#endif /* ! defined (COFF_ENCAPSULATE) */
181#else /* ! defined (NO_REMAP) */
182#define START_FILES crt0.o
183#endif /* ! defined (NO_REMAP) */
184#endif /* START_FILES */
185STARTFILES = START_FILES
186
187#else /* ORDINARY_LINK */
188
189/* config.h might want to force START_FILES anyway */
190#ifdef START_FILES
191STARTFILES = START_FILES
192#endif /* START_FILES */
193
194#endif /* not ORDINARY_LINK */
195
196
197/* cc switches needed to make `asm' keyword work.
198 Nothing special needed on most machines. */
199#ifndef C_SWITCH_ASM
200#define C_SWITCH_ASM
201#endif
202
203/* Figure out whether the system cpp can handle long names.
204 Do it by testing it right now.
205 If it loses, arrange to use the GNU cpp. */
206
207#define LONGNAMEBBBFOOX
208#ifdef LONGNAMEBBBARFOOX
209/* Installed cpp fails to distinguish those names! */
210/* Arrange to compile the GNU cpp later on */
211#define NEED_CPP
212/* Cause cc to invoke the cpp that comes with Emacs,
213 which will be in a file named localcpp. */
214MYCPPFLAG= -Blocal
215/* LOCALCPP is the local one or nothing.
216 CPP is the local one or the standardone. */
217LOCALCPP= localcpp
218#endif /* ! defined (LONGNAMEBBBARFOOX) */
219
220#ifdef SHORTNAMES
221SHORT= shortnames
222#endif
223
224/* DO NOT use -R. There is a special hack described in lastfile.c
225 which is used instead. Some initialized data areas are modified
226 at initial startup, then labeled as part of the text area when
227 Emacs is dumped for the first time, and never changed again. */
228
ae3bed12
BF
229/* -Demacs is needed to make some files produce the correct version
230 for use in Emacs.
231
232 -DHAVE_CONFIG_H is needed for some other files to take advantage of
233 the information in `config.h'. */
644ab589 234
ae3bed12
BF
235/* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM
236 since it may have -I options that should override those two. */
4b431fb7 237ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAG) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_SITE C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM ${CFLAGS}
ae3bed12
BF
238.c.o:
239 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
240
241#ifndef LIBX10_MACHINE
242#define LIBX10_MACHINE
243#endif
244
245#ifndef LIBX11_MACHINE
246#define LIBX11_MACHINE
247#endif
248
249#ifndef LIBX10_SYSTEM
250#define LIBX10_SYSTEM
251#endif
252
253#ifndef LIBX11_SYSTEM
254#define LIBX11_SYSTEM
255#endif
256
257#ifndef LIB_X11_LIB
258#define LIB_X11_LIB -lX11
259#endif
260
261#ifdef HAVE_X_WINDOWS
262#ifdef HAVE_X_MENU
263
264/* Include xmenu.o in the list of X object files. */
265XOBJ= xterm.o xfns.o xfaces.o xmenu.o xselect.o xrdb.o
266
267/* The X Menu stuff is present in the X10 distribution, but missing
268 from X11. If we have X10, just use the installed library;
269 otherwise, use our own copy. */
270#ifdef HAVE_X11
3e285e4d
RS
271#ifdef USE_X_TOOLKIT
272OLDXMENU=liblw.a
273LIBXMENU= $(OLDXMENU)
274#else /* not USE_X_TOOLKIT */
ae3bed12
BF
275OLDXMENU= libXMenu11.a
276LIBXMENU= $(OLDXMENU)
3e285e4d
RS
277#endif /* not USE_X_TOOLKIT */
278#else /* not HAVE_X11 */
ae3bed12 279LIBXMENU= -lXMenu
3e285e4d 280#endif /* not HAVE_X11 */
ae3bed12 281
3e285e4d 282#else /* not HAVE_X_MENU */
ae3bed12
BF
283
284/* Otherwise, omit xmenu.o from the list of X object files, and
285 don't worry about the menu library at all. */
286XOBJ= xterm.o xfns.o xfaces.o xselect.o xrdb.o
287LIBXMENU=
3e285e4d
RS
288#endif /* not HAVE_X_MENU */
289
290#ifdef USE_X_TOOLKIT
b1fc21c5
RS
291#define @X_TOOLKIT_TYPE@
292#if defined (LUCID) || defined (ATHENA)
293LIBW= -lXaw
294#endif
295#ifdef MOTIF
296#ifdef LIB_MOTIF
297LIBW= LIB_MOTIF
298#else
299LIBW= -lXm
300#endif
301#endif
302#ifdef OPEN_LOOK
303LIBW= -lXol
304#endif
305
b036baef 306#ifdef HAVE_X11XTR6
8b550e92
RS
307LIBXTR6 = -lSM -lICE
308#endif
309
310LIBXT= $(LIBW) -lXt $(LIBXTR6) -lXmu -lXext
3e285e4d
RS
311#else
312LIBXT=
313#endif
ae3bed12
BF
314
315#ifdef HAVE_X11
5aff8acb 316LIBX= $(LIBXMENU) LD_SWITCH_X_SITE $(LIBXT) LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
3e285e4d 317#else /* not HAVE_X11 */
ae3bed12 318LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10 LIBX10_MACHINE LIBX10_SYSTEM
3e285e4d
RS
319#endif /* not HAVE_X11 */
320#endif /* not HAVE_X_WINDOWS */
ae3bed12
BF
321
322#ifndef ORDINARY_LINK
323/* Fix linking if compiled with GCC. */
324#ifdef __GNUC__
325
326#if __GNUC__ > 1
327
ab8fbbf7
RS
328#ifdef LINKER
329#define LINKER_WAS_SPECIFIED
330#endif
331
ae3bed12
BF
332/* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
333 places that are difficult to figure out at make time. Fortunately,
334 these same versions allow you to pass arbitrary flags on to the
335 linker, so there's no reason not to use it as a linker.
336
337 Well, it's not quite perfect. The `-nostdlib' keeps GCC from
338 searching for libraries in its internal directories, so we have to
339 ask GCC explicitly where to find libgcc.a. */
9e012fc3 340
ae3bed12
BF
341#ifndef LINKER
342#define LINKER $(CC) -nostdlib
343#endif
0c22fbca 344
ae3bed12
BF
345#ifndef LIB_GCC
346/* Ask GCC where to find libgcc.a. */
347#define LIB_GCC `$(CC) -print-libgcc-file-name`
3e285e4d 348#endif /* not LIB_GCC */
c8ff0e1b 349
ae3bed12 350GNULIB_VAR = LIB_GCC
5627d72e 351
ab8fbbf7 352#ifndef LINKER_WAS_SPECIFIED
ae3bed12
BF
353/* GCC passes any argument prefixed with -Xlinker directly to the
354 linker. See prefix-args.c for an explanation of why we don't do
355 this with the shell's `for' construct.
356 Note that some people don't have '.' in their paths, so we must
357 use ./prefix-args. */
358#define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
ab8fbbf7
RS
359#else
360#define YMF_PASS_LDFLAGS(flags) flags
361#endif
9e012fc3 362
ae3bed12 363#else /* __GNUC__ < 2 */
c8ff0e1b 364
ae3bed12
BF
365#ifndef LIB_GCC
366#define LIB_GCC /usr/local/lib/gcc-gnulib
3e285e4d 367#endif /* not LIB_GCC */
ae3bed12
BF
368GNULIB_VAR = `if [ -f LIB_GCC ] ; then echo LIB_GCC; else echo; fi`
369#endif /* __GNUC__ < 2 */
3e285e4d 370#else /* not __GNUC__ */
ae3bed12 371GNULIB_VAR =
c8ff0e1b 372
3e285e4d 373#endif /* not __GNUC__ */
ae3bed12
BF
374#endif /* not ORDINARY_LINK */
375
376/* Specify address for ld to start loading at,
377 if requested by configuration. */
378#ifdef LD_TEXT_START_ADDR
379STARTFLAGS = -T LD_TEXT_START_ADDR -e __start
380#endif
381
382#ifdef ORDINARY_LINK
383LD = $(CC)
384#else
385#ifdef COFF_ENCAPSULATE
386LD=$(CC) -nostdlib
387#else /* not ORDINARY_LINK */
388#ifdef LINKER
389LD=LINKER
3e285e4d 390#else /* not LINKER */
ae3bed12 391LD=ld
3e285e4d
RS
392#endif /* not LINKER */
393#endif /* not COFF_ENCAPSULATE */
ae3bed12
BF
394#endif /* not ORDINARY_LINK */
395
b46498ae 396ALL_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_MACHINE LD_SWITCH_SITE $(LDFLAGS)
ae3bed12
BF
397
398/* A macro which other sections of ymakefile can redefine to munge the
399 flags before they're passed to LD. This is helpful if you have
400 redefined LD to something odd, like "gcc". */
401#ifndef YMF_PASS_LDFLAGS
402#define YMF_PASS_LDFLAGS(flags) flags
403#endif
404
405/* Allow config.h to specify a replacement file for unexec.c. */
406#ifndef UNEXEC
407#define UNEXEC unexec.o
408#endif
409#ifndef UNEXEC_SRC
410#define UNEXEC_SRC unexec.c
411#endif
412
413#ifdef USE_TEXT_PROPERTIES
414#define INTERVAL_SRC intervals.h
415#define INTERVAL_OBJ intervals.o textprop.o
416#else
417#define INTERVAL_SRC
418#define INTERVAL_OBJ
419#endif
420
421#ifdef HAVE_GETLOADAVG
422#define GETLOADAVG_OBJ
423#else
424#define GETLOADAVG_OBJ getloadavg.o
425#endif
426
427/* lastfile must follow all files
428 whose initialized data areas should be dumped as pure by dump-emacs. */
429obj= dispnew.o frame.o scroll.o xdisp.o window.o \
430 term.o cm.o $(XOBJ) \
431 emacs.o keyboard.o macros.o keymap.o sysdep.o \
432 buffer.o filelock.o insdel.o marker.o INTERVAL_OBJ \
433 minibuf.o fileio.o dired.o filemode.o \
434 cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
435 alloc.o data.o doc.o editfns.o callint.o \
436 eval.o floatfns.o fns.o print.o lread.o \
437 abbrev.o syntax.o UNEXEC mocklisp.o bytecode.o \
438 process.o callproc.o \
439 doprnt.o GETLOADAVG_OBJ
440
229c1c6a
RS
441/* Object files used on some machine or other.
442 These go in the DOC file on all machines
443 in case they are needed there. */
444SOME_MACHINE_OBJECTS = sunfns.o
445
ae3bed12
BF
446#ifdef TERMINFO
447/* Used to be -ltermcap here. If your machine needs that,
448 define LIBS_TERMCAP in the m/*.h file. */
449#ifndef LIBS_TERMCAP
450#define LIBS_TERMCAP -lcurses
451#endif /* LIBS_TERMCAP */
452termcapobj = terminfo.o
453#else /* ! defined (TERMINFO) */
454#ifndef LIBS_TERMCAP
455#define LIBS_TERMCAP
456termcapobj = termcap.o tparam.o
457#else /* LIBS_TERMCAP */
458termcapobj = tparam.o
459#endif /* LIBS_TERMCAP */
460#endif /* ! defined (TERMINFO) */
461
462
463#ifndef SYSTEM_MALLOC
464
465#ifdef GNU_MALLOC /* New GNU malloc */
466#ifdef REL_ALLOC
467mallocobj = gmalloc.o ralloc.o vm-limit.o
468#else /* ! defined (REL_ALLOC) */
469mallocobj = gmalloc.o vm-limit.o
470#endif /* ! defined (REL_ALLOC) */
471#else /* Old GNU malloc */
472mallocobj = malloc.o
473#endif /* Old GNU malloc */
474
475#endif /* SYSTEM_MALLOC */
476
477
478#ifndef HAVE_ALLOCA
479allocaobj = alloca.o
480#else
481allocaobj =
482#endif
483
3e285e4d
RS
484#ifdef USE_X_TOOLKIT
485widgetobj= widget.o
486#else /* not USE_X_TOOLKIT */
487widgetobj=
488#endif /* not USE_X_TOOLKIT */
489
ae3bed12
BF
490
491/* define otherobj as list of object files that make-docfile
492 should not be told about. */
3e285e4d 493otherobj= $(termcapobj) lastfile.o $(mallocobj) $(allocaobj) $(widgetobj)
ae3bed12
BF
494
495#ifdef LISP_FLOAT_TYPE
496#define FLOAT_SUPPORT ${lispdir}float-sup.elc
497#else
498#define FLOAT_SUPPORT
499#endif
500
501#ifdef MULTI_FRAME
502#define FRAME_SUPPORT ${lispdir}frame.elc ${lispdir}mouse.elc ${lispdir}select.elc ${lispdir}scroll-bar.elc
503#else
504#define FRAME_SUPPORT
505#endif
506
2f1b0bbd 507#ifdef HAVE_X_WINDOWS
f32b54d4 508#define X_WINDOWS_SUPPORT
2f1b0bbd
RM
509#else
510#define X_WINDOWS_SUPPORT
511#endif
512
ae3bed12
BF
513#ifdef VMS
514#define VMS_SUPPORT ${lispdir}vmsproc.elc ${lispdir}vms-patch
515#else
516#define VMS_SUPPORT
517#endif
518
519/* List of Lisp files loaded into the dumped Emacs. It's arranged
520 like this because it's easier to generate it semi-mechanically from
521 loadup.el this way.
522
523 Note that this list should not include lisp files which might not
524 be present, like site-load.el and site-init.el; this makefile
2f1b0bbd 525 expects them all to be either present or buildable. */
ae3bed12
BF
526lisp= \
527 ${lispdir}abbrev.elc \
528 ${lispdir}buff-menu.elc \
529 ${lispdir}byte-run.elc \
530 ${lispdir}c-mode.elc \
531 ${lispdir}files.elc \
532 ${lispdir}fill.elc \
533 FLOAT_SUPPORT \
534 FRAME_SUPPORT \
2f1b0bbd 535 X_WINDOWS_SUPPORT \
ae3bed12
BF
536 ${lispdir}help.elc \
537 ${lispdir}indent.elc \
538 ${lispdir}isearch.elc \
539 ${lispdir}lisp-mode.elc \
540 ${lispdir}lisp.elc \
541 ${lispdir}loaddefs.el \
542 ${lispdir}map-ynp.elc \
543 ${lispdir}page.elc \
544 ${lispdir}paragraphs.elc \
545 ${lispdir}paths.el \
546 ${lispdir}register.elc \
547 ${lispdir}replace.elc \
548 ${lispdir}simple.elc \
549 ${lispdir}startup.elc \
550 ${lispdir}subr.elc \
551 ${lispdir}text-mode.elc \
552 ${lispdir}vc-hooks.elc \
553 VMS_SUPPORT \
2f1b0bbd 554 ${lispdir}window.elc \
45d3c866 555 ${lispdir}version.el
ae3bed12
BF
556
557/* Construct full set of libraries to be linked.
558 Note that SunOS needs -lm to come before -lc; otherwise, you get
709f7c1f
RM
559 duplicated symbols. If the standard libraries were compiled
560 with GCC, we might need gnulib again after them. */
ae3bed12 561LIBES = $(LIBX) LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
709f7c1f 562 LIBS_DEBUG $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR)
ae3bed12
BF
563
564/* Enable recompilation of certain other files depending on system type. */
565
566#ifndef OTHER_FILES
567#define OTHER_FILES
568#endif
569
570/* Enable inclusion of object files in temacs depending on system type. */
571#ifndef OBJECTS_SYSTEM
572#define OBJECTS_SYSTEM
573#endif
574
575#ifndef OBJECTS_MACHINE
576#define OBJECTS_MACHINE
577#endif
578
579all: emacs OTHER_FILES
580
581emacs: temacs ${etc}DOC ${lisp}
582#ifdef CANNOT_DUMP
2bbc6b0a 583 rm -f emacs
ae3bed12
BF
584 ln temacs emacs
585#else
586#ifdef HAVE_SHM
ae3bed12
BF
587 ./temacs -nl -batch -l loadup dump
588#else /* ! defined (HAVE_SHM) */
ae3bed12
BF
589 ./temacs -batch -l loadup dump
590#endif /* ! defined (HAVE_SHM) */
591#endif /* ! defined (CANNOT_DUMP) */
592
80b233a9 593${etc}DOC: ${libsrc}make-docfile ${obj} ${lisp}
ae3bed12 594 rm -f ${etc}DOC
02e8e167 595 ${libsrc}make-docfile -d ${srcdir} ${obj} ${SOME_MACHINE_OBJECTS} \
270eee49 596 ${lisp} > ${etc}DOC
ae3bed12
BF
597
598${libsrc}make-docfile:
918a80cf 599 cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile
ae3bed12
BF
600
601/* Some systems define this to cause parallel Make-ing. */
602#ifndef MAKE_PARALLEL
603#define MAKE_PARALLEL
604#endif
605
606temacs: MAKE_PARALLEL $(LOCALCPP) $(SHORT) $(STARTFILES) $(OLDXMENU) ${obj} ${otherobj} OBJECTS_SYSTEM OBJECTS_MACHINE prefix-args
88f176a4 607 $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${ALL_LDFLAGS}) \
ae3bed12
BF
608 -o temacs ${STARTFILES} ${obj} ${otherobj} \
609 OBJECTS_SYSTEM OBJECTS_MACHINE ${LIBES}
610
611prefix-args: prefix-args.c $(config_h)
612 $(CC) $(ALL_CFLAGS) ${srcdir}/prefix-args.c -o prefix-args
613
614/* These are needed for C compilation, on the systems that need them */
615#ifdef NEED_CPP
616CPP = ./localcpp
617localcpp:
618 cd ${cppdir}; ${MAKE} ${MFLAGS} EMACS=-DEMACS
619 ln ${cppdir}cpp localcpp /* Name where ALL_CFLAGS will refer to it */
620/* cc appears to be cretinous and require all of these to exist
621 if -B is specified -- we can't use one local pass and let the
622 others be the standard ones. What a loser.
623 We can't even use ln, since they are probably
624 on different disks. */
625 cp /lib/ccom localccom
626 -cp /lib/optim localoptim
627 -cp /lib/c2 localc2
628 cp /bin/as localas
629#else /* ! defined (NEED_CPP) */
630CPP = $(CC) -E
631#endif /* ! defined (NEED_CPP) */
632
633#ifdef SHORTNAMES
634shortnames:
635 cd ${shortnamesdir}; ${MAKE} ${MFLAGS}
636#endif
637
638/* Don't lose if this was not defined. */
639#ifndef OLDXMENU_OPTIONS
640#define OLDXMENU_OPTIONS
641#endif
642
3e285e4d
RS
643/* Don't lose if this was not defined. */
644#ifndef LWLIB_OPTIONS
645#define LWLIB_OPTIONS
646#endif
647
ae3bed12 648#ifdef HAVE_X_WINDOWS
ae3bed12 649#ifdef HAVE_X11
3e285e4d
RS
650#ifdef USE_X_TOOLKIT
651$(OLDXMENU): really-lwlib
652 -rm -f $(OLDXMENU) /* We might have a link to an old version. */
653 ${LN_S} ${lwlibdir}liblw.a $(OLDXMENU)
654
655/* Encode the values of these two macros in Make variables,
656 so we can use $(...) to substitute their values within "...". */
657C_SWITCH_MACHINE_1 = C_SWITCH_MACHINE
658C_SWITCH_SYSTEM_1 = C_SWITCH_SYSTEM
659C_SWITCH_SITE_1 = C_SWITCH_SITE
660C_SWITCH_X_SITE_1 = C_SWITCH_X_SITE
661C_SWITCH_X_MACHINE_1 = C_SWITCH_X_MACHINE
662C_SWITCH_X_SYSTEM_1 = C_SWITCH_X_SYSTEM
663really-lwlib:
664 cd ${lwlibdir}; ${MAKE} ${MFLAGS} LWLIB_OPTIONS \
665 CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
666 "C_SWITCH_X_SITE=$(C_SWITCH_X_SITE_1)" \
667 "C_SWITCH_X_MACHINE=$(C_SWITCH_X_MACHINE_1)" \
668 "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" \
669 "C_SWITCH_SITE=$(C_SWITCH_SITE_1)" \
670 "C_SWITCH_MACHINE=$(C_SWITCH_MACHINE_1)" \
671 "C_SWITCH_SYSTEM=$(C_SWITCH_SYSTEM_1)"
672 @true /* make -t should not create really-lwlib. */
673#else /* not USE_X_TOOLKIT */
674#ifdef HAVE_X_MENU
ae3bed12
BF
675$(OLDXMENU): really-oldXMenu
676 -rm -f $(OLDXMENU) /* We might have a link to an old version. */
677 ${LN_S} ${oldXMenudir}libXMenu11.a $(OLDXMENU)
678
679/* Encode the values of these two macros in Make variables,
680 so we can use $(...) to substitute their values within "...". */
681C_SWITCH_MACHINE_1 = C_SWITCH_MACHINE
682C_SWITCH_SYSTEM_1 = C_SWITCH_SYSTEM
683C_SWITCH_SITE_1 = C_SWITCH_SITE
684C_SWITCH_X_SITE_1 = C_SWITCH_X_SITE
685C_SWITCH_X_MACHINE_1 = C_SWITCH_X_MACHINE
686C_SWITCH_X_SYSTEM_1 = C_SWITCH_X_SYSTEM
687really-oldXMenu:
688 cd ${oldXMenudir}; ${MAKE} ${MFLAGS} OLDXMENU_OPTIONS \
689 CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
690 "C_SWITCH_X_SITE=$(C_SWITCH_X_SITE_1)" \
691 "C_SWITCH_X_MACHINE=$(C_SWITCH_X_MACHINE_1)" \
692 "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" \
693 "C_SWITCH_SITE=$(C_SWITCH_SITE_1)" \
694 "C_SWITCH_MACHINE=$(C_SWITCH_MACHINE_1)" \
695 "C_SWITCH_SYSTEM=$(C_SWITCH_SYSTEM_1)"
696 @true /* make -t should not create really-oldXMenu. */
3e285e4d
RS
697#endif /* HAVE_X_MENU */
698#endif /* not USE_X_TOOLKIT */
699#endif /* HAVE_X11 */
700#endif /* HAVE_X_WINDOWS */
ae3bed12
BF
701
702paths.h: paths.h.in
703 @echo "The file paths.h needs to be set up from paths.h.in."
704 @echo "Consult the file \`INSTALL' for instructions for building Emacs."
705 exit 1
706
707config.h: config.h.in
708 @echo "The file config.h needs to be set up from config.h.in."
709 @echo "Consult the file \`INSTALL' for instructions for building Emacs."
710 exit 1
711
712/* Some machines have alloca built-in.
713 They should define HAVE_ALLOCA, or may just let alloca.s
714 be used but generate no code.
715 Some have it written in assembler in alloca.s.
716 Some use the C version in alloca.c (these define C_ALLOCA in config.h).
717 */
718
719#ifdef C_ALLOCA
720/* We could put something in alloca.c to #define free and malloc
721 whenever emacs was #defined, but that's not appropriate for all
722 users of alloca in Emacs. Check out ../lib-src/getopt.c. */
723alloca.o : alloca.c
724 $(CC) -c $(CPPFLAGS) -Dfree=xfree -Dmalloc=xmalloc \
725 $(ALL_CFLAGS) ${srcdir}/alloca.c
726#else
727#ifndef HAVE_ALLOCA
2a3c6d11 728alloca.o : alloca.s $(config_h)
ae3bed12
BF
729/* $(CPP) is cc -E, which may get confused by filenames
730 that do not end in .c. So copy file to a safe name. */
731 cp ${srcdir}/alloca.s allocatem.c
732/* Remove any ^L, blank lines, and preprocessor comments,
733 since some assemblers barf on them. Use a different basename for the
734 output file, since some stupid compilers (Green Hill's) use that
735 name for the intermediate assembler file. */
736 $(CPP) $(CPPFLAGS) $(ALL_CFLAGS) allocatem.c | \
737 sed -e 's/\f//' -e 's/^#.*//' | \
738 sed -n -e '/^..*$$/p' > allocax.s
739 -rm -f alloca.o
740/* Xenix, in particular, needs to run assembler via cc. */
741 $(CC) -c allocax.s
742 mv allocax.o alloca.o
743 rm allocax.s allocatem.c
744#endif /* HAVE_ALLOCA */
745#endif /* ! defined (C_ALLOCA) */
746
747/* Nearly all the following files depend on lisp.h,
748 but it is not included as a dependency because
749 it is so often changed in ways that do not require any recompilation
750 and so rarely changed in ways that do require any. */
751
752abbrev.o : abbrev.c buffer.h commands.h $(config_h)
02e8e167 753buffer.o : buffer.c buffer.h commands.h window.h \
ae3bed12
BF
754 INTERVAL_SRC blockinput.h $(config_h)
755callint.o : callint.c window.h commands.h buffer.h mocklisp.h \
756 keyboard.h $(config_h)
8359469c
RS
757callproc.o : callproc.c paths.h buffer.h commands.h $(config_h) \
758 process.h systty.h syssignal.h
ae3bed12
BF
759casefiddle.o : casefiddle.c syntax.h commands.h buffer.h $(config_h)
760casetab.o : casetab.c buffer.h $(config_h)
761cm.o : cm.c cm.h termhooks.h $(config_h)
762cmds.o : cmds.c syntax.h buffer.h commands.h $(config_h)
763pre-crt0.o : pre-crt0.c
764crt0.o : crt0.c $(config_h)
765 CRT0_COMPILE ${srcdir}/crt0.c
766dired.o : dired.c commands.h buffer.h $(config_h) regex.h
767dispnew.o : dispnew.c commands.h frame.h window.h buffer.h dispextern.h \
768 termchar.h termopts.h termhooks.h cm.h disptab.h systty.h systime.h $(config_h)
769doc.o : doc.c $(config_h) paths.h buffer.h keyboard.h
770doprnt.o : doprnt.c
771editfns.o : editfns.c window.h buffer.h systime.h INTERVAL_SRC $(config_h)
772emacs.o : emacs.c commands.h systty.h syssignal.h process.h INTERVAL_SRC $(config_h)
773fileio.o : fileio.c window.h buffer.h systime.h INTERVAL_SRC $(config_h)
774filelock.o : filelock.c buffer.h paths.h $(config_h)
775filemode.o : filemode.c $(config_h)
776getloadavg.o : getloadavg.c $(config_h)
777indent.o : indent.c frame.h window.h indent.h buffer.h $(config_h) termchar.h \
778 termopts.h disptab.h
779insdel.o : insdel.c window.h buffer.h INTERVAL_SRC blockinput.h $(config_h)
780keyboard.o : keyboard.c termchar.h termhooks.h termopts.h buffer.h \
781 commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \
782 systty.h systime.h dispextern.h intervals.h blockinput.h $(config_h)
783keymap.o : keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \
784 $(config_h)
785lastfile.o : lastfile.c $(config_h)
786macros.o : macros.c window.h buffer.h commands.h macros.h $(config_h)
787malloc.o : malloc.c $(config_h)
788gmalloc.o : gmalloc.c $(config_h)
789ralloc.o : ralloc.c $(config_h)
790vm-limit.o : vm-limit.c mem-limits.h $(config_h)
791marker.o : marker.c buffer.h $(config_h)
792minibuf.o : minibuf.c syntax.h dispextern.h frame.h window.h \
793 buffer.h commands.h $(config_h)
794mocklisp.o : mocklisp.c buffer.h $(config_h)
795process.o : process.c process.h buffer.h window.h termhooks.h termopts.h \
796 commands.h syssignal.h systime.h systty.h syswait.h frame.h $(config_h)
797regex.o : regex.c syntax.h buffer.h $(config_h) regex.h
798frame.o : frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
799 buffer.h $(config_h)
800scroll.o : scroll.c termchar.h $(config_h) dispextern.h frame.h
801search.o : search.c regex.h commands.h buffer.h syntax.h blockinput.h $(config_h)
802syntax.o : syntax.c syntax.h buffer.h commands.h $(config_h)
803sysdep.o : sysdep.c $(config_h) dispextern.h termhooks.h termchar.h termopts.h \
804 frame.h syssignal.h systty.h systime.h syswait.h blockinput.h window.h
805term.o : term.c termchar.h termhooks.h termopts.h $(config_h) cm.h frame.h \
806 disptab.h
807termcap.o : termcap.c $(config_h)
808terminfo.o : terminfo.c $(config_h)
809tparam.o : tparam.c $(config_h)
810undo.o : undo.c buffer.h commands.h $(config_h)
811UNEXEC : UNEXEC_SRC $(config_h)
3e285e4d 812widget.o : widget.c xterm.h frame.h dispextern.h widgetprv.h $(config_h)
ae3bed12
BF
813window.o : window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
814 termhooks.h disptab.h keyboard.h $(config_h)
815xdisp.o : xdisp.c macros.h commands.h indent.h buffer.h dispextern.h \
816 termchar.h frame.h window.h disptab.h termhooks.h $(config_h)
817xfaces.o : xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \
818 window.h $(config_h)
819xfns.o : xfns.c buffer.h frame.h window.h keyboard.h xterm.h \
820 blockinput.h $(config_h)
821xmenu.o : xmenu.c xterm.h window.h frame.h keyboard.h blockinput.h $(config_h)
822xterm.o : xterm.c xterm.h termhooks.h termopts.h termchar.h window.h \
ae82682f 823 dispextern.h frame.h disptab.h blockinput.h systime.h syssignal.h \
ae3bed12
BF
824 gnu.h sink.h sinkmask.h $(config_h)
825xselect.o : xselect.c dispextern.h frame.h xterm.h blockinput.h $(config_h)
826xrdb.o : xrdb.c $(config_h)
f39f5da3 827hftctl.o : hftctl.c $(config_h)
ae3bed12
BF
828
829/* The files of Lisp proper */
830
831alloc.o : alloc.c frame.h window.h buffer.h puresize.h syssignal.h
832alloc.o : blockinput.h $(config_h) INTERVAL_SRC
833bytecode.o : bytecode.c buffer.h $(config_h)
834data.o : data.c buffer.h puresize.h syssignal.h $(config_h)
835eval.o : eval.c commands.h keyboard.h blockinput.h $(config_h)
836floatfns.o : floatfns.c $(config_h)
837fns.o : fns.c commands.h $(config_h) frame.h buffer.h keyboard.h INTERVAL_SRC
838print.o : print.c process.h frame.h window.h buffer.h $(config_h)
839lread.o : lread.c commands.h keyboard.h buffer.h paths.h $(config_h) \
840 termhooks.h
841
842/* Text properties support */
843textprop.o : textprop.c buffer.h intervals.h $(config_h)
240d5222 844intervals.o : intervals.c buffer.h intervals.h puresize.h $(config_h)
ae3bed12
BF
845
846/* System-specific programs to be made.
847 OTHER_FILES, OBJECTS_SYSTEM and OBJECTS_MACHINE
848 select which of these should be compiled. */
849
850sunfns.o : sunfns.c buffer.h $(config_h)
851
852${libsrc}emacstool: ${libsrc}emacstool.c
853 cd ${libsrc}; ${MAKE} ${MFLAGS} emacstool
bfb7b570 854mostlyclean:
1e700751 855 rm -f temacs prefix-args xmakefile* core \#* *.o libXMenu11.a liblw.a
bfb7b570
JB
856 rm -f ../etc/DOC
857clean: mostlyclean
21ed4461 858 rm -f emacs-* emacs
ae3bed12
BF
859/**/# This is used in making a distribution.
860/**/# Do not use it on development directories!
bfb7b570 861distclean: clean
48809826 862 rm -f paths.h config.h Makefile Makefile.in ../etc/DOC-*
bfb7b570
JB
863realclean: distclean
864 rm -f TAGS
c3d80a47
ER
865versionclean:
866 -rm -f emacs emacs-* ../etc/DOC*
9e012fc3 867extraclean: distclean
22e5421f 868 -rm -f *~ \#* m/?*~ s/?*~
9e012fc3 869
ae3bed12
BF
870/* The rule for the [sm] files has to be written a little funny to
871 avoid looking like a C comment to CPP. */
872SOURCES = *.[ch] [sm]/?* COPYING ymakefile \
a6af8696
ER
873 config.h.in README COPYING ChangeLog vms.pp-trans
874unlock:
875 chmod u+w $(SOURCES)
876
877relock:
878 chmod -w $(SOURCES)
879 chmod +w paths.h
dd6e8a8d 880
2c32715a
KH
881/* Arrange to make a tags table in ../lisp, and another in this dir
882 which includes ../lisp/TAGS by reference. */
dd6e8a8d
RS
883ctagsfiles = [a-zA-Z]*.h [a-zA-Z]*.c
884lisptagsfiles = ../lisp/[a-zA-Z]*.el ../lisp/term/[a-zA-Z]*.el
885TAGS: $(ctagsfiles)
886 ../lib-src/etags --include=../lisp/TAGS $(ctagsfiles)
887../lisp/TAGS: $(lisptagsfiles)
888 cd ../lisp; $(MAKE) TAGS
889tags: TAGS ../lisp/TAGS
ac21ec40 890.PHONY: tags