|
|
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: CC = gcc -traditional ! 22: dot = . ! 23: /* on Xenix, replace double-dot below with $(dot)$(dot) */ ! 24: lispdir = ../lisp/ ! 25: etcdir = ../etc/ ! 26: shortnamesdir = ../shortnames/ ! 27: cppdir = ../cpp/ ! 28: oldXMenudir = ../oldXMenu/ ! 29: ! 30: #define NO_SHORTNAMES ! 31: #include "config.h" ! 32: ! 33: /* Use HAVE_X11 as an alias for X11 in this file ! 34: to avoid problems with X11 as a subdirectory name ! 35: in -I and other such options which pass through this file. */ ! 36: ! 37: #ifdef X11 ! 38: #define HAVE_X11 ! 39: #undef X11 ! 40: #endif ! 41: ! 42: /* On some machines #define register is done in config; ! 43: don't let it interfere with this file. */ ! 44: #undef register ! 45: ! 46: /* Some machines don't find the standard C libraries in the usual place. */ ! 47: #ifndef LIB_STANDARD ! 48: #define LIB_STANDARD -lc ! 49: #endif ! 50: ! 51: /* Unless inhibited or changed, use -lg to link for debugging. */ ! 52: #ifndef LIBS_DEBUG ! 53: #define LIBS_DEBUG -lg ! 54: #endif ! 55: ! 56: /* Some s- files define this to request special libraries. */ ! 57: #ifndef LIBS_SYSTEM ! 58: #define LIBS_SYSTEM ! 59: #endif ! 60: ! 61: /* Some m- files define this to request special libraries. */ ! 62: #ifndef LIBS_MACHINE ! 63: #define LIBS_MACHINE ! 64: #endif ! 65: ! 66: /* Some s- files define this to request special switches in ld. */ ! 67: #ifndef LD_SWITCH_SYSTEM ! 68: #if defined (BSD) && !defined (COFF) ! 69: #define LD_SWITCH_SYSTEM -X ! 70: #else ! 71: #define LD_SWITCH_SYSTEM ! 72: #endif /* COFF, or not BSD */ ! 73: #endif ! 74: ! 75: /* Some m- files define this to request special switches in ld. */ ! 76: #ifndef LD_SWITCH_MACHINE ! 77: #define LD_SWITCH_MACHINE ! 78: #endif ! 79: ! 80: /* Some m- files define this to request special switches in cc. */ ! 81: #ifndef C_SWITCH_MACHINE ! 82: #define C_SWITCH_MACHINE ! 83: #endif ! 84: ! 85: #ifndef C_SWITCH_SYSTEM ! 86: #define C_SWITCH_SYSTEM ! 87: #endif ! 88: ! 89: #ifndef START_FILES ! 90: #ifdef NO_REMAP ! 91: #define START_FILES pre-crt0.o /lib/crt0.o ! 92: #else ! 93: #define START_FILES crt0.o ! 94: #endif ! 95: #endif /* have START_FILES */ ! 96: STARTFILES = START_FILES ! 97: ! 98: /* Unless inhibited or changed, use -g to compile for debugging. */ ! 99: #ifndef C_DEBUG_SWITCH ! 100: #define C_DEBUG_SWITCH -g ! 101: #endif ! 102: ! 103: /* If user wants to optimize, this is how. */ ! 104: #ifndef C_OPTIMIZE_SWITCH ! 105: #define C_OPTIMIZE_SWITCH -O ! 106: #endif ! 107: ! 108: /* cc switches needed to make `asm' keyword work. ! 109: Nothing special needed on most machines. */ ! 110: #ifndef C_SWITCH_ASM ! 111: #define C_SWITCH_ASM ! 112: #endif ! 113: ! 114: /* Specify address for ld to start loading at, ! 115: if requested by configuration. */ ! 116: ! 117: #ifdef LD_TEXT_START_ADDR ! 118: STARTFLAGS = -T LD_TEXT_START_ADDR -e __start ! 119: #endif ! 120: ! 121: LD=ld ! 122: LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_MACHINE ! 123: ! 124: /* Figure out whether the system cpp can handle long names. ! 125: Do it by testing it right now. ! 126: If it loses, arrange to use the GNU cpp. */ ! 127: ! 128: #define LONGNAMEBBBFOOX ! 129: #ifdef LONGNAMEBBBARFOOX ! 130: /* Installed cpp fails to distinguish those names! */ ! 131: /* Arrange to compile the GNU cpp later on */ ! 132: #define NEED_CPP ! 133: /* Cause cc to invoke the cpp that comes with Emacs, ! 134: which will be in a file named localcpp. */ ! 135: MYCPPFLAG= -Blocal ! 136: /* LOCALCPP is the local one or nothing. ! 137: CPP is the local one or the standardone. */ ! 138: LOCALCPP= localcpp ! 139: #endif /* NEED_CPP */ ! 140: ! 141: #ifdef SHORTNAMES ! 142: SHORT= shortnames ! 143: #endif /* SHORTNAMES */ ! 144: ! 145: CFLAGS= C_OPTIMIZE_SWITCH -Demacs $(MYCPPFLAG) C_SWITCH_MACHINE C_SWITCH_SYSTEM ! 146: /* DO NOT use -R. There is a special hack described in lastfile.c ! 147: which is used instead. Some initialized data areas are modified ! 148: at initial startup, then labeled as part of the text area when ! 149: Emacs is dumped for the first time, and never changed again. */ ! 150: ! 151: /* You may replace C_DEBUG_SWITCH with C_OPTIMIZE_SWITCH ! 152: if you don't believe in debugging. */ ! 153: ! 154: /* -Demacs is needed to make some files produce the ! 155: correct version for use in Emacs. */ ! 156: ! 157: #ifndef LIBX10_MACHINE ! 158: #define LIBX10_MACHINE ! 159: #endif ! 160: ! 161: #ifndef LIBX11_MACHINE ! 162: #define LIBX11_MACHINE ! 163: #endif ! 164: ! 165: #ifndef LIBX10_SYSTEM ! 166: #define LIBX10_SYSTEM ! 167: #endif ! 168: ! 169: #ifndef LIBX11_SYSTEM ! 170: #define LIBX11_SYSTEM ! 171: #endif ! 172: ! 173: #ifdef HAVE_X_WINDOWS ! 174: #ifdef HAVE_X11 ! 175: #ifdef HAVE_X_MENU ! 176: OLDXMENU = libXMenu11.a ! 177: XOBJ = x11term.o x11fns.o xmenu.o ! 178: LIBX = $(OLDXMENU) -loldX -lX11 LIBX11_MACHINE LIBX11_SYSTEM ! 179: #else ! 180: XOBJ = x11term.o x11fns.o ! 181: LIBX = -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.