|
|
1.1 root 1: /* Makefile for GNU Emacs.
2: Copyright (C) 1985, 1987, 1988, 1990 Free Software Foundation, Inc.
3:
4: This file is part of GNU Emacs.
5:
6: GNU Emacs is free software; you can redistribute it and/or modify
7: it under the terms of the GNU General Public License as published by
8: the Free Software Foundation; either version 1, or (at your option)
9: any later version.
10:
11: GNU Emacs is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU General Public License for more details.
15:
16: You should have received a copy of the GNU General Public License
17: along with GNU Emacs; see the file COPYING. If not, write to
18: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19:
20:
21: dot = .
22: /* on Xenix, replace double-dot below with $(dot)$(dot) */
23: lispdir = $(dot)$(dot)/lisp/
24: etcdir = $(dot)$(dot)/etc/
25: shortnamesdir = $(dot)$(dot)/shortnames/
26: cppdir = $(dot)$(dot)/cpp/
27: oldXMenudir = $(dot)$(dot)/oldXMenu/
28:
29: /* Just to avoid uncertainty. */
30: SHELL = /bin/sh
31:
32: #define NO_SHORTNAMES
33: #include "config.h"
34:
35: /* Use HAVE_X11 as an alias for X11 in this file
36: to avoid problems with X11 as a subdirectory name
37: in -I and other such options which pass through this file. */
38:
39: #ifdef X11
40: #define HAVE_X11
41: #undef X11
42: #endif
43:
44: /* On some machines #define register is done in config;
45: don't let it interfere with this file. */
46: #undef register
47:
48: /* On some systems we may not to use the system make command. */
49: #ifdef MAKE_COMMAND
50: MAKE = MAKE_COMMAND
51: #else
52: MAKE=make
53: #endif
54:
55: #ifdef C_COMPILER
56: CC = C_COMPILER
57: #endif
58:
59: /* Some machines don't find the standard C libraries in the usual place. */
60: #ifndef ORDINARY_LINK
61: #ifndef LIB_STANDARD
62: #define LIB_STANDARD -lc
63: #endif
64: #else
65: #ifndef LIB_STANDARD
66: #define LIB_STANDARD
67: #endif
68: #endif
69:
70: /* Unless inhibited or changed, use -lg to link for debugging. */
71: #ifndef LIBS_DEBUG
72: #define LIBS_DEBUG -lg
73: #endif
74:
75: /* Some s- files define this to request special libraries. */
76: #ifndef LIBS_SYSTEM
77: #define LIBS_SYSTEM
78: #endif
79:
80: /* Some m- files define this to request special libraries. */
81: #ifndef LIBS_MACHINE
82: #define LIBS_MACHINE
83: #endif
84:
85: /* Some s- files define this to request special switches in ld. */
86: #ifndef LD_SWITCH_SYSTEM
87: #if defined (BSD) && !defined (COFF) && !defined (__GNUC__)
88: #define LD_SWITCH_SYSTEM -X
89: #else
90: #define LD_SWITCH_SYSTEM
91: #endif /* COFF, or not BSD */
92: #endif
93:
94: /* Some m- files define this to request special switches in ld. */
95: #ifndef LD_SWITCH_MACHINE
96: #define LD_SWITCH_MACHINE
97: #endif
98:
99: /* Some m- files define this to request special switches in cc. */
100: #ifndef C_SWITCH_MACHINE
101: #define C_SWITCH_MACHINE
102: #endif
103:
104: #ifndef C_SWITCH_SYSTEM
105: #define C_SWITCH_SYSTEM
106: #endif
107:
108: #ifndef C_SWITCH_X_MACHINE
109: #define C_SWITCH_X_MACHINE
110: #endif
111:
112: #ifndef C_SWITCH_X_SYSTEM
113: #define C_SWITCH_X_SYSTEM
114: #endif
115:
116: #ifndef ORDINARY_LINK
117: #ifndef START_FILES
118: #ifdef NO_REMAP
119: #define START_FILES pre-crt0.o /lib/crt0.o
120: #else
121: #define START_FILES crt0.o
122: #endif
123: #endif /* have START_FILES */
124: STARTFILES = START_FILES
125: #else /* ORDINARY_LINK */
126: STARTFILES = pre-crt0.o
127: #endif /* ORDINARY_LINK */
128:
129: /* This macro says how to compile for debugging.
130: If you want to optimize, DON'T change this macro.
131: Instead, replace C_DEBUG_SWITCH with C_OPTIMIZE_SWITCH
132: where CFLAGS is set. */
133: #ifndef C_DEBUG_SWITCH
134: #define C_DEBUG_SWITCH -g
135: #endif
136:
137: /* If user wants to optimize, this is how. */
138: #ifndef C_OPTIMIZE_SWITCH
139: #define C_OPTIMIZE_SWITCH -O
140: #endif
141:
142: /* cc switches needed to make `asm' keyword work.
143: Nothing special needed on most machines. */
144: #ifndef C_SWITCH_ASM
145: #define C_SWITCH_ASM
146: #endif
147:
148: /* Specify address for ld to start loading at,
149: if requested by configuration. */
150:
151: #ifdef LD_TEXT_START_ADDR
152: STARTFLAGS = -T LD_TEXT_START_ADDR -e __start
153: #endif
154:
155: #ifndef LINKER
156: #ifdef ORDINARY_LINK
157: LD = $(CC)
158: #else /* not ORDINARY_LINK */
159: #if __GNUC__ > 1
160: /* Search the proper places so that we can find -lgcc. */
161: #define LINKER gcc -nostdlib
162: #else
163: #define LINKER ld
164: #endif
165: #endif /* not ORDINARY_LINK */
166: #endif /* no LINKER */
167:
168: #ifdef LINKER
169: LD = LINKER
170: #endif
171: LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_MACHINE
172:
173: /* Figure out whether the system cpp can handle long names.
174: Do it by testing it right now.
175: If it loses, arrange to use the GNU cpp. */
176:
177: #define LONGNAMEBBBFOOX
178: #ifdef LONGNAMEBBBARFOOX
179: /* Installed cpp fails to distinguish those names! */
180: /* Arrange to compile the GNU cpp later on */
181: #define NEED_CPP
182: /* Cause cc to invoke the cpp that comes with Emacs,
183: which will be in a file named localcpp. */
184: MYCPPFLAG= -Blocal
185: /* LOCALCPP is the local one or nothing.
186: CPP is the local one or the standardone. */
187: LOCALCPP= localcpp
188: #endif /* NEED_CPP */
189:
190: #ifdef SHORTNAMES
191: SHORT= shortnames
192: #endif /* SHORTNAMES */
193:
194: CFLAGS= C_DEBUG_SWITCH -Demacs $(MYCPPFLAG) C_SWITCH_MACHINE C_SWITCH_SYSTEM C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM
195: /* DO NOT use -R. There is a special hack described in lastfile.c
196: which is used instead. Some initialized data areas are modified
197: at initial startup, then labeled as part of the text area when
198: Emacs is dumped for the first time, and never changed again. */
199:
200: /* You may replace C_DEBUG_SWITCH with C_OPTIMIZE_SWITCH
201: if you don't believe in debugging. */
202:
203: /* -Demacs is needed to make some files produce the
204: correct version for use in Emacs. */
205:
206: #ifndef LIBX10_MACHINE
207: #define LIBX10_MACHINE
208: #endif
209:
210: #ifndef LIBX11_MACHINE
211: #define LIBX11_MACHINE
212: #endif
213:
214: #ifndef LIBX10_SYSTEM
215: #define LIBX10_SYSTEM
216: #endif
217:
218: #ifndef LIBX11_SYSTEM
219: #define LIBX11_SYSTEM
220: #endif
221:
222: #ifndef LIB_X11_LIB
223: #define LIB_X11_LIB -lX11
224: #endif
225:
226: #ifdef HAVE_X_WINDOWS
227: #ifdef HAVE_X11
228: #ifdef HAVE_X_MENU
229: OLDXMENU = libXMenu11.a
230: XOBJ = x11term.o x11fns.o xmenu.o
231: LIBX = $(OLDXMENU) LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
232: #else
233: XOBJ = x11term.o x11fns.o
234: LIBX = LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
235: #endif
236: #else /* not HAVE_X11 */
237: #ifdef HAVE_X_MENU
238: XOBJ= xterm.o xfns.o xmenu.o
239: LIBX= -lXMenu -lX LIBX10_MACHINE LIBX10_SYSTEM
240: #else
241: XOBJ= xterm.o xfns.o
242: LIBX= -lX LIBX10_MACHINE LIBX10_SYSTEM
243: #endif /* not HAVE_X_MENU */
244: #endif /* not HAVE_X11 */
245: #endif /* HAVE_X_WINDOWS */
246:
247: /* Fix linking if compiled with GCC. */
248: #ifdef __GNUC__
249: #if __GNUC__ > 1
250: #ifndef LIB_GCC
251: #define LIB_GCC -lgcc
252: #endif
253: GNULIB_VAR = LIB_GCC
254: #else /* __GNUC__ <= 1 */
255: #ifndef LIB_GCC
256: #define LIB_GCC /usr/local/lib/gcc-gnulib
257: #endif
258: GNULIB_VAR = `if [ -f LIB_GCC ] ; then echo LIB_GCC; else echo; fi`
259: #endif /* __GNUC__ <= 1 */
260: #else
261: GNULIB_VAR =
262: #endif
263:
264: #ifdef MAINTAIN_ENVIRONMENT
265: environobj = environ.o
266: #endif /* MAINTAIN_ENVIRONMENT */
267:
268: /* Allow config.h to specify a replacement file for unexec.c. */
269: #ifndef UNEXEC
270: #define UNEXEC unexec.o
271: #endif
272:
273: /* lastfile must follow all files
274: whose initialized data areas should be dumped as pure by dump-emacs. */
275: obj= dispnew.o scroll.o xdisp.o window.o \
276: term.o cm.o $(XOBJ) \
277: emacs.o keyboard.o macros.o keymap.o sysdep.o \
278: buffer.o filelock.o insdel.o marker.o \
279: minibuf.o fileio.o dired.o filemode.o \
280: cmds.o casefiddle.o indent.o search.o regex.o undo.o \
281: alloc.o data.o doc.o editfns.o callint.o \
282: eval.o fns.o print.o lread.o \
283: abbrev.o syntax.o UNEXEC mocklisp.o bytecode.o \
284: process.o callproc.o $(environobj) \
285: doprnt.o
286:
287: #ifdef TERMINFO
288: /* Used to be -ltermcap here. If your machine needs that,
289: define LIBS_TERMCAP in the m- file. */
290: #ifndef LIBS_TERMCAP
291: #define LIBS_TERMCAP -lcurses
292: #endif
293: termcapobj = terminfo.o
294: #else
295: #ifndef LIBS_TERMCAP
296: #define LIBS_TERMCAP
297: termcapobj = termcap.o tparam.o
298: #else
299: termcapobj = tparam.o
300: #endif
301: #endif
302:
303: #ifndef SYSTEM_MALLOC
304: #ifdef HAVE_ALLOCA
305: mallocobj = malloc.o
306: #else
307: mallocobj = alloca.o malloc.o
308: #endif
309: #else /* SYSTEM_MALLOC */
310: #ifndef HAVE_ALLOCA
311: mallocobj = alloca.o
312: #endif
313: #endif
314:
315: /* define otherobj as list of object files that make-docfile
316: should not be told about. */
317: otherobj= $(termcapobj) lastfile.o $(mallocobj)
318:
319: /* List of Lisp files loaded into the dumped Emacs. */
320: lisp= ${lispdir}simple.elc ${lispdir}help.elc \
321: ${lispdir}files.elc ${lispdir}window.elc \
322: ${lispdir}indent.elc ${lispdir}loaddefs.el ${lispdir}paths.el \
323: ${lispdir}startup.elc ${lispdir}lisp.elc \
324: ${lispdir}page.elc ${lispdir}register.elc \
325: ${lispdir}paragraphs.elc ${lispdir}lisp-mode.elc \
326: ${lispdir}text-mode.elc ${lispdir}fill.elc \
327: ${lispdir}c-mode.elc ${lispdir}isearch.elc \
328: ${lispdir}replace.elc ${lispdir}abbrev.elc \
329: ${lispdir}buff-menu.elc ${lispdir}subr.elc
330:
331: /* just to be sure the sh is used */
332: SHELL=/bin/sh
333:
334: /* Construct full set of libraries to be linked. */
335: LIBES = LIBS_TERMCAP $(LIBX) LIBS_SYSTEM LIBS_MACHINE LIBS_DEBUG $(GNULIB_VAR) LIB_STANDARD
336:
337: /* Enable recompilation of certain other files depending on system type. */
338:
339: #ifndef OTHER_FILES
340: #define OTHER_FILES
341: #endif
342:
343: /* Enable inclusion of object files in temacs depending on system type. */
344: #ifndef OBJECTS_SYSTEM
345: #define OBJECTS_SYSTEM
346: #endif
347:
348: #ifndef OBJECTS_MACHINE
349: #define OBJECTS_MACHINE
350: #endif
351:
352: all: xemacs OTHER_FILES
353:
354: xemacs: temacs ${etcdir}DOC ${lisp}
355: #ifdef HAVE_SHM
356: ./temacs -nl -batch -l inc-vers
357: ./temacs -nl -batch -l loadup dump
358: ln temacs xemacs
359: #else
360: #ifdef CANNOT_DUMP
361: mv temacs xemacs
362: #else
363: ./temacs -batch -l inc-vers
364: ./temacs -batch -l loadup.el dump
365: #endif /* not CANNOT_DUMP */
366: #endif /* not HAVE_SHM */
367:
368: ${etcdir}DOC: ${etcdir}make-docfile ${obj} ${lisp}
369: rm -f ${etcdir}DOC
370: ${etcdir}make-docfile ${obj} ${lisp} ${lispdir}version.el > ${etcdir}DOC
371:
372: ${etcdir}make-docfile:
373: cd ${etcdir}; ${MAKE} ${MFLAGS} make-docfile
374:
375: /* Some systems define this to cause parallel Make-ing. */
376: #ifndef MAKE_PARALLEL
377: #define MAKE_PARALLEL
378: #endif
379:
380: temacs: MAKE_PARALLEL $(LOCALCPP) $(SHORT) $(STARTFILES) $(OLDXMENU) ${obj} ${otherobj} OBJECTS_SYSTEM OBJECTS_MACHINE
381: $(LD) ${STARTFLAGS} ${LDFLAGS} -o temacs ${STARTFILES} ${obj} ${otherobj} OBJECTS_SYSTEM OBJECTS_MACHINE ${LIBES}
382:
383: /* These are needed for C compilation, on the systems that need them */
384: #ifdef NEED_CPP
385: CPP = ./localcpp
386: localcpp:
387: cd ${cppdir}; ${MAKE} ${MFLAGS} EMACS=-DEMACS
388: ln ${cppdir}cpp localcpp /* Name where CFLAGS will refer to it */
389: /* cc appears to be cretinous and require all of these to exist
390: if -B is specified -- we can't use one local pass and let the
391: others be the standard ones. What a loser.
392: We can't even use ln, since they are probably
393: on different disks. */
394: cp /lib/ccom localccom
395: -cp /lib/optim localoptim
396: -cp /lib/c2 localc2
397: cp /bin/as localas
398: #else /* not NEED_CPP */
399: CPP = $(CC) -E
400: #endif /* need NEED_CPP */
401:
402: #ifdef SHORTNAMES
403: shortnames:
404: cd ${shortnamesdir}; ${MAKE} ${MFLAGS}
405: #endif /* SHORTNAMES */
406:
407: /* Don't lose if this was not defined. */
408: #ifndef OLDXMENU_OPTIONS
409: #define OLDXMENU_OPTIONS
410: #endif
411:
412: #ifdef HAVE_X_WINDOWS
413: #ifdef HAVE_X_MENU
414: #ifdef HAVE_X11
415: $(OLDXMENU):
416: cd ${oldXMenudir}; ${MAKE} ${MFLAGS} OLDXMENU_OPTIONS
417: ln ${oldXMenudir}libXMenu11.a $(OLDXMENU) || cp ${oldXMenudir}libXMenu11.a $(OLDXMENU)
418: #endif /* HAVE_X11 */
419: #endif /* HAVE_X_MENU */
420: #endif /* HAVE_X_WINDOWS */
421:
422: paths.h: paths.h-dist
423: echo paths.h needs to be set up from paths.h-dist
424: exit 1
425:
426: config.h: config.h-dist
427: echo config.h needs to be set up from config.h-dist
428: exit 1
429:
430: /* Some machines have alloca built-in.
431: They should define HAVE_ALLOCA, or may just let alloca.s
432: be used but generate no code.
433: Some have it written in assembler in alloca.s.
434: Some use the C version in alloca.c (these define C_ALLOCA in config.h).
435: */
436:
437: #ifdef C_ALLOCA
438: alloca.o : alloca.c
439: #else
440: #ifndef HAVE_ALLOCA
441: alloca.o : alloca.s config.h
442: /* $(CPP) is cc -E, which may get confused by filenames
443: that do not end in .c. So copy file to a safe name. */
444: cp alloca.s allocatem.c
445: /* remove any ^L, blank lines, and preprocessor comments,
446: since some assemblers barf on them */
447: $(CPP) allocatem.c | \
448: sed -e 's///' -e 's/^#.*//' | \
449: sed -n -e '/^..*$$/p' > allocatem.s
450: -rm -f alloca.o
451: /* Xenix, in particular, needs to run assembler via cc. */
452: cc -c allocatem.s
453: mv allocatem.o alloca.o
454: rm allocatem.s allocatem.c
455: #endif /* HAVE_ALLOCA */
456: #endif /* not C_ALLOCA */
457:
458: /* Nearly all the following files depend on lisp.h,
459: but it is not included as a dependency because
460: it is so often changed in ways that do not require any recompilation
461: and so rarely changed in ways that do require any. */
462:
463: abbrev.o : abbrev.c buffer.h commands.h config.h
464: buffer.o : buffer.c syntax.h buffer.h commands.h window.h config.h
465: callint.o : callint.c window.h commands.h buffer.h config.h
466: callproc.o : callproc.c paths.h buffer.h commands.h config.h
467: casefiddle.o : casefiddle.c syntax.h commands.h buffer.h config.h
468: cm.o : cm.c cm.h termhooks.h config.h
469: cmds.o : cmds.c syntax.h buffer.h commands.h config.h
470: crt0.o : crt0.c config.h
471: $(CC) -c $(CFLAGS) C_SWITCH_ASM crt0.c
472: dired.o : dired.c commands.h buffer.h config.h regex.h
473: dispnew.o : dispnew.c commands.h window.h buffer.h dispextern.h termchar.h termopts.h cm.h config.h lisp.h
474: doc.o : doc.c buffer.h config.h paths.h
475: doprnt.o : doprnt.c
476: editfns.o : editfns.c window.h buffer.h config.h
477: emacs.o : emacs.c commands.h config.h
478: #ifdef MAINTAIN_ENVIRONMENT
479: environ.o : environ.c buffer.h commands.h config.h
480: #endif /* MAINTAIN_ENVIRONMENT */
481: fileio.o : fileio.c window.h buffer.h config.h
482: filelock.o : filelock.c buffer.h paths.h config.h
483: filemode.o : filemode.c
484: indent.o : indent.c window.h indent.h buffer.h config.h termchar.h termopts.h
485: insdel.o : insdel.c window.h buffer.h config.h
486: keyboard.o : keyboard.c termchar.h termhooks.h termopts.h buffer.h commands.h window.h macros.h config.h
487: keymap.o : keymap.c buffer.h commands.h config.h
488: lastfile.o : lastfile.c
489: macros.o : macros.c window.h buffer.h commands.h macros.h config.h
490: malloc.o : malloc.c config.h
491: marker.o : marker.c buffer.h config.h
492: minibuf.o : minibuf.c syntax.h window.h buffer.h commands.h config.h
493: mocklisp.o : mocklisp.c buffer.h config.h
494: process.o : process.c process.h buffer.h window.h termhooks.h termopts.h commands.h dispextern.h config.h
495: regex.o : regex.c syntax.h buffer.h config.h regex.h
496: scroll.o : scroll.c termchar.h config.h dispextern.h termhooks.h
497: search.o : search.c regex.h commands.h buffer.h syntax.h config.h
498: syntax.o : syntax.c syntax.h buffer.h commands.h config.h
499: sysdep.o : sysdep.c config.h dispextern.h termhooks.h termchar.h termopts.h window.h
500: term.o : term.c termchar.h termhooks.h termopts.h config.h cm.h
501: termcap.o : termcap.c config.h
502: terminfo.o : terminfo.c config.h
503: tparam.o : tparam.c config.h
504: undo.o : undo.c buffer.h commands.h config.h
505: UNEXEC : config.h getpagesize.h
506: window.o : window.c indent.h commands.h window.h buffer.h config.h termchar.h
507: xdisp.o : xdisp.c macros.h commands.h indent.h buffer.h dispextern.h termchar.h window.h config.h
508: xfns.o : xfns.c xterm.h window.h config.h
509: xmenu.o : xmenu.c xterm.h window.h config.h
510: xterm.o : xterm.c xterm.h termhooks.h termopts.h termchar.h \
511: dispextern.h config.h sink.h sinkmask.h
512:
513: x11fns.o : x11fns.c window.h x11term.h dispextern.h termchar.h config.h
514: x11term.o : x11term.c x11term.h termhooks.h termopts.h termchar.h \
515: dispextern.h config.h sink11.h sink11mask.h lisp.h gettime.h emacssignal.h \
516: xkeys-aix.h
517:
518: /* The files of Lisp proper */
519:
520: alloc.o : alloc.c window.h buffer.h config.h
521: bytecode.o : bytecode.c buffer.h config.h
522: data.o : data.c buffer.h config.h
523: eval.o : eval.c commands.h config.h
524: fns.o : fns.c buffer.h commands.h config.h
525: print.o : print.c process.h window.h buffer.h dispextern.h termchar.h config.h
526: lread.o : lread.c buffer.h paths.h config.h
527:
528: /* System-specific programs to be made.
529: OTHER_FILES, OBJECTS_SYSTEM and OBJECTS_MACHINE
530: select which of these should be compiled. */
531:
532: sunfns.o : sunfns.c buffer.h config.h
533:
534: ${etcdir}emacstool: ${etcdir}emacstool.c
535: cd ${etcdir}; ${MAKE} ${MFLAGS} emacstool
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.