(run-python): Remove '' from sys.path.
[bpt/emacs.git] / src / Makefile.in
CommitLineData
a0528984 1# Makefile for GNU Emacs.
0b5538bd 2# Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
8cabe764
GM
3# 2003, 2004, 2005, 2006, 2007, 2008
4# Free Software Foundation, Inc.
a0528984
EZ
5
6# This file is part of GNU Emacs.
7
b9b1cc14 8# GNU Emacs is free software: you can redistribute it and/or modify
a0528984 9# it under the terms of the GNU General Public License as published by
b9b1cc14
GM
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
a0528984
EZ
12
13# GNU Emacs is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17
18# You should have received a copy of the GNU General Public License
b9b1cc14 19# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
a0528984
EZ
20
21
22# Note that this file is edited by msdos/sed1v2.inp for MSDOS. That
23# script may need modifying in sync with changes made here. Try to
24# avoid shell-ism because the DOS build has to use the DOS shell.
25
5f351ff1 26# Don't try to replace the cpp processing using autoconf facilities,
a0528984 27# says rms.
deeaffe1
DN
28# Replacing a particular part of the conditionals to work via autoconf
29# is OK.
30# Some of the conditionals might be dead now. Finding them and
31# deleting them would be fine.
32
a0528984
EZ
33
34# Here are the things that we expect ../configure to edit.
35# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
36srcdir=@srcdir@
37VPATH=@srcdir@
38CC=@CC@
39CPP=@CPP@
40CFLAGS=@CFLAGS@
41CPPFLAGS=@CPPFLAGS@
42LDFLAGS=@LDFLAGS@
43LN_S=@LN_S@
108c7c97 44EXEEXT=@EXEEXT@
4a3363c5 45version=@version@
a0528984
EZ
46# Substitute an assignment for the MAKE variable, because
47# BSD doesn't have it as a default.
48@SET_MAKE@
49# Don't use LIBS. configure puts stuff in it that either shouldn't be
50# linked with Emacs or is duplicated by the cpp stuff below.
51# LIBS = @LIBS@
52LIBOBJS = @LIBOBJS@
53
60a3d7ee 54lispsource = ${srcdir}/../lisp/
60a3d7ee
DN
55libsrc = ../lib-src/
56etc = ../etc/
57oldXMenudir = ../oldXMenu/
58lwlibdir = ../lwlib/
59lispdir = ../lisp/
a0528984
EZ
60
61# Configuration files for .o files to depend on.
62M_FILE = ${srcdir}/@machfile@
63S_FILE = ${srcdir}/@opsysfile@
64config_h = config.h $(M_FILE) $(S_FILE)
65
66# ========================== start of cpp stuff =======================
67/* From here on, comments must be done in C syntax. */
68
69C_SWITCH_SYSTEM=
70
71/* just to be sure the sh is used */
72SHELL=/bin/sh
73
74#define THIS_IS_MAKEFILE
a0528984
EZ
75#define NOT_C_CODE
76#include "config.h"
77
be9b5a60 78/* Do not let the file name mktime.c get messed up. */
a0528984
EZ
79#ifdef mktime
80#undef mktime
81#endif
82
83/* Use HAVE_X11 as an alias for X11 in this file
84 to avoid problems with X11 as a subdirectory name
85 in -I and other such options which pass through this file. */
86
87#ifdef X11
88#define HAVE_X11
89#undef X11
90#endif
91
92/* On some machines #define register is done in config;
be9b5a60 93 do not let it interfere with this file. */
a0528984
EZ
94#undef register
95
a0528984 96/* GNU libc requires ORDINARY_LINK so that its own crt0 is used.
09fcea18 97 GNU/Linux is an exception because it uses a funny variant of GNU libc. */
a0528984 98#ifdef __GNU_LIBRARY__
8a2a6032 99#ifndef GNU_LINUX
a0528984
EZ
100#define ORDINARY_LINK
101#endif
102#endif
103
be9b5a60 104/* Some machines do not find the standard C libraries in the usual place. */
a0528984
EZ
105#ifndef ORDINARY_LINK
106#ifndef LIB_STANDARD
107#define LIB_STANDARD -lc
108#endif
109#else
110#ifndef LIB_STANDARD
111#define LIB_STANDARD
112#endif
113#endif
114
edfda783 115/* Under GNUstep, putting libc on the link line causes problems. */
122e9f8f 116#ifdef NS_IMPL_GNUSTEP
facfbbbd 117#undef LIB_STANDARD
edfda783
AR
118#define LIB_STANDARD
119#endif
120
a0528984
EZ
121/* Unless inhibited or changed, use -lg to link for debugging. */
122#ifndef LIBS_DEBUG
123#define LIBS_DEBUG -lg
124#endif
125
126/* Some s/SYSTEM.h files define this to request special libraries. */
127#ifndef LIBS_SYSTEM
128#define LIBS_SYSTEM
129#endif
130
131/* Some m/MACHINE.h files define this to request special libraries. */
132#ifndef LIBS_MACHINE
133#define LIBS_MACHINE
134#endif
135
136#ifndef LIB_MATH
137# define LIB_MATH -lm
138#endif /* LIB_MATH */
139
140/* Some s/SYSTEM.h files define this to request special switches in ld. */
141#ifndef LD_SWITCH_SYSTEM
deeaffe1 142#if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
a0528984 143#define LD_SWITCH_SYSTEM -X
deeaffe1 144#else /* (defined (BSD_SYSTEM) && !defined (COFF)) */
a0528984 145#define LD_SWITCH_SYSTEM
deeaffe1 146#endif /* (defined (BSD_SYSTEM) && !defined (COFF)) */
a0528984
EZ
147#endif /* LD_SWITCH_SYSTEM */
148
149/* This holds special options for linking temacs
150 that should be used for linking anything else. */
151#ifndef LD_SWITCH_SYSTEM_TEMACS
152#define LD_SWITCH_SYSTEM_TEMACS
153#endif
154
e0f712ba
AC
155/* Some s/SYSTEM.h files define this to request special switches
156 for compiling temacs. */
157#ifndef C_SWITCH_SYSTEM_TEMACS
158#define C_SWITCH_SYSTEM_TEMACS
159#endif
160
a0528984
EZ
161/* Some m/MACHINE.h files define this to request special switches in ld. */
162#ifndef LD_SWITCH_MACHINE
163#define LD_SWITCH_MACHINE
164#endif
165
166/* This holds special options for linking temacs
167 that should be used for linking anything else. */
168#ifndef LD_SWITCH_MACHINE_TEMACS
169#define LD_SWITCH_MACHINE_TEMACS
170#endif
171
172/* Some m/MACHINE.h files define this to request special switches in cc. */
173#ifndef C_SWITCH_MACHINE
174#define C_SWITCH_MACHINE
175#endif
176
177/* Some s/SYSTEM.h files define this to request special switches in cc. */
178#ifndef C_SWITCH_SYSTEM
179#define C_SWITCH_SYSTEM
180#endif
181
182/* These macros are for switches specifically related to X Windows. */
183#ifndef C_SWITCH_X_MACHINE
184#define C_SWITCH_X_MACHINE
185#endif
186
187#ifndef C_SWITCH_X_SYSTEM
188#define C_SWITCH_X_SYSTEM
189#endif
190
191#ifndef C_SWITCH_X_SITE
192#define C_SWITCH_X_SITE
193#endif
194
195#ifndef LD_SWITCH_X_SITE
196#define LD_SWITCH_X_SITE
197#endif
198
199#ifndef LD_SWITCH_X_DEFAULT
200#define LD_SWITCH_X_DEFAULT
201#endif
202
a0528984
EZ
203#ifndef ORDINARY_LINK
204
205#ifndef CRT0_COMPILE
4624371d 206#define CRT0_COMPILE $(CC) -c $(ALL_CFLAGS)
a0528984
EZ
207#endif
208
209#ifndef START_FILES
210#ifdef NO_REMAP
a0528984 211#define START_FILES pre-crt0.o /lib/crt0.o
a0528984
EZ
212#else /* ! defined (NO_REMAP) */
213#define START_FILES ecrt0.o
214#endif /* ! defined (NO_REMAP) */
215#endif /* START_FILES */
216STARTFILES = START_FILES
217
218#else /* ORDINARY_LINK */
219
220/* config.h might want to force START_FILES anyway */
221#ifdef START_FILES
222STARTFILES = START_FILES
223#endif /* START_FILES */
224
225#endif /* not ORDINARY_LINK */
226
227
122e9f8f 228#ifdef NS_IMPL_GNUSTEP
edfda783
AR
229/* Pull in stuff from GNUstep-make. */
230FOUNDATION_LIB=gnu
231GUI_LIB=gnu
facfbbbd
SM
232include @GNUSTEP_MAKEFILES@/Additional/base.make
233include @GNUSTEP_MAKEFILES@/Additional/gui.make
edfda783
AR
234shared=no
235#endif
236
033b73e2
MA
237#ifdef HAVE_DBUS
238DBUS_CFLAGS = @DBUS_CFLAGS@
239DBUS_LIBS = @DBUS_LIBS@
240DBUS_OBJ = dbusbind.o
241#endif
242
a0528984
EZ
243/* DO NOT use -R. There is a special hack described in lastfile.c
244 which is used instead. Some initialized data areas are modified
245 at initial startup, then labeled as part of the text area when
246 Emacs is dumped for the first time, and never changed again. */
247
248/* -Demacs is needed to make some files produce the correct version
249 for use in Emacs.
250
251 -DHAVE_CONFIG_H is needed for some other files to take advantage of
5aa17bb2 252 the information in ``config.h''. */
a0528984
EZ
253
254/* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM
255 since it may have -I options that should override those two. */
77ccee09 256ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_X_SITE C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM C_SWITCH_SYSTEM_TEMACS ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@
48fad8e8
DN
257ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@
258
edfda783 259.SUFFIXES: .m
a0528984
EZ
260.c.o:
261 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
edfda783 262.m.o:
48fad8e8 263 $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
a0528984 264
a0528984
EZ
265#ifndef LIBX11_SYSTEM
266#define LIBX11_SYSTEM
267#endif
268
269#ifndef LIB_X11_LIB
270#define LIB_X11_LIB -lX11
271#endif
272
273#ifdef HAVE_X_WINDOWS
edfda783 274XMENU_OBJ = xmenu.o
6b61353c
KH
275XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o
276
a0528984
EZ
277#ifdef HAVE_MENUS
278
488dd4c4 279#ifdef USE_GTK
6b61353c 280GTK_OBJ= gtkutil.o
488dd4c4 281#endif
a0528984
EZ
282
283/* The X Menu stuff is present in the X10 distribution, but missing
284 from X11. If we have X10, just use the installed library;
285 otherwise, use our own copy. */
286#ifdef HAVE_X11
287#ifdef USE_X_TOOLKIT
288OLDXMENU=${lwlibdir}liblw.a
289LIBXMENU= $(OLDXMENU)
290#else /* not USE_X_TOOLKIT */
291OLDXMENU= ${oldXMenudir}libXMenu11.a
292LIBXMENU= $(OLDXMENU)
293#endif /* not USE_X_TOOLKIT */
294#else /* not HAVE_X11 */
295LIBXMENU= -lXMenu
296#endif /* not HAVE_X11 */
297
298#else /* not HAVE_MENUS */
299
be9b5a60 300/* Otherwise, do not worry about the menu library at all. */
a0528984
EZ
301LIBXMENU=
302#endif /* not HAVE_MENUS */
303
304#ifdef USE_X_TOOLKIT
73d798d5
SM
305# define @X_TOOLKIT_TYPE@
306# if HAVE_XAW3D
307LUCID_LIBW= -lXaw3d
308# else
309LUCID_LIBW= -lXaw
310# endif
311# if defined (HAVE_MOTIF_2_1) && defined (HAVE_LIBXP)
312# define LIB_MOTIF_EXTRA -lXp
313# else
314# define LIB_MOTIF_EXTRA
315# endif
316# ifdef LIB_MOTIF
317MOTIF_LIBW= LIB_MOTIF LIB_MOTIF_EXTRA
318# else
319MOTIF_LIBW= -lXm LIB_MOTIF_EXTRA
320# endif
321LIBW=$(@X_TOOLKIT_TYPE@_LIBW)
a0528984
EZ
322
323#ifdef HAVE_X11XTR6
324#ifdef NEED_LIBW
325LIBXTR6 = -lSM -lICE -lw
326#else
327LIBXTR6 = -lSM -lICE
328#endif
329#endif
330
331#ifndef LIBXMU
332#define LIBXMU -lXmu
333#endif
334
a0528984 335LIBXT= $(LIBW) LIBXMU -lXt $(LIBXTR6) -lXext
a0528984
EZ
336
337#else /* not USE_X_TOOLKIT */
488dd4c4
JD
338
339#ifdef USE_GTK
340LIBW=@GTK_LIBS@
341OLDXMENU=
342LIBXMENU=
343#endif /* USE_GTK */
344
618c30cb 345#ifdef HAVE_X_SM
488dd4c4 346LIBXT=$(LIBW) -lSM -lICE
618c30cb 347#else
488dd4c4 348LIBXT=$(LIBW)
618c30cb 349#endif
a0528984
EZ
350#endif /* not USE_X_TOOLKIT */
351
7e660140 352#if HAVE_XFT
8d097e47 353XFT_LIBS=@XFT_LIBS@
7e660140
JD
354#endif /* HAVE_XFT */
355
a0528984
EZ
356#if HAVE_XPM
357#ifndef LIBXPM
358#define LIBXPM -lXpm
359#endif /* not defined LIBXPM */
360#else /* not HAVE_XPM */
361#define LIBXPM
362#endif /* not HAVE_XPM */
363
364#if HAVE_JPEG
365#ifndef LIBJPEG
366#define LIBJPEG -ljpeg
367#endif /* not defined LIBJPEG */
368#else /* not HAVE_JPEG */
369#define LIBJPEG
370#endif /* not HAVE_JPEG */
371
372#if HAVE_PNG
373#ifndef LIBPNG
374#define LIBPNG -lpng -lz -lm
375#endif /* not defined LIBPNG */
376#else /* not HAVE_PNG */
377#define LIBPNG
378#endif /* not HAVE_PNG */
379
380#if HAVE_TIFF
381#ifndef LIBTIFF
382#define LIBTIFF -ltiff
383#endif /* not defined LIBTIFF */
384#else /* not HAVE_TIFF */
385#define LIBTIFF
386#endif /* not HAVE_TIFF */
387
388#if HAVE_GIF
389#ifndef LIBGIF
31840c43 390#define LIBGIF -lgif
a0528984
EZ
391#endif /* not defined LIBGIF */
392#else /* not HAVE_GIF */
393#define LIBGIF
394#endif /* not HAVE_GIF */
395
396#ifdef HAVE_X11
397/* LD_SWITCH_X_DEFAULT comes after everything else that specifies
398 options for where to find X libraries, but before those libraries. */
399X11_LDFLAGS = LD_SWITCH_X_SITE LD_SWITCH_X_DEFAULT
4624371d 400LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) LIBTIFF LIBJPEG LIBPNG LIBGIF LIBXPM LIB_X11_LIB LIBX11_SYSTEM $(XFT_LIBS)
a0528984 401#else /* not HAVE_X11 */
c22140f6 402LIBX= $(LIBXMENU) LD_SWITCH_X_SITE
a0528984
EZ
403#endif /* not HAVE_X11 */
404#endif /* not HAVE_X_WINDOWS */
405
26114bc0
JD
406#if HAVE_GPM
407#ifndef LIBGPM
408#define LIBGPM -lgpm
409#endif /* not defined LIBGPM */
410#else /* not HAVE_GPM */
411#define LIBGPM
412#endif /* not HAVE_GPM */
413
b5322ed7
CY
414#if HAVE_LIBRESOLV
415#ifndef LIBRESOLV
416#define LIBRESOLV -lresolv
417#endif /* not defined LIBRESOLV */
418#else /* not HAVE_LIBRESOLV */
419#define LIBRESOLV
420#endif /* not HAVE_LIBRESOLV */
26114bc0 421
a0528984 422LIBSOUND= @LIBSOUND@
4900d996 423CFLAGS_SOUND= @CFLAGS_SOUND@
a0528984 424
a1b7773a
YM
425RSVG_LIBS= @RSVG_LIBS@
426RSVG_CFLAGS= @RSVG_CFLAGS@
427
a0528984
EZ
428#ifndef ORDINARY_LINK
429/* Fix linking if compiled with GCC. */
430#ifdef __GNUC__
431
a0528984
EZ
432#ifdef LINKER
433#define LINKER_WAS_SPECIFIED
434#endif
435
436/* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
437 places that are difficult to figure out at make time. Fortunately,
438 these same versions allow you to pass arbitrary flags on to the
be9b5a60 439 linker, so there is no reason not to use it as a linker.
a0528984 440
be9b5a60 441 Well, it is not quite perfect. The "-nostdlib" keeps GCC from
a0528984
EZ
442 searching for libraries in its internal directories, so we have to
443 ask GCC explicitly where to find libgcc.a. */
444
445#ifndef LINKER
446#define LINKER $(CC) -nostdlib
447#endif
448
449#ifndef LIB_GCC
450/* Ask GCC where to find libgcc.a. */
451#define LIB_GCC `$(CC) -print-libgcc-file-name`
452#endif /* not LIB_GCC */
453
454GNULIB_VAR = LIB_GCC
455
456#ifndef LINKER_WAS_SPECIFIED
457/* GCC passes any argument prefixed with -Xlinker directly to the
be9b5a60 458 linker. See prefix-args.c for an explanation of why we do not do
5aa17bb2 459 this with the shell''s ``for'' construct.
be9b5a60 460 Note that some people do not have '.' in their paths, so we must
a0528984
EZ
461 use ./prefix-args. */
462#define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
463#else
464#define YMF_PASS_LDFLAGS(flags) flags
465#endif
466
a0528984
EZ
467#else /* not __GNUC__ */
468GNULIB_VAR =
469
470#endif /* not __GNUC__ */
471#endif /* not ORDINARY_LINK */
472
a0528984
EZ
473#ifdef ORDINARY_LINK
474LD = $(CC)
475#else
a0528984
EZ
476#ifdef LINKER
477LD=LINKER
478#else /* not LINKER */
479LD=ld
480#endif /* not LINKER */
a0528984
EZ
481#endif /* not ORDINARY_LINK */
482
dfe15ea3 483/* Flags to pass to LD only for temacs. */
be9b5a60 484/* Do not split this line with a backslash. That can cause trouble with
afb44cc2 485 some cpps. */
77ccee09 486TEMACS_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE LD_SWITCH_MACHINE_TEMACS
a0528984
EZ
487
488/* A macro which other sections of Makefile can redefine to munge the
be9b5a60 489 flags before they are passed to LD. This is helpful if you have
a0528984
EZ
490 redefined LD to something odd, like "gcc".
491 (The YMF prefix is a holdover from the old name "ymakefile".)
492 */
493#ifndef YMF_PASS_LDFLAGS
494#define YMF_PASS_LDFLAGS(flags) flags
495#endif
496
497/* Allow config.h to specify a replacement file for unexec.c. */
498#ifndef UNEXEC
499#define UNEXEC unexec.o
500#endif
a0528984
EZ
501
502INTERVAL_SRC = intervals.h composite.h
503
504GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
505
506#ifdef MSDOS
507#ifdef HAVE_X_WINDOWS
005e19a5 508MSDOS_OBJ = dosfns.o msdos.o xmenu.o
a0528984 509#else
005e19a5 510MSDOS_OBJ = dosfns.o msdos.o w16select.o xmenu.o
a0528984
EZ
511#endif
512#endif
513
6b61353c
KH
514#ifdef CYGWIN
515CYGWIN_OBJ = sheap.o
516#endif
517
edfda783 518#ifdef HAVE_NS
06b62770
AR
519ns_appdir=@ns_appdir@/
520ns_appbindir=@ns_appbindir@/
521ns_appresdir=@ns_appresdir@/
522ns_appsrc=@ns_appsrc@
edfda783
AR
523/* Object files for NeXTstep */
524NS_OBJ= nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
525 fontset.o fringe.o image.o
edfda783
AR
526#endif /* HAVE_NS */
527
7de94409 528#ifdef HAVE_WINDOW_SYSTEM
7de94409
KH
529#ifdef HAVE_X_WINDOWS
530#if defined (HAVE_XFT)
0f91ebe6 531FONT_DRIVERS = xfont.o ftfont.o xftfont.o ftxfont.o
7de94409 532#elif defined (HAVE_FREETYPE)
0f91ebe6 533FONT_DRIVERS = xfont.o ftfont.o ftxfont.o
7de94409 534#else /* ! defined (HAVE_XFT) && ! defined (HAVE_FREETYPE) */
0f91ebe6 535FONT_DRIVERS = xfont.o
7de94409 536#endif /* ! defined (HAVE_XFT) && ! defined (HAVE_FREETYPE) */
0f91ebe6 537#endif /* HAVE_X_WINDOWS */
7de94409
KH
538#endif /* HAVE_WINDOW_SYSTEM */
539
a0528984
EZ
540/* lastfile must follow all files
541 whose initialized data areas should be dumped as pure by dump-emacs. */
01ef9d36 542obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
8f924df7 543 charset.o coding.o category.o ccl.o character.o chartab.o \
033b73e2 544 cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
a0528984
EZ
545 emacs.o keyboard.o macros.o keymap.o sysdep.o \
546 buffer.o filelock.o insdel.o marker.o \
547 minibuf.o fileio.o dired.o filemode.o \
548 cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
549 alloc.o data.o doc.o editfns.o callint.o \
0f91ebe6 550 eval.o floatfns.o fns.o font.o print.o lread.o \
e047f448 551 syntax.o UNEXEC bytecode.o \
a0528984
EZ
552 process.o callproc.o \
553 region-cache.o sound.o atimer.o \
554 doprnt.o strftime.o intervals.o textprop.o composite.o md5.o \
9e2a2647 555 $(MSDOS_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_DRIVERS)
a0528984
EZ
556
557/* Object files used on some machine or other.
558 These go in the DOC file on all machines
559 in case they are needed there. */
04a697fe 560SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
d87a9ab8 561 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
9e2a2647 562 fontset.o \
a68fda4a 563 nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
c9fc02c7 564 w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
0f91ebe6 565 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS)
a0528984
EZ
566
567
568#ifdef TERMINFO
569/* Used to be -ltermcap here. If your machine needs that,
570 define LIBS_TERMCAP in the m/MACHINE.h file. */
571#ifndef LIBS_TERMCAP
572#define LIBS_TERMCAP -lcurses
573#endif /* LIBS_TERMCAP */
574termcapobj = terminfo.o
575#else /* ! defined (TERMINFO) */
576#ifndef LIBS_TERMCAP
577#define LIBS_TERMCAP
578termcapobj = termcap.o tparam.o
579#else /* LIBS_TERMCAP */
580termcapobj = tparam.o
581#endif /* LIBS_TERMCAP */
582#endif /* ! defined (TERMINFO) */
583
584
585#ifndef SYSTEM_MALLOC
586
2fa0eedf
RS
587#ifndef DOUG_LEA_MALLOC
588gmallocobj = gmalloc.o
589#endif
590
a0528984 591#ifdef REL_ALLOC
2fa0eedf
RS
592rallocobj = ralloc.o
593#endif
594
595mallocobj = $(gmallocobj) $(rallocobj) vm-limit.o
a0528984
EZ
596
597#endif /* SYSTEM_MALLOC */
598
599
a0528984
EZ
600#ifdef USE_X_TOOLKIT
601widgetobj= widget.o
602#else /* not USE_X_TOOLKIT */
603widgetobj=
604#endif /* not USE_X_TOOLKIT */
605
606
607/* define otherobj as list of object files that make-docfile
608 should not be told about. */
6b61353c
KH
609#ifdef CYGWIN
610/* Cygwin differs because of its unexec(). */
67d20687 611otherobj= $(termcapobj) $(gmallocobj) $(rallocobj) lastfile.o vm-limit.o $(widgetobj) $(LIBOBJS)
6b61353c 612#else
67d20687 613otherobj= $(termcapobj) lastfile.o $(mallocobj) $(widgetobj) $(LIBOBJS)
6b61353c 614#endif
a0528984
EZ
615
616#ifdef HAVE_MOUSE
617#define MOUSE_SUPPORT ${lispsource}mouse.elc \
618 ${lispsource}select.elc ${lispsource}scroll-bar.elc
619#else
dd7c5963
NR
620#ifdef HAVE_GPM
621#define MOUSE_SUPPORT ${lispsource}mouse.elc
622#else
a0528984
EZ
623#define MOUSE_SUPPORT
624#endif
dd7c5963 625#endif
a0528984 626
a0528984
EZ
627#ifdef MSDOS
628#define MSDOS_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
629 ${lispsource}dos-fns.elc ${lispsource}dos-w32.elc ${lispsource}dos-vars.elc \
630 ${lispsource}international/ccl.elc ${lispsource}international/codepage.elc
631
632#else
633#define MSDOS_SUPPORT
634#endif
635
414546fb
NR
636#ifdef HAVE_WINDOW_SYSTEM
637#ifdef HAVE_X_WINDOWS
d76c7a77 638#define WINDOW_SUPPORT ${lispsource}fringe.elc ${lispsource}image.elc \
414546fb
NR
639 ${lispsource}international/fontset.elc ${lispsource}dnd.elc \
640 ${lispsource}tool-bar.elc ${lispsource}mwheel.elc ${lispsource}x-dnd.elc
641#else
d76c7a77 642#define WINDOW_SUPPORT ${lispsource}fringe.elc ${lispsource}image.elc \
414546fb
NR
643 ${lispsource}international/fontset.elc ${lispsource}dnd.elc \
644 ${lispsource}tool-bar.elc ${lispsource}mwheel.elc
645#endif
646#else
647#define WINDOW_SUPPORT
648#endif
649
a0528984 650#ifdef WINDOWSNT
1f1bce0e
JR
651#define WINNT_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
652 ${lispsource}dos-w32.elc ${lispsource}w32-vars.elc \
653 ${lispsource}w32-fns.elc
a0528984
EZ
654#else
655#define WINNT_SUPPORT
656#endif
657
875baa34
LT
658#ifdef HAVE_WINDOW_SYSTEM
659#define TOOLTIP_SUPPORT ${lispsource}tooltip.elc
660#else
661#define TOOLTIP_SUPPORT
662#endif
663
be9b5a60
SM
664/* List of Lisp files loaded into the dumped Emacs. It is arranged
665 like this because it is easier to generate it semi-mechanically from
a0528984
EZ
666 loadup.el this way.
667
668 Note that this list should not include lisp files which might not
669 be present, like site-load.el and site-init.el; this makefile
670 expects them all to be either present or buildable.
671
672 Files which are loaded unconditionally should be in shortlisp as well.
673 Files included conditionally here should be included (unconditionally)
674 in SOME_MACHINE_LISP. */
675
c045cf6e 676/* Place loaddefs.el first, so it gets generated first, since it is on
b4945b95
SM
677 the critical path (relevant in parallel compilations). */
678
a0528984 679lisp= \
b4945b95 680 ${lispsource}loaddefs.el \
a0528984
EZ
681 ${lispsource}abbrev.elc \
682 ${lispsource}buff-menu.elc \
aae5b722 683 ${lispsource}button.elc \
f984e73e 684 ${lispsource}emacs-lisp/byte-run.elc \
731055f5 685 ${lispsource}composite.elc \
bfcf6dbe 686 ${lispsource}cus-face.elc \
d381a855 687 ${lispsource}cus-start.elc \
a0528984 688 ${lispsource}custom.elc \
6e860d15 689 ${lispsource}emacs-lisp/backquote.elc \
a0528984
EZ
690 ${lispsource}emacs-lisp/lisp-mode.elc \
691 ${lispsource}emacs-lisp/lisp.elc \
692 ${lispsource}env.elc \
693 ${lispsource}faces.elc \
694 ${lispsource}files.elc \
695 ${lispsource}format.elc \
696 ${lispsource}facemenu.elc \
697 MOUSE_SUPPORT \
f984e73e 698 ${lispsource}emacs-lisp/float-sup.elc \
af0ad939 699 ${lispsource}frame.elc \
a0528984
EZ
700 ${lispsource}help.elc \
701 ${lispsource}indent.elc \
702 ${lispsource}isearch.elc \
29f05691 703 ${lispsource}rfn-eshadow.elc \
a0528984 704 ${lispsource}loadup.el \
aae5b722 705 ${lispsource}bindings.elc \
f984e73e 706 ${lispsource}emacs-lisp/map-ynp.elc \
a0528984
EZ
707 ${lispsource}menu-bar.elc \
708 ${lispsource}international/mule.elc \
709 ${lispsource}international/mule-conf.el \
710 ${lispsource}international/mule-cmds.elc \
711 ${lispsource}international/characters.elc \
15e2814c 712 ${lispsource}international/charprop.el \
a0528984 713 ${lispsource}case-table.elc \
050c6022 714 ${lispsource}language/chinese.el \
7e4c0466 715 ${lispsource}language/cyrillic.el \
054ccc15 716 ${lispsource}language/indian.el \
cc8d1311 717 ${lispsource}language/sinhala.el \
74fc84af 718 ${lispsource}language/english.el \
a0528984
EZ
719 ${lispsource}language/ethiopic.elc \
720 ${lispsource}language/european.elc \
74fc84af
EZ
721 ${lispsource}language/czech.el \
722 ${lispsource}language/slovak.el \
723 ${lispsource}language/romanian.el \
724 ${lispsource}language/greek.el \
725 ${lispsource}language/hebrew.el \
726 ${lispsource}language/japanese.el \
727 ${lispsource}language/korean.el \
728 ${lispsource}language/lao.el \
c9228487 729 ${lispsource}language/cham.el \
16460a76 730 ${lispsource}language/tai-viet.el \
74fc84af 731 ${lispsource}language/thai.el \
a0528984 732 ${lispsource}language/tibetan.elc \
7e4c0466 733 ${lispsource}language/vietnamese.el \
74fc84af 734 ${lispsource}language/misc-lang.el \
1e9a6186
DL
735 ${lispsource}language/utf-8-lang.el \
736 ${lispsource}language/georgian.el \
0e45710c 737 ${lispsource}language/khmer.el \
7f6519c5 738 ${lispsource}language/burmese.el \
a0528984
EZ
739 ${lispsource}paths.el \
740 ${lispsource}register.elc \
741 ${lispsource}replace.elc \
742 ${lispsource}simple.elc \
32bae13c 743 ${lispsource}minibuffer.elc \
a0528984
EZ
744 ${lispsource}startup.elc \
745 ${lispsource}subr.elc \
746 ${lispsource}term/tty-colors.elc \
bfcf6dbe 747 ${lispsource}font-core.elc \
1f7b1131
DN
748 ${lispsource}emacs-lisp/syntax.elc \
749 ${lispsource}font-lock.elc \
750 ${lispsource}jit-lock.elc \
a0528984
EZ
751 ${lispsource}textmodes/fill.elc \
752 ${lispsource}textmodes/page.elc \
753 ${lispsource}textmodes/paragraphs.elc \
754 ${lispsource}textmodes/text-mode.elc \
f984e73e 755 ${lispsource}emacs-lisp/timer.elc \
6e6851b0 756 ${lispsource}jka-cmpr-hook.elc \
a0528984
EZ
757 ${lispsource}vc-hooks.elc \
758 ${lispsource}ediff-hook.elc \
86914123 759 ${lispsource}epa-hook.elc \
875baa34 760 TOOLTIP_SUPPORT \
a0528984
EZ
761 MSDOS_SUPPORT \
762 WINNT_SUPPORT \
414546fb 763 WINDOW_SUPPORT \
a0528984
EZ
764 ${lispsource}widget.elc \
765 ${lispsource}window.elc \
766 ${lispsource}version.el
767
768/* These are relative file names for the Lisp files
769 that are loaded unconditionally. This is used in make-docfile.
770 It need not contain the files that are loaded conditionally
771 because SOME_MACHINE_LISP has those. */
772shortlisp= \
b4945b95 773 ../lisp/loaddefs.el \
a0528984
EZ
774 ../lisp/abbrev.elc \
775 ../lisp/buff-menu.elc \
aae5b722 776 ../lisp/button.elc \
f984e73e 777 ../lisp/emacs-lisp/byte-run.elc \
731055f5 778 ../lisp/composite.elc \
bfcf6dbe 779 ../lisp/cus-face.elc \
d381a855 780 ../lisp/cus-start.elc \
a0528984 781 ../lisp/custom.elc \
f7d5d963 782 ../lisp/emacs-lisp/backquote.elc \
a0528984
EZ
783 ../lisp/emacs-lisp/lisp-mode.elc \
784 ../lisp/emacs-lisp/lisp.elc \
785 ../lisp/facemenu.elc \
786 ../lisp/faces.elc \
787 ../lisp/files.elc \
f984e73e 788 ../lisp/emacs-lisp/float-sup.elc \
a0528984
EZ
789 ../lisp/format.elc \
790 ../lisp/frame.elc \
791 ../lisp/help.elc \
792 ../lisp/indent.elc \
793 ../lisp/isearch.elc \
29f05691 794 ../lisp/rfn-eshadow.elc \
a0528984 795 ../lisp/loadup.el \
aae5b722 796 ../lisp/bindings.elc \
f984e73e 797 ../lisp/emacs-lisp/map-ynp.elc \
a0528984
EZ
798 ../lisp/env.elc \
799 ../lisp/international/mule.elc \
800 ../lisp/international/mule-conf.el \
801 ../lisp/international/mule-cmds.elc \
802 ../lisp/international/characters.elc \
803 ../lisp/case-table.elc \
050c6022 804 ../lisp/language/chinese.el \
7e4c0466 805 ../lisp/language/cyrillic.el \
054ccc15 806 ../lisp/language/indian.el \
cc8d1311 807 ../lisp/language/sinhala.el \
74fc84af 808 ../lisp/language/english.el \
a0528984
EZ
809 ../lisp/language/ethiopic.elc \
810 ../lisp/language/european.elc \
74fc84af
EZ
811 ../lisp/language/czech.el \
812 ../lisp/language/slovak.el \
813 ../lisp/language/romanian.el \
814 ../lisp/language/greek.el \
815 ../lisp/language/hebrew.el \
816 ../lisp/language/japanese.el \
817 ../lisp/language/korean.el \
818 ../lisp/language/lao.el \
c9228487 819 ../lisp/language/cham.el \
16460a76 820 ../lisp/language/tai-viet.el \
74fc84af 821 ../lisp/language/thai.el \
a0528984 822 ../lisp/language/tibetan.elc \
7e4c0466 823 ../lisp/language/vietnamese.el \
74fc84af 824 ../lisp/language/misc-lang.el \
1e9a6186
DL
825 ../lisp/language/utf-8-lang.el \
826 ../lisp/language/georgian.el \
0e45710c 827 ../lisp/language/khmer.el \
7f6519c5 828 ../lisp/language/burmese.el \
f7d5d963 829 ../lisp/menu-bar.elc \
a0528984
EZ
830 ../lisp/paths.el \
831 ../lisp/register.elc \
832 ../lisp/replace.elc \
833 ../lisp/simple.elc \
32bae13c 834 ../lisp/minibuffer.elc \
a0528984
EZ
835 ../lisp/startup.elc \
836 ../lisp/subr.elc \
837 ../lisp/term/tty-colors.elc \
59809627 838 ../lisp/font-core.elc \
1f7b1131
DN
839 ../lisp/emacs-lisp/syntax.elc \
840 ../lisp/font-lock.elc \
841 ../lisp/jit-lock.elc \
a0528984
EZ
842 ../lisp/textmodes/fill.elc \
843 ../lisp/textmodes/page.elc \
844 ../lisp/textmodes/paragraphs.elc \
845 ../lisp/textmodes/text-mode.elc \
f984e73e 846 ../lisp/emacs-lisp/timer.elc \
a0528984 847 ../lisp/vc-hooks.elc \
6e6851b0 848 ../lisp/jka-cmpr-hook.elc \
a0528984 849 ../lisp/ediff-hook.elc \
86914123 850 ../lisp/epa-hook.elc \
a0528984
EZ
851 ../lisp/widget.elc \
852 ../lisp/window.elc \
853 ../lisp/version.el
854
855/* Lisp files that may or may not be used.
856 We must unconditionally put them in the DOC file.
857 We use ../lisp/ to start the file names
858 to reduce the size of the argument list for make-docfile
5aa17bb2 859 for the sake of systems which can''t handle large ones. */
60a3d7ee
DN
860SOME_MACHINE_LISP = ../lisp/mouse.elc \
861 ../lisp/select.elc ../lisp/scroll-bar.elc \
60a3d7ee
DN
862 ../lisp/ls-lisp.elc ../lisp/dos-fns.elc \
863 ../lisp/w32-fns.elc ../lisp/dos-w32.elc \
864 ../lisp/disp-table.elc ../lisp/dos-vars.elc \
865 ../lisp/tooltip.elc ../lisp/image.elc \
866 ../lisp/fringe.elc ../lisp/dnd.elc \
867 ../lisp/mwheel.elc ../lisp/tool-bar.elc \
868 ../lisp/x-dnd.elc \
869 ../lisp/international/ccl.elc \
870 ../lisp/international/codepage.elc \
871 ../lisp/international/fontset.elc \
872 ../lisp/mouse.elc \
7206e7b7 873 ../lisp/term/x-win.elc \
005e19a5 874 ../lisp/term/pc-win.elc \
65303693 875 ../lisp/term/ns-win.elc
a0528984
EZ
876
877/* Construct full set of libraries to be linked.
878 Note that SunOS needs -lm to come before -lc; otherwise, you get
879 duplicated symbols. If the standard libraries were compiled
880 with GCC, we might need gnulib again after them. */
edfda783 881
033b73e2
MA
882LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) $(DBUS_LIBS) \
883 LIBGPM LIBRESOLV LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
22f5bb01 884 LIBS_DEBUG $(GETLOADAVG_LIBS) \
ac96711a 885 @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ @M17N_FLT_LIBS@ \
22f5bb01 886 $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR)
a0528984
EZ
887
888/* Enable recompilation of certain other files depending on system type. */
889
890#ifndef OTHER_FILES
891#define OTHER_FILES
892#endif
893
894#ifndef OBJECTS_MACHINE
895#define OBJECTS_MACHINE
896#endif
897
462a725d
KH
898#ifdef HAVE_SHM
899RUN_TEMACS = `/bin/pwd`/temacs -nl
900#else
901RUN_TEMACS = `/bin/pwd`/temacs
902#endif
83f1cb94 903
108c7c97 904all: emacs${EXEEXT} OTHER_FILES
a0528984 905
49f6eb95 906emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp} ${SOME_MACHINE_LISP}
a0528984 907#ifdef CANNOT_DUMP
108c7c97
AS
908 rm -f emacs${EXEEXT}
909 ln temacs${EXEEXT} emacs${EXEEXT}
a0528984 910#else
83f1cb94 911 LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump
fc46d219
SM
912 @: This new Emacs is as functional and more efficient then
913 @: bootstrap-emacs, so let us replace it.
914 -ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
a0528984
EZ
915#endif /* ! defined (CANNOT_DUMP) */
916 -./emacs -q -batch -f list-load-path-shadows
917
918/* We run make-docfile twice because the command line may get too long
919 on some systems. */
920/* ${SOME_MACHINE_OBJECTS} comes before ${obj} because some files may
921 or may not be included in ${obj}, but they are always included in
922 ${SOME_MACHINE_OBJECTS}. Since a file is processed when it is mentioned
923 for the first time, this prevents any variation between configurations
924 in the contents of the DOC file.
925 Likewise for ${SOME_MACHINE_LISP}. */
d7c664f3
SM
926/* Most of this Makefile refers to Lisp files via ${lispsource}, so
927 we also use ${lisp} rather than ${shortlisp} for the dependency since
928 the Makefile uses string equality to decide when we talk about identical
929 files. Apparently we pass ${shortlisp} rather than ${lisp} to make-docfile
930 only in order to reduce the command line length. --Stef */
931${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${lisp} ${SOME_MACHINE_LISP}
a0528984
EZ
932 -rm -f ${etc}DOC
933 ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC
934 ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp}
935
108c7c97
AS
936${libsrc}make-docfile${EXEEXT}:
937 cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile${EXEEXT}
a0528984 938
deeaffe1 939temacs${EXEEXT}: $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} OBJECTS_MACHINE prefix-args${EXEEXT}
bd45f31d 940 echo "${obj} ${otherobj} " OBJECTS_MACHINE > buildobj.lst
122e9f8f 941#ifdef NS_IMPL_GNUSTEP
a2d3af1c 942 $(CC) -rdynamic YMF_PASS_LDFLAGS ( ${TEMACS_LDFLAGS} \
ba00b2bc 943 -L@GNUSTEP_SYSTEM_LIBRARIES@ $(LDFLAGS) -lgnustep-gui -lgnustep-base \
a2d3af1c
AR
944 -lobjc $(CONFIG_SYSTEM_LIBS) -lpthread ) -o temacs \
945 ${obj} ${otherobj} OBJECTS_MACHINE ${LIBES}
edfda783 946#else
dfe15ea3 947 $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \
a0528984
EZ
948 -o temacs ${STARTFILES} ${obj} ${otherobj} \
949 OBJECTS_MACHINE ${LIBES}
edfda783 950#endif
a0528984 951
be9b5a60 952/* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
5aa17bb2 953 often contain options that have to do with using Emacs''s crt0,
a0528984 954 which are only good with temacs. */
108c7c97 955prefix-args${EXEEXT}: prefix-args.c $(config_h)
a0528984
EZ
956 $(CC) $(ALL_CFLAGS) $(LDFLAGS) ${srcdir}/prefix-args.c -o prefix-args
957
a51f4969 958#if defined (HAVE_X_WINDOWS) && defined (HAVE_X11) && defined (HAVE_MENUS) && ! defined (USE_GTK)
a0528984
EZ
959
960/* We use stamp-xmenu with these two deps
961 to both ensure that lwlib gets remade based on its dependencies
962 in its own makefile,
963 and remake temacs if lwlib gets changed by this. */
c60ee5e7 964stamp-oldxmenu: ${OLDXMENU} ../src/$(OLDXMENU)
a0528984
EZ
965 touch stamp-oldxmenu
966/* Supply an ordering for parallel make. */
967../src/$(OLDXMENU): ${OLDXMENU}
968
a0528984
EZ
969/* Encode the values of these two macros in Make variables,
970 so we can use $(...) to substitute their values within "...". */
971C_SWITCH_MACHINE_1 = C_SWITCH_MACHINE
972C_SWITCH_SYSTEM_1 = C_SWITCH_SYSTEM
a0528984
EZ
973C_SWITCH_X_SITE_1 = C_SWITCH_X_SITE
974C_SWITCH_X_MACHINE_1 = C_SWITCH_X_MACHINE
975C_SWITCH_X_SYSTEM_1 = C_SWITCH_X_SYSTEM
deeaffe1
DN
976
977#ifdef USE_X_TOOLKIT
978$(OLDXMENU): really-lwlib
979
a0528984 980really-lwlib:
6b61353c 981 cd ${lwlibdir}; ${MAKE} ${MFLAGS} \
a0528984
EZ
982 CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
983 "C_SWITCH_X_SITE=$(C_SWITCH_X_SITE_1)" \
984 "C_SWITCH_X_MACHINE=$(C_SWITCH_X_MACHINE_1)" \
985 "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" \
a0528984
EZ
986 "C_SWITCH_MACHINE=$(C_SWITCH_MACHINE_1)" \
987 "C_SWITCH_SYSTEM=$(C_SWITCH_SYSTEM_1)"
988 @true /* make -t should not create really-lwlib. */
989.PHONY: really-lwlib
990#else /* not USE_X_TOOLKIT */
991$(OLDXMENU): really-oldXMenu
992
a0528984 993really-oldXMenu:
9c28b587 994 cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \
a0528984
EZ
995 CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
996 "C_SWITCH_X_SITE=$(C_SWITCH_X_SITE_1)" \
997 "C_SWITCH_X_MACHINE=$(C_SWITCH_X_MACHINE_1)" \
998 "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" \
a0528984
EZ
999 "C_SWITCH_MACHINE=$(C_SWITCH_MACHINE_1)" \
1000 "C_SWITCH_SYSTEM=$(C_SWITCH_SYSTEM_1)"
1001 @true /* make -t should not create really-oldXMenu. */
1002.PHONY: really-oldXMenu
1003#endif /* not USE_X_TOOLKIT */
a51f4969 1004#else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */
a0528984 1005
5aa17bb2 1006/* We don''t really need this, but satisfy the dependency. */
a0528984
EZ
1007stamp-oldxmenu:
1008 touch stamp-oldxmenu
a51f4969 1009#endif /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */
a0528984
EZ
1010
1011../config.status:: epaths.in
1012 @echo "The file epaths.h needs to be set up from epaths.in."
1013 @echo "Please run the `configure' script again."
1014 exit 1
1015
1016../config.status:: config.in
1017 @echo "The file config.h needs to be set up from config.in."
1018 @echo "Please run the `configure' script again."
1019 exit 1
1020
a0528984
EZ
1021/* Nearly all the following files depend on lisp.h,
1022 but it is not included as a dependency because
1023 it is so often changed in ways that do not require any recompilation
1024 and so rarely changed in ways that do require any. */
1025
85969c22 1026abbrev.o: abbrev.c buffer.h window.h dispextern.h commands.h character.h \
21065c92 1027 syntax.h $(config_h)
a0528984 1028buffer.o: buffer.c buffer.h region-cache.h commands.h window.h \
85969c22 1029 dispextern.h $(INTERVAL_SRC) blockinput.h atimer.h systime.h character.h \
a0528984 1030 $(config_h)
21065c92 1031callint.o: callint.c window.h commands.h buffer.h keymap.h \
a0528984
EZ
1032 keyboard.h dispextern.h $(config_h)
1033callproc.o: callproc.c epaths.h buffer.h commands.h $(config_h) \
8f924df7 1034 process.h systty.h syssignal.h character.h coding.h ccl.h msdos.h \
f105f403 1035 composite.h w32.h blockinput.h atimer.h systime.h frame.h termhooks.h
85969c22 1036casefiddle.o: casefiddle.c syntax.h commands.h buffer.h character.h \
a63aa692 1037 composite.h \
21065c92 1038 charset.h keymap.h $(config_h)
a0528984 1039casetab.o: casetab.c buffer.h $(config_h)
a63aa692
MB
1040category.o: category.c category.h buffer.h charset.h keymap.h \
1041 character.h $(config_h)
85969c22
KH
1042ccl.o: ccl.c ccl.h charset.h character.h coding.h $(config_h)
1043character.o: character.c character.h buffer.h charset.h composite.h disptab.h \
1044 $(config.h)
1045charset.o: charset.c charset.h character.h buffer.h coding.h composite.h \
1046 disptab.h $(config_h)
5d4e3d2e 1047chartab.o: charset.h character.h $(config.h)
a63aa692 1048coding.o: coding.c coding.h ccl.h buffer.h character.h charset.h intervals.h composite.h \
267eea21 1049 window.h dispextern.h frame.h termhooks.h $(config_h)
91b726f0 1050cm.o: cm.c frame.h cm.h termhooks.h termchar.h $(config_h)
85969c22 1051cmds.o: cmds.c syntax.h buffer.h character.h commands.h window.h $(config_h) \
21065c92 1052 msdos.h dispextern.h keyboard.h keymap.h
a0528984
EZ
1053pre-crt0.o: pre-crt0.c
1054ecrt0.o: ecrt0.c $(config_h)
1055 CRT0_COMPILE ${srcdir}/ecrt0.c
85969c22 1056dired.o: dired.c commands.h buffer.h $(config_h) character.h charset.h \
d85d3839 1057 coding.h regex.h systime.h blockinput.h atimer.h
985773c9 1058dispnew.o: dispnew.c systime.h commands.h process.h frame.h \
4524691f 1059 window.h buffer.h dispextern.h termchar.h termopts.h termhooks.h cm.h \
21065c92 1060 disptab.h indent.h intervals.h \
85969c22 1061 xterm.h blockinput.h atimer.h character.h msdos.h composite.h keyboard.h \
f78c2c97 1062 syssignal.h $(config_h)
a63aa692 1063doc.o: doc.c $(config_h) epaths.h buffer.h keyboard.h keymap.h character.h
85969c22 1064doprnt.o: doprnt.c character.h $(config_h)
21065c92 1065dosfns.o: buffer.h termchar.h termhooks.h frame.h blockinput.h window.h \
ffb72b67
YM
1066 msdos.h dosfns.h dispextern.h charset.h coding.h atimer.h systime.h \
1067 $(config_h)
85969c22 1068editfns.o: editfns.c window.h buffer.h systime.h $(INTERVAL_SRC) character.h \
ffb72b67 1069 coding.h dispextern.h frame.h blockinput.h atimer.h $(config_h)
a0528984 1070emacs.o: emacs.c commands.h systty.h syssignal.h blockinput.h process.h \
6b61353c 1071 termhooks.h buffer.h atimer.h systime.h $(INTERVAL_SRC) $(config_h) \
21065c92 1072 window.h dispextern.h keyboard.h keymap.h
85969c22 1073fileio.o: fileio.c window.h buffer.h systime.h $(INTERVAL_SRC) character.h \
ffb72b67 1074 coding.h msdos.h dispextern.h blockinput.h atimer.h $(config_h)
8f924df7
KH
1075filelock.o: filelock.c buffer.h character.h charset.h coding.h systime.h \
1076 epaths.h $(config_h)
a0528984
EZ
1077filemode.o: filemode.c $(config_h)
1078frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
08b3caa9 1079 blockinput.h atimer.h systime.h buffer.h character.h fontset.h font.h \
9e2a2647 1080 msdos.h dosfns.h dispextern.h w32term.h termchar.h \
08b3caa9 1081 $(config_h)
47632e43 1082fringe.o: fringe.c dispextern.h frame.h window.h buffer.h termhooks.h $(config_h)
08b1e593
KH
1083font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \
1084 font.h $(config_h)
7de94409 1085ftfont.o: dispextern.h frame.h character.h charset.h font.h $(config_h)
85969c22 1086fontset.o: dispextern.h fontset.h fontset.c ccl.h buffer.h character.h \
0f91ebe6 1087 charset.h frame.h keyboard.h termhooks.h font.h $(config_h)
a0528984 1088getloadavg.o: getloadavg.c $(config_h)
6b61353c 1089image.o: image.c frame.h window.h dispextern.h blockinput.h atimer.h \
9e2a2647 1090 systime.h xterm.h w32term.h w32gui.h font.h \
edfda783 1091 nsterm.h nsgui.h $(config_h)
a0528984 1092indent.o: indent.c frame.h window.h indent.h buffer.h $(config_h) termchar.h \
85969c22
KH
1093 termopts.h disptab.h region-cache.h character.h category.h composite.h \
1094 dispextern.h keyboard.h
1095insdel.o: insdel.c window.h buffer.h $(INTERVAL_SRC) blockinput.h character.h \
21065c92 1096 dispextern.h atimer.h systime.h region-cache.h $(config_h)
85969c22 1097keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \
a0528984 1098 commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \
08b3caa9 1099 systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h atimer.h \
9e2a2647 1100 xterm.h puresize.h msdos.h keymap.h w32term.h nsterm.h \
edfda783 1101 $(config_h)
a0528984 1102keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \
46538474 1103 atimer.h systime.h puresize.h character.h intervals.h keymap.h window.h \
b74e16a3 1104 $(config_h)
a0528984
EZ
1105lastfile.o: lastfile.c $(config_h)
1106macros.o: macros.c window.h buffer.h commands.h macros.h keyboard.h \
1107 dispextern.h $(config_h)
1108malloc.o: malloc.c $(config_h)
1109gmalloc.o: gmalloc.c $(config_h)
1110ralloc.o: ralloc.c $(config_h)
1111vm-limit.o: vm-limit.c mem-limits.h $(config_h)
85969c22 1112marker.o: marker.c buffer.h character.h $(config_h)
39c9a034 1113md5.o: md5.c md5.h $(config_h)
a0528984 1114minibuf.o: minibuf.c syntax.h dispextern.h frame.h window.h keyboard.h \
c73bd236 1115 buffer.h commands.h character.h msdos.h $(INTERVAL_SRC) keymap.h \
47632e43 1116 termhooks.h $(config_h)
a0528984 1117mktime.o: mktime.c $(config_h)
a0528984 1118msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \
85969c22 1119 termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \
ffb72b67 1120 keyboard.h intervals.h buffer.h commands.h blockinput.h atimer.h $(config_h)
55737942
AR
1121nsfns.o: nsfns.m charset.h nsterm.h nsgui.h frame.h window.h buffer.h \
1122 dispextern.h nsgui.h fontset.h $(INTERVAL_SRC) keyboard.h blockinput.h \
1123 atimer.h systime.h epaths.h termhooks.h coding.h systime.h $(config_h)
1124nsfont.o: nsterm.h dispextern.h frame.h lisp.h $(config_h)
1125nsimage.o: nsimage.m nsterm.h $(config_h)
1126nsmenu.o: nsmenu.m termhooks.h frame.h window.h dispextern.h \
1127 nsgui.h keyboard.h blockinput.h atimer.h systime.h buffer.h \
1128 nsterm.h $(config_h)
1129nsterm.o: nsterm.m blockinput.h atimer.h systime.h syssignal.h nsterm.h \
1130 nsgui.h frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h \
1131 termopts.h termchar.h disptab.h buffer.h window.h keyboard.h \
1132 $(INTERVAL_SRC) process.h coding.h $(config_h)
1133nsselect.o: nsselect.m blockinput.h nsterm.h nsgui.h frame.h $(config_h)
a0528984
EZ
1134process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \
1135 commands.h syssignal.h systime.h systty.h syswait.h frame.h dispextern.h \
1136 blockinput.h atimer.h charset.h coding.h ccl.h msdos.h composite.h \
1137 keyboard.h $(config_h)
85969c22
KH
1138regex.o: regex.c syntax.h buffer.h $(config_h) regex.h category.h character.h \
1139 charset.h
dd6ab82f 1140region-cache.o: region-cache.c buffer.h region-cache.h $(config_h)
a0528984 1141scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \
91b726f0 1142 termhooks.h $(config_h)
a0528984 1143search.o: search.c regex.h commands.h buffer.h region-cache.h syntax.h \
6660e3a8
KH
1144 blockinput.h atimer.h systime.h category.h character.h charset.h \
1145 composite.h $(INTERVAL_SRC) \
85969c22 1146 $(config_h)
a0528984 1147strftime.o: strftime.c $(config_h)
85969c22 1148syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \
21065c92 1149 composite.h keymap.h regex.h $(INTERVAL_SRC) $(config_h)
4524691f
RS
1150sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
1151 process.h dispextern.h termhooks.h termchar.h termopts.h \
91b726f0 1152 frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h $(config_h)
a0528984 1153term.o: term.c termchar.h termhooks.h termopts.h $(config_h) cm.h frame.h \
85969c22 1154 disptab.h dispextern.h keyboard.h character.h charset.h coding.h ccl.h \
f78c2c97
DN
1155 msdos.h window.h keymap.h blockinput.h atimer.h systime.h systty.h \
1156 syssignal.h $(INTERVAL_SRC)
a0528984 1157termcap.o: termcap.c $(config_h)
ed8dad6b
KL
1158terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
1159 keyboard.h $(config_h)
a0528984
EZ
1160terminfo.o: terminfo.c $(config_h)
1161tparam.o: tparam.c $(config_h)
9cb38333 1162undo.o: undo.c buffer.h commands.h window.h $(config_h)
f2a77c3a
DN
1163unexaix.o: unexaix.c $(config_h)
1164unexalpha.o: unexalpha.c $(config_h)
1165unexcw.o: unexcw.c $(config_h)
1166unexec.o: unexec.c $(config_h)
1167unexelf.o: unexelf.c $(config_h)
1168unexhp9k800.o: unexhp9k800.c $(config_h)
1169unexmacosx.o: unexmacosx.c $(config_h)
1170unexmips.o: unexmips.c $(config_h)
1171unexnext.o: unexnext.c $(config_h)
1172unexsol.o: unexsol.c $(config_h)
1173unexw32.o: unexw32.c $(config_h)
a0528984 1174w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
21065c92 1175 msdos.h buffer.h charset.h coding.h composite.h $(config_h)
a0528984
EZ
1176widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
1177 $(srcdir)/../lwlib/lwlib.h $(config_h)
1178window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
91b726f0 1179 disptab.h keyboard.h dispextern.h msdos.h composite.h \
ffb72b67 1180 keymap.h blockinput.h atimer.h systime.h $(INTERVAL_SRC) \
9e2a2647 1181 xterm.h w32term.h nsterm.h $(config_h)
a63aa692
MB
1182xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \
1183 coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \
d85d3839 1184 charset.h $(config_h) keyboard.h $(INTERVAL_SRC) region-cache.h xterm.h \
9e2a2647 1185 w32term.h nsterm.h msdos.h composite.h fontset.h \
08b3caa9 1186 blockinput.h atimer.h systime.h keymap.h font.h
a63aa692
MB
1187xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \
1188 window.h character.h charset.h msdos.h dosfns.h composite.h atimer.h \
9e2a2647 1189 systime.h keyboard.h fontset.h w32term.h nsterm.h \
08b3caa9 1190 $(INTERVAL_SRC) termchar.h termhooks.h font.h $(config_h)
a0528984
EZ
1191xfns.o: xfns.c buffer.h frame.h window.h keyboard.h xterm.h dispextern.h \
1192 $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h epaths.h \
7de94409 1193 character.h charset.h coding.h gtkutil.h $(config_h) termhooks.h \
0f91ebe6 1194 fontset.h termchar.h font.h
7de94409
KH
1195xfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
1196 font.h $(config_h)
1197xftfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
1198 font.h $(config_h)
1199ftxfont.o: dispextern.h xterm.h frame.h blockinput.h character.h charset.h \
1200 font.h $(config_h)
71015b45 1201menu.o: menu.c lisp.h keyboard.h keymap.h frame.h termhooks.h blockinput.h \
e7c9048f
AS
1202 dispextern.h $(srcdir)/../lwlib/lwlib.h xterm.h gtkutil.h menu.h \
1203 $(config_h)
c2d0b18a 1204xmenu.o: xmenu.c xterm.h termhooks.h window.h dispextern.h frame.h buffer.h \
85969c22 1205 charset.h keyboard.h $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h \
e7c9048f 1206 systime.h gtkutil.h msdos.h coding.h menu.h $(config_h)
c2d0b18a 1207xterm.o: xterm.c xterm.h termhooks.h termopts.h termchar.h window.h buffer.h \
85969c22 1208 dispextern.h frame.h disptab.h blockinput.h atimer.h systime.h syssignal.h \
73f838ad 1209 keyboard.h emacs-icon.h character.h charset.h ccl.h fontset.h composite.h \
85cf8992 1210 coding.h process.h gtkutil.h font.h fontset.h $(config_h)
4524691f 1211xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \
91b726f0 1212 buffer.h atimer.h systime.h termhooks.h $(config_h)
a0528984 1213xrdb.o: xrdb.c $(config_h) epaths.h
6b61353c
KH
1214xsmfns.o: xsmfns.c $(config_h) systime.h sysselect.h termhooks.h xterm.h \
1215 lisp.h termopts.h
033b73e2 1216gtkutil.o: gtkutil.c gtkutil.h xterm.h lisp.h frame.h $(config_h) \
ffb72b67 1217 blockinput.h window.h atimer.h systime.h termhooks.h keyboard.h \
f78c2c97 1218 charset.h coding.h syssignal.h
033b73e2 1219dbusbind.o: dbusbind.c termhooks.h $(config_h)
488dd4c4 1220
a0528984 1221hftctl.o: hftctl.c $(config_h)
f78c2c97
DN
1222sound.o: sound.c dispextern.h syssignal.h $(config_h)
1223atimer.o: atimer.c atimer.h syssignal.h systime.h $(config_h)
a0528984
EZ
1224
1225/* The files of Lisp proper */
1226
4524691f 1227alloc.o: alloc.c process.h frame.h window.h buffer.h puresize.h syssignal.h keyboard.h \
85969c22
KH
1228 blockinput.h atimer.h systime.h character.h dispextern.h $(config_h) \
1229 $(INTERVAL_SRC)
a63aa692 1230bytecode.o: bytecode.c buffer.h syntax.h character.h window.h dispextern.h \
21065c92 1231 frame.h xterm.h $(config_h)
a63aa692 1232data.o: data.c buffer.h puresize.h character.h syssignal.h keyboard.h frame.h \
c73bd236 1233 termhooks.h $(config_h)
a0528984 1234eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \
6b61353c 1235 dispextern.h $(config_h)
f78c2c97 1236floatfns.o: floatfns.c syssignal.h $(config_h)
85969c22 1237fns.o: fns.c commands.h $(config_h) frame.h buffer.h character.h keyboard.h \
21065c92 1238 keymap.h frame.h window.h dispextern.h $(INTERVAL_SRC) coding.h md5.h \
e18c7093 1239 blockinput.h atimer.h systime.h xterm.h termhooks.h
85969c22 1240print.o: print.c process.h frame.h window.h buffer.h keyboard.h character.h \
985773c9 1241 $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h \
0f91ebe6 1242 blockinput.h atimer.h systime.h font.h
85969c22 1243lread.o: lread.c commands.h keyboard.h buffer.h epaths.h character.h \
985773c9 1244 charset.h $(config_h) $(INTERVAL_SRC) termhooks.h coding.h msdos.h
a0528984
EZ
1245
1246/* Text properties support */
1247textprop.o: textprop.c buffer.h window.h dispextern.h $(INTERVAL_SRC) \
1248 $(config_h)
21065c92
EZ
1249intervals.o: intervals.c buffer.h $(INTERVAL_SRC) keyboard.h puresize.h \
1250 keymap.h $(config_h)
85969c22 1251composite.o: composite.c buffer.h character.h $(INTERVAL_SRC) $(config_h)
a0528984
EZ
1252
1253/* System-specific programs to be made.
1254 OTHER_FILES and OBJECTS_MACHINE
1255 select which of these should be compiled. */
1256
edfda783 1257#ifdef HAVE_NS
b330336c
AR
1258/* In fact, every .o file depends directly or indirectly on dispextern.h
1259 and hence nsgui.h under NS. But the ones that actually use stuff there
1260 are more limited. */
1261dispnew.o font.o fontset.o frame.o fringe.o image.o keyboard.o menu.o \
1262 window.o xdisp.o xfaces.o: nsgui.h
edfda783 1263
06b62770
AR
1264${ns_appdir}: ${ns_appsrc}
1265 rm -fr ${ns_appdir}
1266 mkdir -p ${ns_appdir}
1267 ( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; tar xf - )
e5e2baab 1268 ( cd ${ns_appdir} ; for subdir in `find . -type d ! -name CVS -print` ; do \
06b62770
AR
1269 chmod a+rx $${subdir} ; \
1270 rm -rf $${subdir}/CVS ; \
1271 rm -f $${subdir}/.cvsignore ; done ; )
edfda783 1272
06b62770
AR
1273${ns_appbindir}Emacs: emacs${EXEEXT}
1274 mkdir -p ${ns_appbindir}
1275 cp -f emacs${EXEEXT} ${ns_appbindir}Emacs
edfda783 1276
06b62770 1277ns-app: ${ns_appdir} ${ns_appbindir}Emacs
edfda783
AR
1278
1279#endif /* HAVE_NS */
e0f712ba 1280
a0528984 1281mostlyclean:
108c7c97 1282 rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
a0528984 1283 rm -f ../etc/DOC
b4945b95 1284 rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
bd45f31d 1285 rm -f buildobj.lst
a0528984 1286clean: mostlyclean
03bd3c1f 1287 rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT}
5c976973
AR
1288#ifdef HAVE_NS
1289 rm -fr ${ns_appdir}
5c976973 1290#endif
49f6eb95
SM
1291/* bootstrap-clean is used to clean up just before a bootstrap.
1292 It should remove all files generated during a compilation/bootstrap,
1293 but not things like config.status or TAGS. */
fd13748d
AS
1294bootstrap-clean: clean
1295 rm -f epaths.h config.h Makefile.c config.stamp stamp-oldxmenu ../etc/DOC-*
1296 if test -f ./.gdbinit; then \
1297 mv ./.gdbinit ./.gdbinit.save; \
1298 if test -f "${srcdir}/.gdbinit"; then rm -f ./.gdbinit.save; \
1299 else mv ./.gdbinit.save ./.gdbinit; fi; \
1300 fi
1301/**/# This is used in making a distribution.
1302/**/# Do not use it on development directories!
1303distclean: bootstrap-clean
1304 rm -f Makefile
a0528984
EZ
1305maintainer-clean: distclean
1306 @echo "This command is intended for maintainers to use;"
1307 @echo "it deletes files that may require special tools to rebuild."
1308 rm -f TAGS
1309versionclean:
03bd3c1f 1310 -rm -f emacs${EXEEXT} emacs-*.*.*${EXEEXT} ../etc/DOC*
a0528984
EZ
1311extraclean: distclean
1312 -rm -f *~ \#* m/?*~ s/?*~
1313
a0528984
EZ
1314/* Arrange to make a tags table TAGS-LISP for ../lisp,
1315 plus TAGS for the C files, which includes ../lisp/TAGS by reference. */
1316
c60ee5e7 1317ctagsfiles1 = [xyzXYZ]*.[hc]
a0528984
EZ
1318ctagsfiles2 = [a-wA-W]*.[hc]
1319
1320TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
1321 ../lib-src/etags --include=TAGS-LISP --include=${lwlibdir}/TAGS \
1322 --regex='/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
1323 $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
1324frc:
1325TAGS-LISP: frc
99b7e543 1326 $(MAKE) -f ${lispdir}Makefile TAGS-LISP ETAGS=../lib-src/etags
a0528984
EZ
1327
1328$(lwlibdir)TAGS:
1329 (cd $(lwlibdir); $(MAKE) -f $(lwlibdir)Makefile tags ETAGS=../lib-src/etags)
1330
1331tags: TAGS TAGS-LISP $(lwlibdir)TAGS
1332.PHONY: tags
1333
1334
1335/* Bootstrapping. */
fc46d219
SM
1336/* Bootstrapping right is difficult because of the circular dependencies.
1337 Furthermore, we have to deal with the fact that many compilation targets
1338 such as loaddefs.el or *.elc can typically be produced by any old
1339 Emacs executable, so we would like to avoid rebuilding them whenever
1340 we build a new Emacs executable.
1341 To solve the circularity, we use 2 different Emacs executables,
1342 "emacs" is the main target and "bootstrap-emacs" is the one used
1343 to build the *.elc and loaddefs.el files.
b4945b95
SM
1344 To solve the freshness issue, we used to use a third file "witness-emacs"
1345 which was used to witness the fact that there is a bootstrap-emacs
1346 executable, and then have dependencies on witness-emacs rather than
1347 bootstrap-emacs, but that lead to problems in parallel builds (because
1348 witness-emacs needed to be free from dependencies (to avoid rebuilding
1349 it), so it was compiled in parallel, leading typically to having 2
1350 processes dumping bootstrap-emacs at the same time).
1351 So instead, we replace the witness-emacs dependencies by conditional
1352 bootstrap-dependencies (via ${BOOTSTRAPEMACS}). Of course, since we do
1353 not want to rely on GNU Make features, we have to rely on an external
1354 script to do the conditional part of the dependency
1355 (i.e. see the ${SUBDIR} rule ../Makefile.in). */
fc46d219 1356
36565815
GM
1357.SUFFIXES: .elc .el
1358
b4945b95
SM
1359/* These suffix rules do not allow additional dependencies, sadly, so
1360 instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it
1361 separately below.
1362 With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)" */
fc46d219 1363.el.elc:
768efd84 1364 @cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \
b4945b95 1365 THEFILE=$< EMACS=../src/bootstrap-emacs${EXEEXT}
fc46d219 1366
b4945b95
SM
1367/* Since the .el.elc rule cannot specify an extra dependency, we do it here. */
1368${lisp} ${SOME_MACHINE_LISP}: $(BOOTSTRAPEMACS)
fc46d219 1369
56f6f760 1370${lispsource}loaddefs.el: $(BOOTSTRAPEMACS)
fb38e9c9 1371 cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=../src/bootstrap-emacs${EXEEXT}
49f6eb95 1372
c60ee5e7 1373/* Dump an Emacs executable named bootstrap-emacs containing the
a0528984
EZ
1374 files from loadup.el in source form. */
1375
fc46d219 1376bootstrap-emacs${EXEEXT}: temacs${EXEEXT}
b4945b95 1377 cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
a0528984 1378#ifdef CANNOT_DUMP
11d8ec4a 1379 ln -f temacs${EXEEXT} bootstrap-emacs${EXEEXT}
a0528984 1380#else
83f1cb94 1381 $(RUN_TEMACS) --batch --load loadup bootstrap
108c7c97 1382 mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
a0528984 1383#endif /* ! defined (CANNOT_DUMP) */
768efd84 1384 @: Compile some files earlier to speed up further compilation.
727f1976 1385 cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=../src/bootstrap-emacs${EXEEXT}