Makefile.in 38.2 KB
Newer Older
1
# Makefile for GNU Emacs.
2 3
# Copyright (C) 1985, 87, 88, 93, 94, 95, 99, 2000, 2001
# Free Software Foundation, Inc.
Jim Blandy's avatar
Jim Blandy committed
4

5
# This file is part of GNU Emacs.
Brian Fox's avatar
Brian Fox committed
6

7 8 9 10
# GNU Emacs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
Brian Fox's avatar
Brian Fox committed
11

12 13 14 15
# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
Brian Fox's avatar
Brian Fox committed
16

17 18
# You should have received a copy of the GNU General Public License
# along with GNU Emacs; see the file COPYING.  If not, write to
19 20
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
Brian Fox's avatar
Brian Fox committed
21

Dave Love's avatar
Dave Love committed
22 23 24 25 26 27 28 29

# Note that this file is edited by msdos/sed1v2.inp for MSDOS.  That
# script may need modifying in sync with changes made here.  Try to
# avoid shell-ism because the DOS build has to use the DOS shell.

# Don't try to replace the ccp processing using autoconf facilities,
# says rms.

30
# Here are the things that we expect ../configure to edit.
31
# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
Brian Fox's avatar
Brian Fox committed
32 33 34 35 36
srcdir=@srcdir@
VPATH=@srcdir@
CC=@CC@
CPP=@CPP@
CFLAGS=@CFLAGS@
37 38
CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@
Brian Fox's avatar
Brian Fox committed
39
LN_S=@LN_S@
40 41
# Substitute an assignment for the MAKE variable, because
# BSD doesn't have it as a default.
42
@SET_MAKE@
Dave Love's avatar
Dave Love committed
43 44 45
# Don't use LIBS.  configure puts stuff in it that either shouldn't be
# linked with Emacs or is duplicated by the cpp stuff below.
# LIBS = @LIBS@
Dave Love's avatar
Dave Love committed
46
LIBOBJS = @LIBOBJS@
Brian Fox's avatar
Brian Fox committed
47

48
# On Xenix and the IBM RS6000, double-dot gets screwed up.
Brian Fox's avatar
Brian Fox committed
49
dot = .
Karl Heuer's avatar
Karl Heuer committed
50
dotdot = ${dot}${dot}
51
lispsource = ${srcdir}/$(dot)$(dot)/lisp/
Brian Fox's avatar
Brian Fox committed
52 53 54
libsrc = $(dot)$(dot)/lib-src/
etc = $(dot)$(dot)/etc/
oldXMenudir = $(dot)$(dot)/oldXMenu/
55
lwlibdir = $(dot)$(dot)/lwlib/
56

57
# Configuration files for .o files to depend on.
58 59 60
M_FILE = ${srcdir}/@machfile@
S_FILE = ${srcdir}/@opsysfile@
config_h = config.h $(M_FILE) $(S_FILE)
Brian Fox's avatar
Brian Fox committed
61

Karl Heuer's avatar
Karl Heuer committed
62
# ========================== start of cpp stuff =======================
63 64
/* From here on, comments must be done in C syntax.  */

65 66
C_SWITCH_SYSTEM=

Brian Fox's avatar
Brian Fox committed
67 68 69
/* just to be sure the sh is used */
SHELL=/bin/sh

Karl Heuer's avatar
Karl Heuer committed
70
#define THIS_IS_MAKEFILE
Brian Fox's avatar
Brian Fox committed
71 72 73 74
#define NO_SHORTNAMES
#define NOT_C_CODE
#include "config.h"

Richard M. Stallman's avatar
Richard M. Stallman committed
75 76 77 78 79 80
/* We won't really call alloca;
   don't let the file name alloca.c get messed up.  */
#ifdef alloca
#undef alloca
#endif

81 82 83 84 85
/* Don't let the file name mktime.c get messed up.  */
#ifdef mktime
#undef mktime
#endif

Brian Fox's avatar
Brian Fox committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
/* Use HAVE_X11 as an alias for X11 in this file
   to avoid problems with X11 as a subdirectory name
   in -I and other such options which pass through this file. */

#ifdef X11
#define HAVE_X11
#undef X11
#endif

/* On some machines #define register is done in config;
   don't let it interfere with this file.  */
#undef register

/* On some systems we may not be able to use the system make command. */
#ifdef MAKE_COMMAND
MAKE = MAKE_COMMAND
#endif

#ifdef C_COMPILER
CC = C_COMPILER
#endif

108 109 110 111 112 113 114 115
/* GNU libc requires ORDINARY_LINK so that its own crt0 is used.
   Linux is an exception because it uses a funny variant of GNU libc.  */
#ifdef __GNU_LIBRARY__
#ifndef LINUX
#define ORDINARY_LINK
#endif
#endif

Brian Fox's avatar
Brian Fox committed
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
/* Some machines don't find the standard C libraries in the usual place.  */
#ifndef ORDINARY_LINK
#ifndef LIB_STANDARD
#define LIB_STANDARD -lc
#endif
#else
#ifndef LIB_STANDARD
#define LIB_STANDARD
#endif
#endif

/* Unless inhibited or changed, use -lg to link for debugging.  */
#ifndef LIBS_DEBUG
#define LIBS_DEBUG -lg
#endif

Karl Heuer's avatar
Karl Heuer committed
132
/* Some s/SYSTEM.h files define this to request special libraries.  */
Brian Fox's avatar
Brian Fox committed
133 134 135 136
#ifndef LIBS_SYSTEM
#define LIBS_SYSTEM
#endif

Karl Heuer's avatar
Karl Heuer committed
137
/* Some m/MACHINE.h files define this to request special libraries.  */
Brian Fox's avatar
Brian Fox committed
138 139 140 141 142 143 144 145
#ifndef LIBS_MACHINE
#define LIBS_MACHINE
#endif

#ifndef LIB_MATH
#  define LIB_MATH -lm
#endif /* LIB_MATH */

Karl Heuer's avatar
Karl Heuer committed
146
/* Some s/SYSTEM.h files define this to request special switches in ld.  */
Brian Fox's avatar
Brian Fox committed
147
#ifndef LD_SWITCH_SYSTEM
148
#if !defined (__GNUC__) && (defined(COFF_ENCAPSULATE) || (defined (BSD_SYSTEM) && !defined (COFF)))
Brian Fox's avatar
Brian Fox committed
149
#define LD_SWITCH_SYSTEM -X
150
#else /* ! defined(COFF_ENCAPSULATE) || (defined (BSD_SYSTEM) && !defined (COFF)) */
Brian Fox's avatar
Brian Fox committed
151
#define LD_SWITCH_SYSTEM
152
#endif /* ! defined(COFF_ENCAPSULATE) || (defined (BSD_SYSTEM) && !defined (COFF)) */
Brian Fox's avatar
Brian Fox committed
153 154
#endif /* LD_SWITCH_SYSTEM */

155 156 157 158 159 160
/* This holds special options for linking temacs
   that should be used for linking anything else.  */
#ifndef LD_SWITCH_SYSTEM_TEMACS
#define LD_SWITCH_SYSTEM_TEMACS
#endif

Karl Heuer's avatar
Karl Heuer committed
161
/* Some m/MACHINE.h files define this to request special switches in ld.  */
Brian Fox's avatar
Brian Fox committed
162 163 164 165
#ifndef LD_SWITCH_MACHINE
#define LD_SWITCH_MACHINE
#endif

166 167 168 169 170 171
/* This holds special options for linking temacs
   that should be used for linking anything else.  */
#ifndef LD_SWITCH_MACHINE_TEMACS
#define LD_SWITCH_MACHINE_TEMACS
#endif

Karl Heuer's avatar
Karl Heuer committed
172
/* Some m/MACHINE.h files define this to request special switches in cc.  */
Brian Fox's avatar
Brian Fox committed
173 174 175 176
#ifndef C_SWITCH_MACHINE
#define C_SWITCH_MACHINE
#endif

Karl Heuer's avatar
Karl Heuer committed
177
/* Some s/SYSTEM.h files define this to request special switches in cc.  */
Brian Fox's avatar
Brian Fox committed
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
#ifndef C_SWITCH_SYSTEM
#define C_SWITCH_SYSTEM
#endif

/* These macros are for switches specifically related to X Windows.  */
#ifndef C_SWITCH_X_MACHINE
#define C_SWITCH_X_MACHINE
#endif

#ifndef C_SWITCH_X_SYSTEM
#define C_SWITCH_X_SYSTEM
#endif

#ifndef C_SWITCH_X_SITE
#define C_SWITCH_X_SITE
#endif

#ifndef LD_SWITCH_X_SITE
#define LD_SWITCH_X_SITE
#endif

199 200 201 202
#ifndef LD_SWITCH_X_DEFAULT
#define LD_SWITCH_X_DEFAULT
#endif

Brian Fox's avatar
Brian Fox committed
203 204 205 206 207 208 209 210 211 212 213
/* These can be passed in from config.h to define special load and
   compile switches needed by individual sites */
#ifndef LD_SWITCH_SITE
#define LD_SWITCH_SITE
#endif

#ifndef C_SWITCH_SITE
#define C_SWITCH_SITE
#endif

#ifndef ORDINARY_LINK
214

Brian Fox's avatar
Brian Fox committed
215
#ifndef CRT0_COMPILE
216
#define CRT0_COMPILE $(CC) -c $(ALL_CFLAGS) C_SWITCH_ASM
Brian Fox's avatar
Brian Fox committed
217 218 219 220 221 222 223 224 225 226
#endif

#ifndef START_FILES
#ifdef NO_REMAP
#ifdef COFF_ENCAPSULATE
#define START_FILES pre-crt0.o /usr/local/lib/gcc-crt0.o
#else /* ! defined (COFF_ENCAPSULATE) */
#define START_FILES pre-crt0.o /lib/crt0.o
#endif /* ! defined (COFF_ENCAPSULATE) */
#else /* ! defined (NO_REMAP) */
227
#define START_FILES ecrt0.o
Brian Fox's avatar
Brian Fox committed
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
#endif /* ! defined (NO_REMAP) */
#endif /* START_FILES */
STARTFILES = START_FILES

#else /* ORDINARY_LINK */

/* config.h might want to force START_FILES anyway */
#ifdef START_FILES
STARTFILES = START_FILES
#endif /* START_FILES */

#endif /* not ORDINARY_LINK */


/* cc switches needed to make `asm' keyword work.
   Nothing special needed on most machines.  */
#ifndef C_SWITCH_ASM
#define C_SWITCH_ASM
#endif

Karl Heuer's avatar
Karl Heuer committed
248
#ifdef USE_X_TOOLKIT
Richard M. Stallman's avatar
Richard M. Stallman committed
249
#define USE_@X_TOOLKIT_TYPE@
Karl Heuer's avatar
Karl Heuer committed
250 251 252 253 254
TOOLKIT_DEFINES = -DUSE_@X_TOOLKIT_TYPE@
#else
TOOLKIT_DEFINES =
#endif

Brian Fox's avatar
Brian Fox committed
255 256 257 258 259 260 261 262 263 264
/* DO NOT use -R.  There is a special hack described in lastfile.c
   which is used instead.  Some initialized data areas are modified
   at initial startup, then labeled as part of the text area when
   Emacs is dumped for the first time, and never changed again. */

/* -Demacs is needed to make some files produce the correct version
   for use in Emacs.

   -DHAVE_CONFIG_H is needed for some other files to take advantage of
   the information in `config.h'.  */
265

Brian Fox's avatar
Brian Fox committed
266 267
/* C_SWITCH_X_SITE must come before C_SWITCH_X_MACHINE and C_SWITCH_X_SYSTEM
   since it may have -I options that should override those two.  */
Karl Heuer's avatar
Karl Heuer committed
268
ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(TOOLKIT_DEFINES) $(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}
Brian Fox's avatar
Brian Fox committed
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
.c.o:
	$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<

#ifndef LIBX10_MACHINE
#define LIBX10_MACHINE
#endif

#ifndef LIBX11_MACHINE
#define LIBX11_MACHINE
#endif

#ifndef LIBX10_SYSTEM
#define LIBX10_SYSTEM
#endif

#ifndef LIBX11_SYSTEM
#define LIBX11_SYSTEM
#endif

#ifndef LIB_X11_LIB
#define LIB_X11_LIB -lX11
#endif

#ifdef HAVE_X_WINDOWS
293
#ifdef HAVE_MENUS
Brian Fox's avatar
Brian Fox committed
294 295

/* Include xmenu.o in the list of X object files.  */
296
XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o
Brian Fox's avatar
Brian Fox committed
297 298 299 300 301

/* The X Menu stuff is present in the X10 distribution, but missing
   from X11.  If we have X10, just use the installed library;
   otherwise, use our own copy.  */
#ifdef HAVE_X11
302
#ifdef USE_X_TOOLKIT
303
OLDXMENU=${lwlibdir}liblw.a
304 305
LIBXMENU= $(OLDXMENU)
#else /* not USE_X_TOOLKIT */
306
OLDXMENU= ${oldXMenudir}libXMenu11.a
Brian Fox's avatar
Brian Fox committed
307
LIBXMENU= $(OLDXMENU)
308 309
#endif /* not USE_X_TOOLKIT */
#else /* not HAVE_X11 */
Brian Fox's avatar
Brian Fox committed
310
LIBXMENU= -lXMenu
311
#endif /* not HAVE_X11 */
Brian Fox's avatar
Brian Fox committed
312

313
#else /* not HAVE_MENUS */
Brian Fox's avatar
Brian Fox committed
314 315 316

/* Otherwise, omit xmenu.o from the list of X object files, and
   don't worry about the menu library at all.  */
317
XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o
Brian Fox's avatar
Brian Fox committed
318
LIBXMENU=
319
#endif /* not HAVE_MENUS */
320 321

#ifdef USE_X_TOOLKIT
322 323
#define @X_TOOLKIT_TYPE@
#if defined (LUCID) || defined (ATHENA)
324 325 326
#if HAVE_XAW3D
LIBW= -lXaw3d
#else
327 328
LIBW= -lXaw
#endif
329
#endif
330
#ifdef MOTIF
331
#if defined (HAVE_MOTIF_2_1) && defined (HAVE_LIBXP)
332 333 334 335
#define LIB_MOTIF_EXTRA -lXp
#else
#define LIB_MOTIF_EXTRA
#endif
336
#ifdef LIB_MOTIF
337
LIBW= LIB_MOTIF LIB_MOTIF_EXTRA
338
#else
339
LIBW= -lXm LIB_MOTIF_EXTRA
340 341 342 343 344 345
#endif
#endif
#ifdef OPEN_LOOK
LIBW= -lXol
#endif

346
#ifdef HAVE_X11XTR6
347 348 349
#ifdef NEED_LIBW
LIBXTR6 = -lSM -lICE -lw
#else
Richard M. Stallman's avatar
Richard M. Stallman committed
350 351
LIBXTR6 = -lSM -lICE
#endif
352
#endif
Richard M. Stallman's avatar
Richard M. Stallman committed
353

Richard M. Stallman's avatar
Richard M. Stallman committed
354 355 356 357
#ifndef LIBXMU
#define LIBXMU -lXmu
#endif

Karl Heuer's avatar
Karl Heuer committed
358 359 360 361
#ifdef LIBXT_STATIC
/* We assume the config files have defined STATIC_OPTION
   since that might depend on the operating system.
   (Don't forget you need different definitions with and without __GNUC__.)  */
362
LIBXT= STATIC_OPTION $(LIBW) LIBXMU -lXt $(LIBXTR6) -lXext DYNAMIC_OPTION
Karl Heuer's avatar
Karl Heuer committed
363
#else /* not LIBXT_STATIC */
Richard M. Stallman's avatar
Richard M. Stallman committed
364
LIBXT= $(LIBW) LIBXMU -lXt $(LIBXTR6) -lXext
Karl Heuer's avatar
Karl Heuer committed
365 366 367
#endif /* not LIBXT_STATIC */

#else /* not USE_X_TOOLKIT */
368
LIBXT=
Karl Heuer's avatar
Karl Heuer committed
369
#endif /* not USE_X_TOOLKIT */
Brian Fox's avatar
Brian Fox committed
370

371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
#if HAVE_XPM
#ifndef LIBXPM
#define LIBXPM -lXpm
#endif /* not defined LIBXPM */
#else /* not HAVE_XPM */
#define LIBXPM
#endif /* not HAVE_XPM */

#if HAVE_JPEG
#ifndef LIBJPEG
#define LIBJPEG -ljpeg
#endif /* not defined LIBJPEG */
#else /* not HAVE_JPEG */
#define LIBJPEG
#endif /* not HAVE_JPEG */

#if HAVE_PNG
#ifndef LIBPNG
#define LIBPNG -lpng -lz -lm
#endif /* not defined LIBPNG */
#else /* not HAVE_PNG */
#define LIBPNG
#endif /* not HAVE_PNG */

#if HAVE_TIFF
#ifndef LIBTIFF
397
#define LIBTIFF -ltiff
398 399 400 401 402 403 404 405 406 407 408 409 410
#endif /* not defined LIBTIFF */
#else /* not HAVE_TIFF */
#define LIBTIFF
#endif /* not HAVE_TIFF */

#if HAVE_GIF
#ifndef LIBGIF
#define LIBGIF -lungif
#endif /* not defined LIBGIF */
#else /* not HAVE_GIF */
#define LIBGIF
#endif /* not HAVE_GIF */

Brian Fox's avatar
Brian Fox committed
411
#ifdef HAVE_X11
412 413
/* LD_SWITCH_X_DEFAULT comes after everything else that specifies
   options for where to find X libraries, but before those libraries.  */
Richard M. Stallman's avatar
Richard M. Stallman committed
414
X11_LDFLAGS = LD_SWITCH_X_SITE LD_SWITCH_X_DEFAULT
415
LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) LIBTIFF LIBJPEG LIBPNG LIBGIF LIBXPM LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
416
#else /* not HAVE_X11 */
Brian Fox's avatar
Brian Fox committed
417
LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10 LIBX10_MACHINE LIBX10_SYSTEM
418 419
#endif /* not HAVE_X11 */
#endif /* not HAVE_X_WINDOWS */
Brian Fox's avatar
Brian Fox committed
420

421 422
LIBSOUND= @LIBSOUND@

Brian Fox's avatar
Brian Fox committed
423 424 425 426 427 428
#ifndef ORDINARY_LINK
/* Fix linking if compiled with GCC.  */
#ifdef __GNUC__

#if __GNUC__ > 1

429 430 431 432
#ifdef LINKER
#define LINKER_WAS_SPECIFIED
#endif

Brian Fox's avatar
Brian Fox committed
433 434 435 436 437 438 439 440
/* Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
   places that are difficult to figure out at make time.  Fortunately,
   these same versions allow you to pass arbitrary flags on to the
   linker, so there's no reason not to use it as a linker.

   Well, it's not quite perfect.  The `-nostdlib' keeps GCC from
   searching for libraries in its internal directories, so we have to
   ask GCC explicitly where to find libgcc.a.  */
441

Brian Fox's avatar
Brian Fox committed
442 443 444
#ifndef LINKER
#define LINKER $(CC) -nostdlib
#endif
445

Brian Fox's avatar
Brian Fox committed
446 447 448
#ifndef LIB_GCC
/* Ask GCC where to find libgcc.a.  */
#define LIB_GCC `$(CC) -print-libgcc-file-name`
449
#endif /* not LIB_GCC */
Joseph Arceneaux's avatar
Joseph Arceneaux committed
450

Brian Fox's avatar
Brian Fox committed
451
GNULIB_VAR = LIB_GCC
452

453
#ifndef LINKER_WAS_SPECIFIED
Brian Fox's avatar
Brian Fox committed
454 455 456 457 458 459
/* GCC passes any argument prefixed with -Xlinker directly to the
   linker.  See prefix-args.c for an explanation of why we don't do
   this with the shell's `for' construct.
   Note that some people don't have '.'  in their paths, so we must
   use ./prefix-args.  */
#define YMF_PASS_LDFLAGS(flags) `./prefix-args -Xlinker flags`
460 461 462
#else
#define YMF_PASS_LDFLAGS(flags) flags
#endif
463

Brian Fox's avatar
Brian Fox committed
464
#else /* __GNUC__ < 2 */
Joseph Arceneaux's avatar
Joseph Arceneaux committed
465

Brian Fox's avatar
Brian Fox committed
466 467
#ifndef LIB_GCC
#define LIB_GCC /usr/local/lib/gcc-gnulib
468
#endif /* not LIB_GCC */
Brian Fox's avatar
Brian Fox committed
469 470
GNULIB_VAR = `if [ -f LIB_GCC ] ; then echo LIB_GCC; else echo; fi`
#endif /* __GNUC__ < 2 */
471
#else /* not __GNUC__ */
472
GNULIB_VAR =
Joseph Arceneaux's avatar
Joseph Arceneaux committed
473

474
#endif /* not __GNUC__ */
Brian Fox's avatar
Brian Fox committed
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
#endif /* not ORDINARY_LINK */

/* Specify address for ld to start loading at,
   if requested by configuration.  */
#ifdef LD_TEXT_START_ADDR
STARTFLAGS = -T LD_TEXT_START_ADDR -e __start
#endif

#ifdef ORDINARY_LINK
LD = $(CC)
#else
#ifdef COFF_ENCAPSULATE
LD=$(CC) -nostdlib
#else /* not ORDINARY_LINK */
#ifdef LINKER
LD=LINKER
491
#else /* not LINKER */
Brian Fox's avatar
Brian Fox committed
492
LD=ld
493 494
#endif /* not LINKER */
#endif /* not COFF_ENCAPSULATE */
Brian Fox's avatar
Brian Fox committed
495 496
#endif /* not ORDINARY_LINK */

497
ALL_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE \
498
	 LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SITE $(LDFLAGS)
Brian Fox's avatar
Brian Fox committed
499

500
/* A macro which other sections of Makefile can redefine to munge the
Brian Fox's avatar
Brian Fox committed
501
   flags before they're passed to LD.  This is helpful if you have
502 503 504
   redefined LD to something odd, like "gcc".
   (The YMF prefix is a holdover from the old name "ymakefile".)
  */
Brian Fox's avatar
Brian Fox committed
505 506 507 508 509 510 511 512 513 514 515 516
#ifndef YMF_PASS_LDFLAGS
#define YMF_PASS_LDFLAGS(flags) flags
#endif

/* Allow config.h to specify a replacement file for unexec.c.  */
#ifndef UNEXEC
#define UNEXEC unexec.o
#endif
#ifndef UNEXEC_SRC
#define UNEXEC_SRC unexec.c
#endif

Dave Love's avatar
Dave Love committed
517
INTERVAL_SRC = intervals.h composite.h
Brian Fox's avatar
Brian Fox committed
518

Dave Love's avatar
Dave Love committed
519
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
Dave Love's avatar
Dave Love committed
520

Morten Welinder's avatar
Morten Welinder committed
521 522
#ifdef MSDOS
#ifdef HAVE_X_WINDOWS
Dave Love's avatar
Dave Love committed
523
MSDOS_OBJ = dosfns.o msdos.o
Morten Welinder's avatar
Morten Welinder committed
524
#else
Dave Love's avatar
Dave Love committed
525
MSDOS_OBJ = dosfns.o msdos.o w16select.o
Morten Welinder's avatar
Morten Welinder committed
526 527 528 529
#endif
#endif


Brian Fox's avatar
Brian Fox committed
530
/* lastfile must follow all files
Richard M. Stallman's avatar
Richard M. Stallman committed
531 532
   whose initialized data areas should be dumped as pure by dump-emacs.  */
obj=    dispnew.o frame.o scroll.o xdisp.o xmenu.o window.o \
533
	charset.o coding.o category.o ccl.o\
534
	cm.o term.o xfaces.o $(XOBJ) \
Brian Fox's avatar
Brian Fox committed
535
	emacs.o keyboard.o macros.o keymap.o sysdep.o \
Dave Love's avatar
Dave Love committed
536
	buffer.o filelock.o insdel.o marker.o \
Brian Fox's avatar
Brian Fox committed
537 538 539 540 541 542
	minibuf.o fileio.o dired.o filemode.o \
	cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
	alloc.o data.o doc.o editfns.o callint.o \
	eval.o floatfns.o fns.o print.o lread.o \
	abbrev.o syntax.o UNEXEC mocklisp.o bytecode.o \
	process.o callproc.o \
Gerd Moellmann's avatar
Gerd Moellmann committed
543
	region-cache.o sound.o atimer.o \
Gerd Moellmann's avatar
Gerd Moellmann committed
544
	doprnt.o strftime.o intervals.o textprop.o composite.o md5.o \
Dave Love's avatar
Dave Love committed
545
	$(MSDOS_OBJ)
Brian Fox's avatar
Brian Fox committed
546

547 548 549
/* Object files used on some machine or other.
   These go in the DOC file on all machines
   in case they are needed there.  */
Dave Love's avatar
Dave Love committed
550 551
SOME_MACHINE_OBJECTS = sunfns.o dosfns.o msdos.o \
  xterm.o xfns.o xmenu.o xselect.o xrdb.o
552

553

Brian Fox's avatar
Brian Fox committed
554 555
#ifdef TERMINFO
/* Used to be -ltermcap here.  If your machine needs that,
Karl Heuer's avatar
Karl Heuer committed
556
   define LIBS_TERMCAP in the m/MACHINE.h file.  */
Brian Fox's avatar
Brian Fox committed
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572
#ifndef LIBS_TERMCAP
#define LIBS_TERMCAP -lcurses
#endif /* LIBS_TERMCAP */
termcapobj = terminfo.o
#else /* ! defined (TERMINFO) */
#ifndef LIBS_TERMCAP
#define LIBS_TERMCAP
termcapobj = termcap.o tparam.o
#else /* LIBS_TERMCAP */
termcapobj = tparam.o
#endif /* LIBS_TERMCAP */
#endif /* ! defined (TERMINFO) */


#ifndef SYSTEM_MALLOC

573 574 575 576
#ifdef DOUG_LEA_MALLOC
#ifdef REL_ALLOC
mallocobj = ralloc.o vm-limit.o
#else /* ! defined (REL_ALLOC) */
577
mallocobj = vm-limit.o
578 579
#endif /* ! defined (REL_ALLOC) */
#else /* ! defined (DOUG_LEA_MALLOC) */
Brian Fox's avatar
Brian Fox committed
580 581 582 583 584
#ifdef REL_ALLOC
mallocobj = gmalloc.o ralloc.o vm-limit.o
#else /* ! defined (REL_ALLOC) */
mallocobj = gmalloc.o vm-limit.o
#endif /* ! defined (REL_ALLOC) */
585
#endif /* ! defined (DOUG_LEA_MALLOC) */
Brian Fox's avatar
Brian Fox committed
586 587 588 589 590 591 592 593 594 595

#endif /* SYSTEM_MALLOC */


#ifndef HAVE_ALLOCA
allocaobj = alloca.o
#else
allocaobj =
#endif

596 597 598 599 600 601
#ifdef USE_X_TOOLKIT
widgetobj= widget.o
#else /* not USE_X_TOOLKIT */
widgetobj=
#endif /* not USE_X_TOOLKIT */

Brian Fox's avatar
Brian Fox committed
602 603 604

/* define otherobj as list of object files that make-docfile
   should not be told about.  */
605
otherobj= $(termcapobj) lastfile.o $(mallocobj) $(allocaobj) $(widgetobj) $(LIBOBJS)
Brian Fox's avatar
Brian Fox committed
606

607
#ifdef HAVE_MOUSE
608
#define MOUSE_SUPPORT ${lispsource}mouse.elc \
609
  ${lispsource}select.elc ${lispsource}scroll-bar.elc
610 611 612 613
#else
#define MOUSE_SUPPORT
#endif

Brian Fox's avatar
Brian Fox committed
614
#ifdef VMS
615
#define VMS_SUPPORT ${lispsource}vmsproc.elc ${lispsource}vms-patch.elc
Brian Fox's avatar
Brian Fox committed
616 617 618 619
#else
#define VMS_SUPPORT
#endif

620
#ifdef MSDOS
621
#define MSDOS_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
622 623 624
 ${lispsource}dos-fns.elc ${lispsource}dos-w32.elc ${lispsource}dos-vars.elc \
 ${lispsource}international/ccl.elc ${lispsource}international/codepage.elc

625 626 627 628
#else
#define MSDOS_SUPPORT
#endif

629
#ifdef WINDOWSNT
Geoff Voelker's avatar
Geoff Voelker committed
630 631
#define WINNT_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}w32-fns.elc \
  ${lispsource}dos-w32.elc
632 633 634 635
#else
#define WINNT_SUPPORT
#endif

Brian Fox's avatar
Brian Fox committed
636 637 638 639 640 641
/* List of Lisp files loaded into the dumped Emacs.  It's arranged
   like this because it's easier to generate it semi-mechanically from
   loadup.el this way.

   Note that this list should not include lisp files which might not
   be present, like site-load.el and site-init.el; this makefile
Karl Heuer's avatar
Karl Heuer committed
642 643
   expects them all to be either present or buildable.

644 645 646
   Files which are loaded unconditionally should be in shortlisp as well.
   Files included conditionally here should be included (unconditionally)
   in SOME_MACHINE_LISP.  */
Karl Heuer's avatar
Karl Heuer committed
647

Brian Fox's avatar
Brian Fox committed
648
lisp= \
649 650 651
	${lispsource}abbrev.elc \
	${lispsource}buff-menu.elc \
	${lispsource}byte-run.elc \
652
	${lispsource}cus-start.el \
653
	${lispsource}custom.elc \
654 655
	${lispsource}emacs-lisp/lisp-mode.elc \
	${lispsource}emacs-lisp/lisp.elc \
Gerd Moellmann's avatar
Gerd Moellmann committed
656
	${lispsource}env.elc \
657
	${lispsource}faces.elc \
658 659
	${lispsource}files.elc \
	${lispsource}format.elc \
Dave Love's avatar
Dave Love committed
660
	${lispsource}facemenu.elc \
661
	MOUSE_SUPPORT \
Dave Love's avatar
Dave Love committed
662
	${lispsource}float-sup.elc \
Karl Heuer's avatar
Karl Heuer committed
663
	${lispsource}frame.elc\
664 665 666
	${lispsource}help.elc \
	${lispsource}indent.elc \
	${lispsource}isearch.elc \
Richard M. Stallman's avatar
Richard M. Stallman committed
667
	${lispsource}loadup.el \
668
	${lispsource}loaddefs.el \
669
	${lispsource}bindings.el \
670
	${lispsource}map-ynp.elc \
671
	${lispsource}menu-bar.elc \
672 673 674 675
	${lispsource}international/mule.elc \
	${lispsource}international/mule-conf.el \
	${lispsource}international/mule-cmds.elc \
	${lispsource}international/characters.elc \
676
	${lispsource}case-table.elc \
677 678
	${lispsource}language/chinese.elc \
	${lispsource}language/cyrillic.elc \
679
	${lispsource}language/indian.elc \
680
	${lispsource}language/devanagari.elc \
681
	${lispsource}language/english.elc \
682 683
	${lispsource}language/ethiopic.elc \
	${lispsource}language/european.elc \
684 685 686
	${lispsource}language/czech.elc \
	${lispsource}language/slovak.elc \
	${lispsource}language/romanian.elc \
687 688 689 690
	${lispsource}language/greek.elc \
	${lispsource}language/hebrew.elc \
	${lispsource}language/japanese.elc \
	${lispsource}language/korean.elc \
691
	${lispsource}language/lao.elc \
692
	${lispsource}language/thai.elc \
693
	${lispsource}language/tibetan.elc \
694 695
	${lispsource}language/vietnamese.elc \
	${lispsource}language/misc-lang.elc \
696 697 698 699 700 701
	${lispsource}paths.el \
	${lispsource}register.elc \
	${lispsource}replace.elc \
	${lispsource}simple.elc \
	${lispsource}startup.elc \
	${lispsource}subr.elc \
702
	${lispsource}term/tty-colors.elc \
703 704 705 706
	${lispsource}textmodes/fill.elc \
	${lispsource}textmodes/page.elc \
	${lispsource}textmodes/paragraphs.elc \
	${lispsource}textmodes/text-mode.elc \
707
	${lispsource}vc-hooks.elc \
708
	${lispsource}ediff-hook.elc \
Brian Fox's avatar
Brian Fox committed
709
	VMS_SUPPORT \
710
	MSDOS_SUPPORT \
711
	WINNT_SUPPORT \
712
	${lispsource}widget.elc \
713 714
	${lispsource}window.elc \
	${lispsource}version.el
Brian Fox's avatar
Brian Fox committed
715

Karl Heuer's avatar
Karl Heuer committed
716 717 718 719 720 721 722 723
/* These are relative file names for the Lisp files
   that are loaded unconditionally.  This is used in make-docfile.
   It need not contain the files that are loaded conditionally
   because SOME_MACHINE_LISP has those.  */
shortlisp= \
	../lisp/abbrev.elc \
	../lisp/buff-menu.elc \
	../lisp/byte-run.elc \
724
	../lisp/cus-start.el \
725
	../lisp/custom.elc \
726 727
	../lisp/emacs-lisp/lisp-mode.elc \
	../lisp/emacs-lisp/lisp.elc \
Dave Love's avatar
Dave Love committed
728
	../lisp/facemenu.elc \
729
	../lisp/faces.elc \
Karl Heuer's avatar
Karl Heuer committed
730
	../lisp/files.elc \
Dave Love's avatar
Dave Love committed
731
	../lisp/float-sup.elc \
Karl Heuer's avatar
Karl Heuer committed
732
	../lisp/format.elc \
Dave Love's avatar
Dave Love committed
733
	../lisp/frame.elc \
Karl Heuer's avatar
Karl Heuer committed
734 735 736 737 738
	../lisp/help.elc \
	../lisp/indent.elc \
	../lisp/isearch.elc \
	../lisp/loadup.el \
	../lisp/loaddefs.el \
739
	../lisp/bindings.el \
Karl Heuer's avatar
Karl Heuer committed
740
	../lisp/map-ynp.elc \
741 742 743
	../lisp/international/mule.elc \
	../lisp/international/mule-conf.el \
	../lisp/international/mule-cmds.elc \
Richard M. Stallman's avatar
Richard M. Stallman committed
744
	../lisp/international/characters.elc \
745
	../lisp/case-table.elc \
746 747
	../lisp/language/chinese.elc \
	../lisp/language/cyrillic.elc \
748
	../lisp/language/indian.elc \
749
	../lisp/language/devanagari.elc \
750
	../lisp/language/english.elc \
751 752
	../lisp/language/ethiopic.elc \
	../lisp/language/european.elc \
753 754 755
	../lisp/language/czech.elc \
	../lisp/language/slovak.elc \
	../lisp/language/romanian.elc \
756 757 758 759
	../lisp/language/greek.elc \
	../lisp/language/hebrew.elc \
	../lisp/language/japanese.elc \
	../lisp/language/korean.elc \
760
	../lisp/language/lao.elc \
761
	../lisp/language/thai.elc \
762
	../lisp/language/tibetan.elc \
763 764
	../lisp/language/vietnamese.elc \
	../lisp/language/misc-lang.elc \
Karl Heuer's avatar
Karl Heuer committed
765 766 767 768 769 770
	../lisp/paths.el \
	../lisp/register.elc \
	../lisp/replace.elc \
	../lisp/simple.elc \
	../lisp/startup.elc \
	../lisp/subr.elc \
771
	../lisp/term/tty-colors.elc \
772 773 774 775
	../lisp/textmodes/fill.elc \
	../lisp/textmodes/page.elc \
	../lisp/textmodes/paragraphs.elc \
	../lisp/textmodes/text-mode.elc \
Karl Heuer's avatar
Karl Heuer committed
776 777
	../lisp/vc-hooks.elc \
	../lisp/ediff-hook.elc \
778
	../lisp/widget.elc \
Karl Heuer's avatar
Karl Heuer committed
779 780 781
	../lisp/window.elc \
	../lisp/version.el

782
/* Lisp files that may or may not be used.
783
   We must unconditionally put them in the DOC file.
Karl Heuer's avatar
Karl Heuer committed
784 785 786
   We use ../lisp/ to start the file names
   to reduce the size of the argument list for make-docfile
   for the sake of systems which can't handle large ones.  */
Dave Love's avatar
Dave Love committed
787
SOME_MACHINE_LISP = ${dotdot}/lisp/menu-bar.elc ${dotdot}/lisp/mouse.elc \
Karl Heuer's avatar
Karl Heuer committed
788 789 790
  ${dotdot}/lisp/select.elc ${dotdot}/lisp/scroll-bar.elc \
  ${dotdot}/lisp/vmsproc.elc ${dotdot}/lisp/vms-patch.elc \
  ${dotdot}/lisp/ls-lisp.elc ${dotdot}/lisp/dos-fns.elc \
791 792 793 794
  ${dotdot}/lisp/w32-fns.elc ${dotdot}/lisp/dos-w32.elc \
  ${dotdot}/lisp/disp-table.elc ${dotdot}/lisp/dos-vars.elc \
  ${dotdot}/lisp/international/ccl.elc \
  ${dotdot}/lisp/international/codepage.elc
795

Brian Fox's avatar
Brian Fox committed
796 797
/* Construct full set of libraries to be linked.
   Note that SunOS needs -lm to come before -lc; otherwise, you get
798 799
   duplicated symbols.  If the standard libraries were compiled
   with GCC, we might need gnulib again after them.  */
800 801
LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) \
   LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
Dave Love's avatar
Dave Love committed
802 803
   LIBS_DEBUG $(GETLOADAVG_LIBS) $(GNULIB_VAR) LIB_MATH LIB_STANDARD \
   $(GNULIB_VAR)
Brian Fox's avatar
Brian Fox committed
804 805 806 807 808 809 810 811 812 813 814 815 816 817 818

/* Enable recompilation of certain other files depending on system type.  */

#ifndef OTHER_FILES
#define OTHER_FILES
#endif

#ifndef OBJECTS_MACHINE
#define OBJECTS_MACHINE
#endif

all: emacs OTHER_FILES

emacs: temacs ${etc}DOC ${lisp}
#ifdef CANNOT_DUMP
819
	rm -f emacs
Brian Fox's avatar
Brian Fox committed
820 821 822
	ln temacs emacs
#else
#ifdef HAVE_SHM
823
	LC_ALL=C ./temacs -nl -batch -l loadup dump
Brian Fox's avatar
Brian Fox committed
824
#else /* ! defined (HAVE_SHM) */
825
	LC_ALL=C ./temacs -batch -l loadup dump
Brian Fox's avatar
Brian Fox committed
826 827
#endif /* ! defined (HAVE_SHM) */
#endif /* ! defined (CANNOT_DUMP) */
828
	-./emacs -q -batch -f list-load-path-shadows
Brian Fox's avatar
Brian Fox committed
829

830 831
/* We run make-docfile twice because the command line may get too long
   on some systems.  */
832 833 834 835
/* ${SOME_MACHINE_OBJECTS} comes before ${obj} because some files may
   or may not be included in ${obj}, but they are always included in
   ${SOME_MACHINE_OBJECTS}.  Since a file is processed when it is mentioned
   for the first time, this prevents any variation between configurations
836 837
   in the contents of the DOC file.
   Likewise for ${SOME_MACHINE_LISP}.  */
838
${etc}DOC: ${libsrc}make-docfile ${obj} ${shortlisp} ${SOME_MACHINE_LISP}
839
	-rm -f ${etc}DOC
840
	${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC
Karl Heuer's avatar
Karl Heuer committed
841
	${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp}
Brian Fox's avatar
Brian Fox committed
842 843

${libsrc}make-docfile:
844
	cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile
Brian Fox's avatar
Brian Fox committed
845 846 847 848 849 850

/* Some systems define this to cause parallel Make-ing.  */
#ifndef MAKE_PARALLEL
#define MAKE_PARALLEL
#endif

Dave Love's avatar
Dave Love committed
851
temacs: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} OBJECTS_MACHINE prefix-args
852
	$(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${ALL_LDFLAGS}) \
Brian Fox's avatar
Brian Fox committed
853
    -o temacs ${STARTFILES} ${obj} ${otherobj}  \
Dave Love's avatar
Dave Love committed
854
    OBJECTS_MACHINE ${LIBES}
Brian Fox's avatar
Brian Fox committed
855

856 857 858
/* We don't use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
   often contain options that have to do with using Emacs's crt0,
   which are only good with temacs.  */
Brian Fox's avatar
Brian Fox committed
859
prefix-args: prefix-args.c $(config_h)
860
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) ${srcdir}/prefix-args.c -o prefix-args
Brian Fox's avatar
Brian Fox committed
861 862 863 864 865 866

/* Don't lose if this was not defined.  */
#ifndef OLDXMENU_OPTIONS
#define OLDXMENU_OPTIONS
#endif

867 868 869 870 871
/* Don't lose if this was not defined.  */
#ifndef LWLIB_OPTIONS
#define LWLIB_OPTIONS
#endif

872 873
#if defined (HAVE_X_WINDOWS) && defined (HAVE_X11) && defined (HAVE_MENUS)

874 875 876 877 878 879
/* We use stamp-xmenu with these two deps
   to both ensure that lwlib gets remade based on its dependencies
   in its own makefile,
   and remake temacs if lwlib gets changed by this.  */
stamp-oldxmenu: ${OLDXMENU} ../src/$(OLDXMENU) 
	touch stamp-oldxmenu
880 881
/* Supply an ordering for parallel make.  */
../src/$(OLDXMENU): ${OLDXMENU}
882

883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903
#ifdef USE_X_TOOLKIT
$(OLDXMENU): really-lwlib

/* Encode the values of these two macros in Make variables,
   so we can use $(...) to substitute their values within "...".  */
C_SWITCH_MACHINE_1 = C_SWITCH_MACHINE
C_SWITCH_SYSTEM_1 = C_SWITCH_SYSTEM
C_SWITCH_SITE_1 = C_SWITCH_SITE
C_SWITCH_X_SITE_1 = C_SWITCH_X_SITE
C_SWITCH_X_MACHINE_1 = C_SWITCH_X_MACHINE
C_SWITCH_X_SYSTEM_1 = C_SWITCH_X_SYSTEM
really-lwlib:
	cd ${lwlibdir}; ${MAKE} ${MFLAGS} LWLIB_OPTIONS \
    CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
    "C_SWITCH_X_SITE=$(C_SWITCH_X_SITE_1)" \
    "C_SWITCH_X_MACHINE=$(C_SWITCH_X_MACHINE_1)" \
    "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" \
    "C_SWITCH_SITE=$(C_SWITCH_SITE_1)" \
    "C_SWITCH_MACHINE=$(C_SWITCH_MACHINE_1)" \
    "C_SWITCH_SYSTEM=$(C_SWITCH_SYSTEM_1)"
	@true  /* make -t should not create really-lwlib.  */
904
.PHONY: really-lwlib
905
#else /* not USE_X_TOOLKIT */
Brian Fox's avatar
Brian Fox committed
906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925
$(OLDXMENU): really-oldXMenu

/* Encode the values of these two macros in Make variables,
   so we can use $(...) to substitute their values within "...".  */
C_SWITCH_MACHINE_1 = C_SWITCH_MACHINE
C_SWITCH_SYSTEM_1 = C_SWITCH_SYSTEM
C_SWITCH_SITE_1 = C_SWITCH_SITE
C_SWITCH_X_SITE_1 = C_SWITCH_X_SITE
C_SWITCH_X_MACHINE_1 = C_SWITCH_X_MACHINE
C_SWITCH_X_SYSTEM_1 = C_SWITCH_X_SYSTEM
really-oldXMenu:
	cd ${oldXMenudir}; ${MAKE} ${MFLAGS} OLDXMENU_OPTIONS \
    CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \
    "C_SWITCH_X_SITE=$(C_SWITCH_X_SITE_1)" \
    "C_SWITCH_X_MACHINE=$(C_SWITCH_X_MACHINE_1)" \
    "C_SWITCH_X_SYSTEM=$(C_SWITCH_X_SYSTEM_1)" \
    "C_SWITCH_SITE=$(C_SWITCH_SITE_1)" \
    "C_SWITCH_MACHINE=$(C_SWITCH_MACHINE_1)" \
    "C_SWITCH_SYSTEM=$(C_SWITCH_SYSTEM_1)"
	@true  /* make -t should not create really-oldXMenu.  */
926
.PHONY: really-oldXMenu
927
#endif /* not USE_X_TOOLKIT */
928 929 930 931 932 933
#else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS) */

/* We don't really need this, but satisfy the dependency.  */
stamp-oldxmenu:
	touch stamp-oldxmenu
#endif /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS) */
Brian Fox's avatar
Brian Fox committed
934

935 936
../config.status:: epaths.in
	@echo "The file epaths.h needs to be set up from epaths.in."
937
	@echo "Please run the `configure' script again."
Brian Fox's avatar
Brian Fox committed
938 939
	exit 1

940
../config.status:: config.in
941
	@echo "The file config.h needs to be set up from config.in."
942
	@echo "Please run the `configure' script again."
Brian Fox's avatar
Brian Fox committed
943 944 945 946 947 948 949 950 951 952 953 954 955 956
	exit 1

/* Some machines have alloca built-in.
   They should define HAVE_ALLOCA, or may just let alloca.s
   be used but generate no code.
   Some have it written in assembler in alloca.s.
   Some use the C version in alloca.c (these define C_ALLOCA in config.h).
   */

#ifdef C_ALLOCA
/* We could put something in alloca.c to #define free and malloc
   whenever emacs was #defined, but that's not appropriate for all
   users of alloca in Emacs.  Check out ../lib-src/getopt.c.  */
alloca.o : alloca.c
957
	$(CC) -c $(CPPFLAGS) -DEMACS_FREE=xfree \
Brian Fox's avatar
Brian Fox committed
958 959 960
	$(ALL_CFLAGS) ${srcdir}/alloca.c
#else
#ifndef HAVE_ALLOCA
961
alloca.o : alloca.s $(config_h)
Brian Fox's avatar
Brian Fox committed
962 963
/* $(CPP) is cc -E, which may get confused by filenames
   that do not end in .c.  So copy file to a safe name.  */
964
	-rm -f allocatem.c
Brian Fox's avatar
Brian Fox committed
965 966 967 968 969 970 971 972 973 974 975 976
	cp ${srcdir}/alloca.s allocatem.c
/* Remove any ^L, blank lines, and preprocessor comments,
   since some assemblers barf on them.  Use a different basename for the
   output file, since some stupid compilers (Green Hill's) use that
   name for the intermediate assembler file. */
	$(CPP) $(CPPFLAGS) $(ALL_CFLAGS) allocatem.c | \
	sed -e 's///' -e 's/^#.*//' | \
	sed -n -e '/^..*$$/p' > allocax.s
	-rm -f alloca.o
/* Xenix, in particular, needs to run assembler via cc.  */
	$(CC) -c allocax.s
	mv allocax.o alloca.o
977
	-rm -f allocax.s allocatem.c
Brian Fox's avatar
Brian Fox committed
978 979 980 981 982 983 984 985
#endif /* HAVE_ALLOCA */
#endif /* ! defined (C_ALLOCA) */

/* Nearly all the following files depend on lisp.h,
   but it is not included as a dependency because
   it is so often changed in ways that do not require any recompilation
   and so rarely changed in ways that do require any.  */

986 987
abbrev.o: abbrev.c buffer.h window.h dispextern.h commands.h charset.h \
	$(config_h)
988
buffer.o: buffer.c buffer.h region-cache.h commands.h window.h \
989 990
   dispextern.h $(INTERVAL_SRC) blockinput.h atimer.h systime.h charset.h \
   $(config_h)
991
callint.o: callint.c window.h commands.h buffer.h mocklisp.h \
992
   keyboard.h dispextern.h $(config_h)
993
callproc.o: callproc.c epaths.h buffer.h commands.h $(config_h) \
994 995
	process.h systty.h syssignal.h charset.h coding.h ccl.h msdos.h \
        composite.h
996
casefiddle.o: casefiddle.c syntax.h commands.h buffer.h composite.h $(config_h)
997
casetab.o: casetab.c buffer.h $(config_h)
998 999
category.o: category.c category.h buffer.h charset.h $(config_h)
ccl.o: ccl.c ccl.h charset.h coding.h $(config_h)
1000 1001
charset.o: charset.c charset.h buffer.h coding.h composite.h disptab.h \
	$(config_h)
1002
coding.o: coding.c coding.h ccl.h buffer.h charset.h $(config_h)
1003
cm.o: cm.c cm.h termhooks.h $(config_h)
1004
cmds.o: cmds.c syntax.h buffer.h charset.h commands.h window.h $(config_h) \
1005
	msdos.h dispextern.h
1006
pre-crt0.o: pre-crt0.c
1007 1008
ecrt0.o: ecrt0.c $(config_h)
	CRT0_COMPILE ${srcdir}/ecrt0.c
1009 1010
dired.o: dired.c commands.h buffer.h $(config_h) charset.h coding.h regex.h \
   systime.h