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