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