Commit | Line | Data |
---|---|---|
3de25479 | 1 | |
a0528984 | 2 | # Makefile for GNU Emacs. |
0b5538bd | 3 | # Copyright (C) 1985, 1987, 1988, 1993, 1994, 1995, 1999, 2000, 2001, 2002, |
b5457f14 GM |
4 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
5 | # Free Software Foundation, Inc. | |
a0528984 EZ |
6 | |
7 | # This file is part of GNU Emacs. | |
8 | ||
b9b1cc14 | 9 | # GNU Emacs is free software: you can redistribute it and/or modify |
a0528984 | 10 | # it under the terms of the GNU General Public License as published by |
b9b1cc14 GM |
11 | # the Free Software Foundation, either version 3 of the License, or |
12 | # (at your option) any later version. | |
a0528984 EZ |
13 | |
14 | # GNU Emacs is distributed in the hope that it will be useful, | |
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | # GNU General Public License for more details. | |
18 | ||
19 | # You should have received a copy of the GNU General Public License | |
b9b1cc14 | 20 | # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
a0528984 EZ |
21 | |
22 | ||
23 | # Note that this file is edited by msdos/sed1v2.inp for MSDOS. That | |
24 | # script may need modifying in sync with changes made here. Try to | |
25 | # avoid shell-ism because the DOS build has to use the DOS shell. | |
26 | ||
e20f1f07 | 27 | SHELL = /bin/sh |
a0528984 EZ |
28 | |
29 | # Here are the things that we expect ../configure to edit. | |
30 | # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH. | |
82c3d67a AS |
31 | srcdir = @srcdir@ |
32 | abs_builddir = @abs_builddir@ | |
33 | VPATH = $(srcdir) | |
34 | CC = @CC@ | |
82c3d67a AS |
35 | CFLAGS = @CFLAGS@ |
36 | CPPFLAGS = @CPPFLAGS@ | |
37 | LDFLAGS = @LDFLAGS@ | |
82c3d67a AS |
38 | EXEEXT = @EXEEXT@ |
39 | version = @version@ | |
a0528984 EZ |
40 | # Substitute an assignment for the MAKE variable, because |
41 | # BSD doesn't have it as a default. | |
42 | @SET_MAKE@ | |
43 | # Don't use LIBS. configure puts stuff in it that either shouldn't be | |
81ac4f35 | 44 | # linked with Emacs or is duplicated by the other stuff below. |
a0528984 EZ |
45 | # LIBS = @LIBS@ |
46 | LIBOBJS = @LIBOBJS@ | |
47 | ||
60a3d7ee | 48 | lispsource = ${srcdir}/../lisp/ |
60a3d7ee DN |
49 | libsrc = ../lib-src/ |
50 | etc = ../etc/ | |
51 | oldXMenudir = ../oldXMenu/ | |
52 | lwlibdir = ../lwlib/ | |
53 | lispdir = ../lisp/ | |
a0528984 EZ |
54 | |
55 | # Configuration files for .o files to depend on. | |
56 | M_FILE = ${srcdir}/@machfile@ | |
57 | S_FILE = ${srcdir}/@opsysfile@ | |
58 | config_h = config.h $(M_FILE) $(S_FILE) | |
59 | ||
82c3d67a | 60 | bootstrap_exe = ${abs_builddir}/bootstrap-emacs${EXEEXT} |
7763401b | 61 | |
1a82cca9 | 62 | ## ns-app if HAVE_NS, else empty. |
005bd5a2 DN |
63 | OTHER_FILES = @OTHER_FILES@ |
64 | ||
70eab5c1 GM |
65 | CRT_DIR=@CRT_DIR@ |
66 | ||
e6cfa7c3 AS |
67 | ## Flags to pass for profiling builds |
68 | PROFILING_CFLAGS = @PROFILING_CFLAGS@ | |
69 | PROFILING_LDFLAGS = @PROFILING_LDFLAGS@ | |
70 | ||
71 | ## Flags to pass to the compiler to enable build warnings | |
72 | C_WARNINGS_SWITCH = @C_WARNINGS_SWITCH@ | |
73 | ||
49628785 GM |
74 | ## Machine-specific CFLAGS. |
75 | C_SWITCH_MACHINE=@C_SWITCH_MACHINE@ | |
76 | ## System-specific CFLAGS. | |
77 | C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@ | |
5a903aa9 GM |
78 | |
79 | ## Currently only set if NS_IMPL_GNUSTEP. | |
80 | ## C_SWITCH_X_SITE may override this. | |
81 | C_SWITCH_X_SYSTEM=@C_SWITCH_X_SYSTEM@ | |
82 | ||
83 | ## Define C_SWITCH_X_SITE to contain any special flags your compiler | |
84 | ## may need to deal with X Windows. For instance, if you've defined | |
85 | ## HAVE_X_WINDOWS and your X include files aren't in a place that your | |
86 | ## compiler can find on its own, you might want to add "-I/..." or | |
87 | ## something similar. This is normally set by configure. | |
88 | ## This is used before C_SWITCH_X_SYSTEM and may override it. | |
89 | C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ | |
90 | ||
0116466b GM |
91 | ## Define LD_SWITCH_X_SITE to contain any special flags your loader |
92 | ## may need to deal with X Windows. For instance, if your X libraries | |
93 | ## aren't in a place that your loader can find on its own, you might | |
94 | ## want to add "-L/..." or something similar. Only used if | |
95 | ## HAVE_X_WINDOWS. | |
96 | ## FIXME? configure sets a value for this, but it has never been | |
97 | ## substituted in this or any other Makefile. Cf C_SWITCH_X_SITE. | |
98 | LD_SWITCH_X_SITE= | |
99 | ||
27a2cdfc GM |
100 | ## Next two must come before LD_SWITCH_SYSTEM. |
101 | ## If needed, a -R option that says where to find X windows at run time. | |
102 | LD_SWITCH_X_SITE_AUX=@LD_SWITCH_X_SITE_AUX@ | |
103 | ## As above, but using -rpath instead. | |
104 | LD_SWITCH_X_SITE_AUX_RPATH=@LD_SWITCH_X_SITE_AUX_RPATH@ | |
5a903aa9 | 105 | |
2f86b22b GM |
106 | ## System-specific LDFLAGS. |
107 | LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@ | |
5a903aa9 | 108 | |
8009a5e8 GM |
109 | ## This holds any special options for linking temacs only (ie, not |
110 | ## used by configure). Not used elsewhere because it sometimes | |
111 | ## contains options that have to do with using Emacs's crt0, | |
112 | ## which are only good with temacs. | |
113 | LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@ | |
114 | ||
2f86b22b | 115 | ## Flags to pass to ld only for temacs. |
ccd89fb3 | 116 | TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS) |
49628785 | 117 | |
e6cfa7c3 | 118 | ## $LDFLAGS $PROFILING_LDFLAGS, or empty if NS_IMPL_GNUSTEP (for some reason). |
b02a6645 | 119 | TEMACS_LDFLAGS2 = @TEMACS_LDFLAGS2@ |
49628785 | 120 | |
97efb629 GM |
121 | ## Some systems define this to request special libraries. |
122 | LIBS_SYSTEM=@LIBS_SYSTEM@ | |
123 | ||
1a0d7c06 GM |
124 | ## Where to find libgcc.a, if using gcc and necessary. |
125 | LIB_GCC=@LIB_GCC@ | |
126 | ||
c1d0dcfd GM |
127 | LD=@LINKER@ |
128 | ||
5a903aa9 GM |
129 | ## May use $CRT_DIR. |
130 | LIB_STANDARD=@LIB_STANDARD@ | |
131 | ||
132 | ## -lm, or empty. | |
133 | LIB_MATH=@LIB_MATH@ | |
134 | ||
0dc2e11d GM |
135 | LIBTIFF=@LIBTIFF@ |
136 | LIBJPEG=@LIBJPEG@ | |
137 | LIBPNG=@LIBPNG@ | |
138 | LIBGIF=@LIBGIF@ | |
139 | LIBXPM=@LIBXPM@ | |
140 | XFT_LIBS=@XFT_LIBS@ | |
3dee6fdb | 141 | LIBX_EXTRA=$(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) -lX11 $(XFT_LIBS) |
8d9c8ece | 142 | |
5a903aa9 GM |
143 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ |
144 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | |
145 | FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ | |
146 | FREETYPE_LIBS = @FREETYPE_LIBS@ | |
147 | LIBOTF_CFLAGS = @LIBOTF_CFLAGS@ | |
148 | LIBOTF_LIBS = @LIBOTF_LIBS@ | |
149 | M17N_FLT_CFLAGS = @M17N_FLT_CFLAGS@ | |
150 | M17N_FLT_LIBS = @M17N_FLT_LIBS@ | |
151 | ||
19d4c244 DN |
152 | DBUS_CFLAGS = @DBUS_CFLAGS@ |
153 | DBUS_LIBS = @DBUS_LIBS@ | |
10efe302 | 154 | DBUS_OBJ = @DBUS_OBJ@ |
19d4c244 DN |
155 | |
156 | GCONF_CFLAGS = @GCONF_CFLAGS@ | |
157 | GCONF_LIBS = @GCONF_LIBS@ | |
158 | ||
10efe302 GM |
159 | GTK_OBJ=@GTK_OBJ@ |
160 | ||
40c17879 GM |
161 | ## -ltermcap, or -lncurses, or -lcurses, or "". |
162 | LIBS_TERMCAP=@LIBS_TERMCAP@ | |
163 | ## terminfo.o if TERMINFO, else tparam.o. | |
164 | TERMCAP_OBJ=@TERMCAP_OBJ@ | |
165 | ||
294c50a0 GM |
166 | LIBXMU=@LIBXMU@ |
167 | ||
10efe302 GM |
168 | LIBXSM=@LIBXSM@ |
169 | ||
8fdac2c3 GM |
170 | LIBXTR6=@LIBXTR6@ |
171 | ||
3dee6fdb GM |
172 | ## $(LIBXMU) -lXt $(LIBXTR6) -lXext if USE_X_TOOLKIT, else $(LIBXSM). |
173 | ## Only used if HAVE_X_WINDOWS. | |
174 | LIBXT_OTHER=@LIBXT_OTHER@ | |
175 | ||
04384b2d GM |
176 | ## If !HAVE_X11 || USE_GTK, empty. |
177 | ## Else if USE_X_TOOLKIT really-lwlib, else really-oldxmenu. | |
1a82cca9 GM |
178 | OLDXMENU_TARGET=@OLDXMENU_TARGET@ |
179 | ||
c0b0aed5 GM |
180 | ## If !HAVE_X11 || USE_GTK, empty. |
181 | ## Else if USE_X_TOOLKIT, ${lwlibdir}liblw.a. | |
182 | ## Else ${oldXMenudir}libXMenu11.a. | |
04384b2d GM |
183 | ## (Actually, rather than being empty, it is set to "nothing". |
184 | ## It is never actually used for anything in this case. | |
185 | ## This is done because there is a rule with target $(OLDXMENU) below, | |
186 | ## and I think it might be a syntax error with some makes to have | |
187 | ## an empty target, even if the associated rule is never run. | |
188 | ## http://lists.gnu.org/archive/html/help-make/2010-05/msg00058.html | |
189 | ## The alternative would be to put that rule in a makefile fragment.) | |
c0b0aed5 GM |
190 | OLDXMENU=@OLDXMENU@ |
191 | ||
16455a85 GM |
192 | ## If HAVE_X11 && !USE_GTK, ${OLDXMENU} ../src/${OLDXMENU}; else empty. |
193 | ## We use stamp-xmenu with these two deps to both ensure that lwlib | |
194 | ## gets remade based on its dependencies in its own makefile, | |
195 | ## and remake temacs if lwlib gets changed by this. | |
196 | OLDXMENU_DEPS=@OLDXMENU_DEPS@ | |
197 | ||
4235ca47 GM |
198 | ## If !HAVE_X11 && HAVE_X_WINDOWS, -lXMenu (this case no longer possible). |
199 | ## Else if !HAVE_X11 || USE_GTK, empty. | |
200 | ## Else $(OLDXMENU). | |
201 | LIBXMENU=@LIBXMENU@ | |
202 | ||
10efe302 GM |
203 | XMENU_OBJ=@XMENU_OBJ@ |
204 | XOBJ=@XOBJ@ | |
205 | ||
986fb647 | 206 | TOOLKIT_LIBW=@TOOLKIT_LIBW@ |
b678dd8b | 207 | |
676b6304 GM |
208 | ## Only used if HAVE_X11, in LIBX_OTHER. |
209 | LIBXT=$(TOOLKIT_LIBW) $(LIBXT_OTHER) | |
210 | ||
8a95f0e7 GM |
211 | ## If HAVE_X11, $(LIBXT) $(LIBX_EXTRA), else empty. |
212 | LIBX_OTHER=@LIBX_OTHER@ | |
213 | ||
9beab9ce GM |
214 | ## LIBXMENU is nil if !HAVE_X_WINDOWS. |
215 | ## LD_SWITCH_X_SITE should not be used if not using X, but nothing | |
216 | ## sets it at present, and if something ever does, it should be | |
217 | ## configure, which should set it to nil in non-X builds. | |
218 | LIBX_BASE=$(LIBXMENU) $(LD_SWITCH_X_SITE) | |
219 | ||
19d4c244 DN |
220 | LIBSOUND= @LIBSOUND@ |
221 | CFLAGS_SOUND= @CFLAGS_SOUND@ | |
222 | ||
223 | RSVG_LIBS= @RSVG_LIBS@ | |
224 | RSVG_CFLAGS= @RSVG_CFLAGS@ | |
225 | ||
ce07fa9a JV |
226 | IMAGEMAGICK_LIBS= @IMAGEMAGICK_LIBS@ |
227 | IMAGEMAGICK_CFLAGS= @IMAGEMAGICK_CFLAGS@ | |
228 | ||
229 | ||
b678dd8b GM |
230 | ## widget.o if USE_X_TOOLKIT, otherwise empty. |
231 | WIDGET_OBJ=@WIDGET_OBJ@ | |
232 | ||
c40f9449 GM |
233 | ## sheap.o if CYGWIN, otherwise empty. |
234 | CYGWIN_OBJ=@CYGWIN_OBJ@ | |
235 | ||
dbd3f723 | 236 | ## dosfns.o msdos.o w16select.o if MSDOS. |
f14d1dfd GM |
237 | MSDOS_OBJ = |
238 | ## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS. | |
239 | MSDOS_X_OBJ = | |
240 | MSDOS_SUPPORT_REAL = ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \ | |
241 | ${lispsource}dos-fns.elc ${lispsource}dos-w32.elc ${lispsource}dos-vars.elc \ | |
242 | ${lispsource}term/internal.elc ${lispsource}term/pc-win.elc | |
243 | ## $MSDOS_SUPPORT_REAL if MSDOS. | |
244 | MSDOS_SUPPORT = | |
245 | ||
da53fab9 GM |
246 | ns_appdir=@ns_appdir@ |
247 | ns_appbindir=@ns_appbindir@ | |
177b0288 | 248 | ns_appsrc=@ns_appsrc@ |
e6ec4e99 GM |
249 | NS_OBJ=@NS_OBJ@ |
250 | NS_SUPPORT=@NS_SUPPORT@ | |
8877ca0f | 251 | ## Only set if NS_IMPL_GNUSTEP. |
5a903aa9 | 252 | GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@ |
e6ec4e99 | 253 | |
6e546d18 GM |
254 | ## Empty if !HAVE_X_WINDOWS |
255 | ## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT | |
256 | ## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE | |
257 | ## else xfont.o | |
bc0b5f61 GM |
258 | FONT_OBJ=@FONT_OBJ@ |
259 | ||
11842bd8 GM |
260 | ## Used if HAVE_MOUSE. |
261 | REAL_MOUSE_SUPPORT=${lispsource}mouse.elc ${lispsource}select.elc \ | |
262 | ${lispsource}scroll-bar.elc | |
263 | ## Used if HAVE_GPM && !HAVE_MOUSE | |
264 | GPM_MOUSE_SUPPORT=${lispsource}mouse.elc | |
5a903aa9 | 265 | LIBGPM = @LIBGPM@ |
11842bd8 GM |
266 | ## Either of the two preceding options, or empty. |
267 | MOUSE_SUPPORT=@MOUSE_SUPPORT@ | |
268 | ||
269 | ## ${lispsource}tooltip.elc if HAVE_WINDOW_SYSTEM, else empty. | |
270 | TOOLTIP_SUPPORT=@TOOLTIP_SUPPORT@ | |
658f86ca | 271 | |
faf535f8 GM |
272 | BASE_WINDOW_SUPPORT=${lispsource}fringe.elc ${lispsource}image.elc \ |
273 | ${lispsource}international/fontset.elc ${lispsource}dnd.elc \ | |
274 | ${lispsource}tool-bar.elc ${lispsource}mwheel.elc | |
275 | ||
276 | X_WINDOW_SUPPORT=${lispsource}x-dnd.elc ${lispsource}term/common-win.elc \ | |
277 | ${lispsource}term/x-win.elc ${lispsource}dynamic-setting.elc | |
278 | ||
11842bd8 GM |
279 | ## If HAVE_X_WINDOWS, both the above |
280 | ## else if HAVE_WINDOW_SYSTEM (ie, HAVE_NS) just the former; else empty. | |
281 | WINDOW_SUPPORT=@WINDOW_SUPPORT@ | |
282 | ||
5a903aa9 GM |
283 | ## -lresolv, or empty. |
284 | LIBRESOLV = @LIBRESOLV@ | |
285 | ||
2807228d GM |
286 | LIBSELINUX_LIBS = @LIBSELINUX_LIBS@ |
287 | ||
19d4c244 DN |
288 | INTERVALS_H = dispextern.h intervals.h composite.h |
289 | ||
290 | GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ | |
291 | ||
292 | RUN_TEMACS = `/bin/pwd`/temacs | |
293 | ||
49ebbd65 DN |
294 | START_FILES = @START_FILES@ |
295 | ||
eb697db5 | 296 | UNEXEC_OBJ = @UNEXEC_OBJ@ |
5a903aa9 | 297 | |
6259c2ec | 298 | CANNOT_DUMP=@CANNOT_DUMP@ |
e8752c66 | 299 | |
9d5cf9b6 GM |
300 | DEPDIR=deps |
301 | ## -MMD -MF ${DEPDIR}/$*.d if AUTO_DEPEND; else empty. | |
302 | DEPFLAGS=@DEPFLAGS@ | |
303 | ## test -d ${DEPDIR} || mkdir ${DEPDIR} (if AUTO_DEPEND); else ':'. | |
304 | MKDEPDIR=@MKDEPDIR@ | |
305 | ||
81ac4f35 GM |
306 | ## DO NOT use -R. There is a special hack described in lastfile.c |
307 | ## which is used instead. Some initialized data areas are modified | |
308 | ## at initial startup, then labeled as part of the text area when | |
309 | ## Emacs is dumped for the first time, and never changed again. | |
310 | ## | |
311 | ## -Demacs is needed to make some files produce the correct version | |
312 | ## for use in Emacs. | |
313 | ## | |
314 | ## -DHAVE_CONFIG_H is needed for some other files to take advantage of | |
315 | ## the information in `config.h'. | |
316 | ## | |
317 | ## C_SWITCH_X_SITE must come before C_SWITCH_X_SYSTEM | |
318 | ## since it may have -I options that should override those. | |
319 | ## | |
320 | ## FIXME? MYCPPFLAGS only referenced in etc/DEBUG. | |
321 | ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} \ | |
322 | ${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} ${C_SWITCH_X_SITE} \ | |
c05c21ed | 323 | ${C_SWITCH_X_SYSTEM} ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${IMAGEMAGICK_CFLAGS} ${DBUS_CFLAGS} \ |
e6cfa7c3 AS |
324 | ${GCONF_CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \ |
325 | ${LIBOTF_CFLAGS} ${M17N_FLT_CFLAGS} ${DEPFLAGS} ${PROFILING_CFLAGS} \ | |
326 | ${C_WARNINGS_SWITCH} ${CFLAGS} | |
5a903aa9 | 327 | ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS) |
48fad8e8 | 328 | |
edfda783 | 329 | .SUFFIXES: .m |
a0528984 | 330 | .c.o: |
9d5cf9b6 | 331 | @$(MKDEPDIR) |
a0528984 | 332 | $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< |
edfda783 | 333 | .m.o: |
9d5cf9b6 | 334 | @$(MKDEPDIR) |
48fad8e8 | 335 | $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $< |
a0528984 | 336 | |
edfda783 | 337 | |
81ac4f35 GM |
338 | ## lastfile must follow all files whose initialized data areas should |
339 | ## be dumped as pure by dump-emacs. | |
01ef9d36 | 340 | obj= dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ |
f44e260c | 341 | charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \ |
033b73e2 | 342 | cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \ |
a0528984 EZ |
343 | emacs.o keyboard.o macros.o keymap.o sysdep.o \ |
344 | buffer.o filelock.o insdel.o marker.o \ | |
345 | minibuf.o fileio.o dired.o filemode.o \ | |
346 | cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \ | |
347 | alloc.o data.o doc.o editfns.o callint.o \ | |
0f91ebe6 | 348 | eval.o floatfns.o fns.o font.o print.o lread.o \ |
5a903aa9 | 349 | syntax.o $(UNEXEC_OBJ) bytecode.o \ |
a0528984 EZ |
350 | process.o callproc.o \ |
351 | region-cache.o sound.o atimer.o \ | |
352 | doprnt.o strftime.o intervals.o textprop.o composite.o md5.o \ | |
6e546d18 | 353 | $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) |
a0528984 | 354 | |
81ac4f35 GM |
355 | ## Object files used on some machine or other. |
356 | ## These go in the DOC file on all machines in case they are needed. | |
04a697fe | 357 | SOME_MACHINE_OBJECTS = dosfns.o msdos.o \ |
d87a9ab8 | 358 | xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ |
25c72475 | 359 | fontset.o dbusbind.o \ |
a68fda4a | 360 | nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \ |
c9fc02c7 | 361 | w32.o w32console.o w32fns.o w32heap.o w32inevt.o \ |
6e546d18 | 362 | w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_OBJ) |
a0528984 | 363 | |
81ac4f35 | 364 | ## gmalloc.o if !SYSTEM_MALLOC && !DOUG_LEA_MALLOC, else empty. |
be4ff9da | 365 | GMALLOC_OBJ=@GMALLOC_OBJ@ |
2fa0eedf | 366 | |
81ac4f35 | 367 | ## vm-limit.o if !SYSTEM_MALLOC, else empty. |
be4ff9da | 368 | VMLIMIT_OBJ=@VMLIMIT_OBJ@ |
2fa0eedf | 369 | |
81ac4f35 | 370 | ## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty. |
40dc6bf4 | 371 | RALLOC_OBJ=@RALLOC_OBJ@ |
a0528984 | 372 | |
81ac4f35 | 373 | ## Empty on Cygwin, lastfile.o elsewhere. |
7acac9f4 | 374 | PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@ |
81ac4f35 | 375 | ## lastfile.o on Cygwin, empty elsewhere. |
7acac9f4 | 376 | POST_ALLOC_OBJ=@POST_ALLOC_OBJ@ |
a0528984 | 377 | |
81ac4f35 | 378 | ## List of object files that make-docfile should not be told about. |
40dc6bf4 | 379 | otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ |
6665f4c5 | 380 | $(POST_ALLOC_OBJ) $(VMLIMIT_OBJ) $(WIDGET_OBJ) $(LIBOBJS) |
a0528984 | 381 | |
81ac4f35 GM |
382 | ## This is the platform-specific list of Lisp files loaded into the |
383 | ## dumped Emacs. It is arranged like this because it is easier to generate | |
384 | ## it semi-mechanically from loadup.el this way. | |
385 | ## | |
386 | ## Note that this list should not include lisp files which might not | |
387 | ## be present, like site-load.el and site-init.el; this makefile | |
388 | ## expects them all to be either present or buildable. | |
389 | ## | |
390 | ## Files which are loaded unconditionally (i.e., on all platforms) should | |
391 | ## also be in shortlisp. Files which are loaded conditionally (i.e., only | |
392 | ## on some platforms) should instead be in SOME_MACHINE_LISP. | |
393 | ## | |
394 | ## Place loaddefs.el first, so it gets generated first, since it is on | |
395 | ## the critical path (relevant in parallel compilations). | |
a0528984 | 396 | lisp= \ |
b4945b95 | 397 | ${lispsource}loaddefs.el \ |
a0528984 EZ |
398 | ${lispsource}abbrev.elc \ |
399 | ${lispsource}buff-menu.elc \ | |
aae5b722 | 400 | ${lispsource}button.elc \ |
f984e73e | 401 | ${lispsource}emacs-lisp/byte-run.elc \ |
731055f5 | 402 | ${lispsource}composite.elc \ |
bfcf6dbe | 403 | ${lispsource}cus-face.elc \ |
d381a855 | 404 | ${lispsource}cus-start.elc \ |
a0528984 | 405 | ${lispsource}custom.elc \ |
6e860d15 | 406 | ${lispsource}emacs-lisp/backquote.elc \ |
a0528984 EZ |
407 | ${lispsource}emacs-lisp/lisp-mode.elc \ |
408 | ${lispsource}emacs-lisp/lisp.elc \ | |
409 | ${lispsource}env.elc \ | |
410 | ${lispsource}faces.elc \ | |
411 | ${lispsource}files.elc \ | |
412 | ${lispsource}format.elc \ | |
413 | ${lispsource}facemenu.elc \ | |
11842bd8 | 414 | ${MOUSE_SUPPORT} \ |
f984e73e | 415 | ${lispsource}emacs-lisp/float-sup.elc \ |
af0ad939 | 416 | ${lispsource}frame.elc \ |
a0528984 EZ |
417 | ${lispsource}help.elc \ |
418 | ${lispsource}indent.elc \ | |
419 | ${lispsource}isearch.elc \ | |
29f05691 | 420 | ${lispsource}rfn-eshadow.elc \ |
a0528984 | 421 | ${lispsource}loadup.el \ |
aae5b722 | 422 | ${lispsource}bindings.elc \ |
f984e73e | 423 | ${lispsource}emacs-lisp/map-ynp.elc \ |
a0528984 EZ |
424 | ${lispsource}menu-bar.elc \ |
425 | ${lispsource}international/mule.elc \ | |
e118d2be | 426 | ${lispsource}international/mule-conf.elc \ |
a0528984 EZ |
427 | ${lispsource}international/mule-cmds.elc \ |
428 | ${lispsource}international/characters.elc \ | |
15e2814c | 429 | ${lispsource}international/charprop.el \ |
a0528984 | 430 | ${lispsource}case-table.elc \ |
e118d2be AS |
431 | ${lispsource}language/chinese.elc \ |
432 | ${lispsource}language/cyrillic.elc \ | |
7e694795 | 433 | ${lispsource}language/indian.elc \ |
cc8d1311 | 434 | ${lispsource}language/sinhala.el \ |
74fc84af | 435 | ${lispsource}language/english.el \ |
a0528984 EZ |
436 | ${lispsource}language/ethiopic.elc \ |
437 | ${lispsource}language/european.elc \ | |
74fc84af EZ |
438 | ${lispsource}language/czech.el \ |
439 | ${lispsource}language/slovak.el \ | |
440 | ${lispsource}language/romanian.el \ | |
441 | ${lispsource}language/greek.el \ | |
6f2cdcd1 | 442 | ${lispsource}language/hebrew.elc \ |
74fc84af EZ |
443 | ${lispsource}language/japanese.el \ |
444 | ${lispsource}language/korean.el \ | |
445 | ${lispsource}language/lao.el \ | |
c9228487 | 446 | ${lispsource}language/cham.el \ |
16460a76 | 447 | ${lispsource}language/tai-viet.el \ |
74fc84af | 448 | ${lispsource}language/thai.el \ |
a0528984 | 449 | ${lispsource}language/tibetan.elc \ |
e118d2be | 450 | ${lispsource}language/vietnamese.elc \ |
74fc84af | 451 | ${lispsource}language/misc-lang.el \ |
1e9a6186 DL |
452 | ${lispsource}language/utf-8-lang.el \ |
453 | ${lispsource}language/georgian.el \ | |
0e45710c | 454 | ${lispsource}language/khmer.el \ |
7f6519c5 | 455 | ${lispsource}language/burmese.el \ |
a0528984 EZ |
456 | ${lispsource}paths.el \ |
457 | ${lispsource}register.elc \ | |
458 | ${lispsource}replace.elc \ | |
459 | ${lispsource}simple.elc \ | |
32bae13c | 460 | ${lispsource}minibuffer.elc \ |
a0528984 EZ |
461 | ${lispsource}startup.elc \ |
462 | ${lispsource}subr.elc \ | |
463 | ${lispsource}term/tty-colors.elc \ | |
bfcf6dbe | 464 | ${lispsource}font-core.elc \ |
1f7b1131 DN |
465 | ${lispsource}emacs-lisp/syntax.elc \ |
466 | ${lispsource}font-lock.elc \ | |
467 | ${lispsource}jit-lock.elc \ | |
a0528984 EZ |
468 | ${lispsource}textmodes/fill.elc \ |
469 | ${lispsource}textmodes/page.elc \ | |
470 | ${lispsource}textmodes/paragraphs.elc \ | |
471 | ${lispsource}textmodes/text-mode.elc \ | |
f984e73e | 472 | ${lispsource}emacs-lisp/timer.elc \ |
6e6851b0 | 473 | ${lispsource}jka-cmpr-hook.elc \ |
4176cba2 RF |
474 | ${lispsource}vc/vc-hooks.elc \ |
475 | ${lispsource}vc/ediff-hook.elc \ | |
86914123 | 476 | ${lispsource}epa-hook.elc \ |
11842bd8 | 477 | ${TOOLTIP_SUPPORT} \ |
f14d1dfd | 478 | ${MSDOS_SUPPORT} \ |
11842bd8 | 479 | ${WINDOW_SUPPORT} \ |
e6ec4e99 | 480 | ${NS_SUPPORT} \ |
a0528984 EZ |
481 | ${lispsource}widget.elc \ |
482 | ${lispsource}window.elc \ | |
483 | ${lispsource}version.el | |
484 | ||
81ac4f35 GM |
485 | ## List of relative names for those files from $lisp that are loaded |
486 | ## unconditionally (i.e. on all platforms). Files from $lisp that | |
487 | ## are only loaded on some platforms should instead be placed in | |
488 | ## SOME_MACHINE_LISP. The only reason this variable exists is to prevent | |
489 | ## the make-docfile command-line getting too long for some systems. | |
a0528984 | 490 | shortlisp= \ |
b4945b95 | 491 | ../lisp/loaddefs.el \ |
a0528984 EZ |
492 | ../lisp/abbrev.elc \ |
493 | ../lisp/buff-menu.elc \ | |
aae5b722 | 494 | ../lisp/button.elc \ |
f984e73e | 495 | ../lisp/emacs-lisp/byte-run.elc \ |
731055f5 | 496 | ../lisp/composite.elc \ |
bfcf6dbe | 497 | ../lisp/cus-face.elc \ |
d381a855 | 498 | ../lisp/cus-start.elc \ |
a0528984 | 499 | ../lisp/custom.elc \ |
f7d5d963 | 500 | ../lisp/emacs-lisp/backquote.elc \ |
a0528984 EZ |
501 | ../lisp/emacs-lisp/lisp-mode.elc \ |
502 | ../lisp/emacs-lisp/lisp.elc \ | |
503 | ../lisp/facemenu.elc \ | |
504 | ../lisp/faces.elc \ | |
505 | ../lisp/files.elc \ | |
f984e73e | 506 | ../lisp/emacs-lisp/float-sup.elc \ |
a0528984 EZ |
507 | ../lisp/format.elc \ |
508 | ../lisp/frame.elc \ | |
509 | ../lisp/help.elc \ | |
510 | ../lisp/indent.elc \ | |
511 | ../lisp/isearch.elc \ | |
29f05691 | 512 | ../lisp/rfn-eshadow.elc \ |
a0528984 | 513 | ../lisp/loadup.el \ |
aae5b722 | 514 | ../lisp/bindings.elc \ |
f984e73e | 515 | ../lisp/emacs-lisp/map-ynp.elc \ |
a0528984 EZ |
516 | ../lisp/env.elc \ |
517 | ../lisp/international/mule.elc \ | |
e118d2be | 518 | ../lisp/international/mule-conf.elc \ |
a0528984 EZ |
519 | ../lisp/international/mule-cmds.elc \ |
520 | ../lisp/international/characters.elc \ | |
521 | ../lisp/case-table.elc \ | |
e118d2be AS |
522 | ../lisp/language/chinese.elc \ |
523 | ../lisp/language/cyrillic.elc \ | |
7e694795 | 524 | ../lisp/language/indian.elc \ |
cc8d1311 | 525 | ../lisp/language/sinhala.el \ |
74fc84af | 526 | ../lisp/language/english.el \ |
a0528984 EZ |
527 | ../lisp/language/ethiopic.elc \ |
528 | ../lisp/language/european.elc \ | |
74fc84af EZ |
529 | ../lisp/language/czech.el \ |
530 | ../lisp/language/slovak.el \ | |
531 | ../lisp/language/romanian.el \ | |
532 | ../lisp/language/greek.el \ | |
6f2cdcd1 | 533 | ../lisp/language/hebrew.elc \ |
74fc84af EZ |
534 | ../lisp/language/japanese.el \ |
535 | ../lisp/language/korean.el \ | |
536 | ../lisp/language/lao.el \ | |
c9228487 | 537 | ../lisp/language/cham.el \ |
16460a76 | 538 | ../lisp/language/tai-viet.el \ |
74fc84af | 539 | ../lisp/language/thai.el \ |
a0528984 | 540 | ../lisp/language/tibetan.elc \ |
e118d2be | 541 | ../lisp/language/vietnamese.elc \ |
74fc84af | 542 | ../lisp/language/misc-lang.el \ |
1e9a6186 DL |
543 | ../lisp/language/utf-8-lang.el \ |
544 | ../lisp/language/georgian.el \ | |
0e45710c | 545 | ../lisp/language/khmer.el \ |
7f6519c5 | 546 | ../lisp/language/burmese.el \ |
f7d5d963 | 547 | ../lisp/menu-bar.elc \ |
a0528984 EZ |
548 | ../lisp/paths.el \ |
549 | ../lisp/register.elc \ | |
550 | ../lisp/replace.elc \ | |
551 | ../lisp/simple.elc \ | |
32bae13c | 552 | ../lisp/minibuffer.elc \ |
a0528984 EZ |
553 | ../lisp/startup.elc \ |
554 | ../lisp/subr.elc \ | |
555 | ../lisp/term/tty-colors.elc \ | |
59809627 | 556 | ../lisp/font-core.elc \ |
1f7b1131 DN |
557 | ../lisp/emacs-lisp/syntax.elc \ |
558 | ../lisp/font-lock.elc \ | |
559 | ../lisp/jit-lock.elc \ | |
a0528984 EZ |
560 | ../lisp/textmodes/fill.elc \ |
561 | ../lisp/textmodes/page.elc \ | |
562 | ../lisp/textmodes/paragraphs.elc \ | |
563 | ../lisp/textmodes/text-mode.elc \ | |
f984e73e | 564 | ../lisp/emacs-lisp/timer.elc \ |
4176cba2 RF |
565 | ../lisp/vc/vc-hooks.elc \ |
566 | ../lisp/vc/ediff-hook.elc \ | |
6e6851b0 | 567 | ../lisp/jka-cmpr-hook.elc \ |
86914123 | 568 | ../lisp/epa-hook.elc \ |
a0528984 EZ |
569 | ../lisp/widget.elc \ |
570 | ../lisp/window.elc \ | |
571 | ../lisp/version.el | |
572 | ||
81ac4f35 GM |
573 | ## Like $shortlisp, but includes only those files from $lisp that are loaded |
574 | ## conditionally (i.e., only on some platforms). | |
60a3d7ee DN |
575 | SOME_MACHINE_LISP = ../lisp/mouse.elc \ |
576 | ../lisp/select.elc ../lisp/scroll-bar.elc \ | |
60a3d7ee DN |
577 | ../lisp/ls-lisp.elc ../lisp/dos-fns.elc \ |
578 | ../lisp/w32-fns.elc ../lisp/dos-w32.elc \ | |
579 | ../lisp/disp-table.elc ../lisp/dos-vars.elc \ | |
580 | ../lisp/tooltip.elc ../lisp/image.elc \ | |
581 | ../lisp/fringe.elc ../lisp/dnd.elc \ | |
582 | ../lisp/mwheel.elc ../lisp/tool-bar.elc \ | |
f904c0f9 | 583 | ../lisp/x-dnd.elc ../lisp/dynamic-setting.elc \ |
60a3d7ee | 584 | ../lisp/international/ccl.elc \ |
60a3d7ee DN |
585 | ../lisp/international/fontset.elc \ |
586 | ../lisp/mouse.elc \ | |
24ed93fb | 587 | ../lisp/term/common-win.elc \ |
7206e7b7 | 588 | ../lisp/term/x-win.elc \ |
e227ba05 | 589 | ../lisp/term/pc-win.elc ../lisp/term/internal.elc \ |
b7d552d6 GM |
590 | ../lisp/term/ns-win.elc ../lisp/term/w32-win.elc \ |
591 | ../lisp/emacs-lisp/easymenu.elc | |
a0528984 | 592 | |
81ac4f35 GM |
593 | ## Construct full set of libraries to be linked. |
594 | ## Note that SunOS needs -lm to come before -lc; otherwise, you get | |
595 | ## duplicated symbols. If the standard libraries were compiled | |
596 | ## with GCC, we might need LIB_GCC again after them. | |
e58d4ff7 | 597 | LIBES = $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \ |
c05c21ed | 598 | $(RSVG_LIBS) ${IMAGEMAGICK_LIBS} $(DBUS_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ |
97efb629 | 599 | $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \ |
5a903aa9 | 600 | $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ |
c1d0dcfd | 601 | $(LIB_GCC) $(LIB_MATH) $(LIB_STANDARD) $(LIB_GCC) |
a0528984 | 602 | |
005bd5a2 | 603 | all: emacs${EXEEXT} $(OTHER_FILES) |
a0528984 | 604 | |
81ac4f35 GM |
605 | ## Does anyone ever pay attention to the load-path-shadows output here? |
606 | ## The dumped Emacs is as functional and more efficient than | |
607 | ## bootstrap-emacs, so we replace the latter with the former. | |
0c2b6f8e | 608 | emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp} |
e8752c66 GM |
609 | if test "${CANNOT_DUMP}" = "yes"; then \ |
610 | ln -f temacs${EXEEXT} emacs${EXEEXT}; \ | |
611 | EMACSLOADPATH=${lispsource} ./emacs -q -batch \ | |
612 | -f list-load-path-shadows || true; \ | |
613 | else \ | |
614 | LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \ | |
615 | ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}; \ | |
616 | ./emacs -q -batch -f list-load-path-shadows || true; \ | |
617 | fi | |
a0528984 | 618 | |
81ac4f35 GM |
619 | ## We run make-docfile twice because the command line may get too long |
620 | ## on some systems. | |
621 | ## ${SOME_MACHINE_OBJECTS} comes before ${obj} because some files may | |
622 | ## or may not be included in ${obj}, but they are always included in | |
623 | ## ${SOME_MACHINE_OBJECTS}. Since a file is processed when it is mentioned | |
624 | ## for the first time, this prevents any variation between configurations | |
625 | ## in the contents of the DOC file. | |
626 | ## Likewise for ${SOME_MACHINE_LISP}. | |
627 | ## Most of this Makefile refers to Lisp files via ${lispsource}, so | |
628 | ## we also use ${lisp} rather than ${shortlisp} for the dependency since | |
629 | ## the Makefile uses string equality to decide when we talk about identical | |
630 | ## files. Apparently we pass ${shortlisp} rather than ${lisp} to make-docfile | |
631 | ## only in order to reduce the command line length. --Stef | |
d7c664f3 | 632 | ${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${lisp} ${SOME_MACHINE_LISP} |
a0528984 EZ |
633 | -rm -f ${etc}DOC |
634 | ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC | |
635 | ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp} | |
636 | ||
108c7c97 AS |
637 | ${libsrc}make-docfile${EXEEXT}: |
638 | cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile${EXEEXT} | |
a0528984 | 639 | |
878bde49 | 640 | buildobj.h: Makefile |
005bd5a2 | 641 | echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h |
878bde49 | 642 | |
c1d0dcfd | 643 | |
49d9e6b0 DN |
644 | temacs${EXEEXT}: $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} |
645 | $(LD) ${TEMACS_LDFLAGS} ${TEMACS_LDFLAGS2} \ | |
8877ca0f | 646 | -o temacs ${START_FILES} ${obj} ${otherobj} ${LIBES} |
a0528984 | 647 | |
81ac4f35 GM |
648 | ## The following oldxmenu-related rules are only (possibly) used if |
649 | ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them | |
650 | ## (provided we take a little care that OLDXMENU is never empty). | |
a0528984 | 651 | really-lwlib: |
6b61353c | 652 | cd ${lwlibdir}; ${MAKE} ${MFLAGS} \ |
ed6281b0 | 653 | CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' |
81ac4f35 | 654 | @true # make -t should not create really-lwlib. |
a0528984 | 655 | .PHONY: really-lwlib |
a0528984 | 656 | |
a0528984 | 657 | really-oldXMenu: |
9c28b587 | 658 | cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \ |
ed6281b0 | 659 | CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' |
81ac4f35 | 660 | @true # make -t should not create really-oldXMenu. |
a0528984 | 661 | .PHONY: really-oldXMenu |
a0528984 | 662 | |
81ac4f35 GM |
663 | ## We do not really need this when OLDXMENU_DEPS is empty, but as |
664 | ## things stand we need something to satisfy the temacs dependency. | |
16455a85 | 665 | stamp-oldxmenu: ${OLDXMENU_DEPS} |
a0528984 | 666 | touch stamp-oldxmenu |
16455a85 | 667 | |
81ac4f35 | 668 | ## Supply an ordering for parallel make. |
1a82cca9 GM |
669 | ../src/$(OLDXMENU): ${OLDXMENU} |
670 | ||
671 | $(OLDXMENU): $(OLDXMENU_TARGET) | |
a0528984 EZ |
672 | |
673 | ../config.status:: epaths.in | |
674 | @echo "The file epaths.h needs to be set up from epaths.in." | |
675 | @echo "Please run the `configure' script again." | |
676 | exit 1 | |
677 | ||
678 | ../config.status:: config.in | |
679 | @echo "The file config.h needs to be set up from config.in." | |
680 | @echo "Please run the `configure' script again." | |
681 | exit 1 | |
682 | ||
a53cfbe5 | 683 | ecrt0.o: ecrt0.c $(config_h) |
9d5cf9b6 | 684 | @$(MKDEPDIR) |
19d4c244 | 685 | $(CC) -c $(ALL_CFLAGS) ${srcdir}/ecrt0.c |
a53cfbe5 JD |
686 | doc.o: buildobj.h |
687 | ||
a53cfbe5 | 688 | |
81ac4f35 | 689 | ## If HAVE_NS, some ns-specific rules (for OTHER_FILES) are inserted here. |
66dbf213 GM |
690 | @ns_frag@ |
691 | ||
e0f712ba | 692 | |
a0528984 | 693 | mostlyclean: |
49d9e6b0 | 694 | rm -f temacs${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a |
a0528984 | 695 | rm -f ../etc/DOC |
b4945b95 | 696 | rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT} |
878bde49 | 697 | rm -f buildobj.h |
a0528984 | 698 | clean: mostlyclean |
03bd3c1f | 699 | rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT} |
9d5cf9b6 | 700 | -rm -rf ${DEPDIR} |
7541dad5 GM |
701 | test "X${ns_appdir}" = "X" || rm -rf ${ns_appdir} |
702 | ||
81ac4f35 GM |
703 | ## bootstrap-clean is used to clean up just before a bootstrap. |
704 | ## It should remove all files generated during a compilation/bootstrap, | |
705 | ## but not things like config.status or TAGS. | |
fd13748d | 706 | bootstrap-clean: clean |
81ac4f35 | 707 | rm -f epaths.h config.h config.stamp stamp-oldxmenu ../etc/DOC-* |
fd13748d AS |
708 | if test -f ./.gdbinit; then \ |
709 | mv ./.gdbinit ./.gdbinit.save; \ | |
710 | if test -f "${srcdir}/.gdbinit"; then rm -f ./.gdbinit.save; \ | |
711 | else mv ./.gdbinit.save ./.gdbinit; fi; \ | |
712 | fi | |
81ac4f35 GM |
713 | ## This is used in making a distribution. |
714 | ## Do not use it on development directories! | |
fd13748d AS |
715 | distclean: bootstrap-clean |
716 | rm -f Makefile | |
a0528984 EZ |
717 | maintainer-clean: distclean |
718 | @echo "This command is intended for maintainers to use;" | |
719 | @echo "it deletes files that may require special tools to rebuild." | |
720 | rm -f TAGS | |
721 | versionclean: | |
03bd3c1f | 722 | -rm -f emacs${EXEEXT} emacs-*.*.*${EXEEXT} ../etc/DOC* |
a0528984 EZ |
723 | extraclean: distclean |
724 | -rm -f *~ \#* m/?*~ s/?*~ | |
725 | ||
81ac4f35 GM |
726 | ## Arrange to make a tags table TAGS-LISP for ../lisp, |
727 | ## plus TAGS for the C files, which includes ../lisp/TAGS by reference. | |
a0528984 | 728 | |
50da4e56 SM |
729 | ctagsfiles1 = [xyzXYZ]*.[hcm] |
730 | ctagsfiles2 = [a-wA-W]*.[hcm] | |
a0528984 EZ |
731 | |
732 | TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) | |
733 | ../lib-src/etags --include=TAGS-LISP --include=${lwlibdir}/TAGS \ | |
734 | --regex='/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \ | |
735 | $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) | |
736 | frc: | |
737 | TAGS-LISP: frc | |
99b7e543 | 738 | $(MAKE) -f ${lispdir}Makefile TAGS-LISP ETAGS=../lib-src/etags |
a0528984 EZ |
739 | |
740 | $(lwlibdir)TAGS: | |
741 | (cd $(lwlibdir); $(MAKE) -f $(lwlibdir)Makefile tags ETAGS=../lib-src/etags) | |
742 | ||
743 | tags: TAGS TAGS-LISP $(lwlibdir)TAGS | |
744 | .PHONY: tags | |
745 | ||
746 | ||
81ac4f35 GM |
747 | ### Bootstrapping. |
748 | ||
749 | ## Bootstrapping right is difficult because of the circular dependencies. | |
750 | ## Furthermore, we have to deal with the fact that many compilation targets | |
751 | ## such as loaddefs.el or *.elc can typically be produced by any old | |
752 | ## Emacs executable, so we would like to avoid rebuilding them whenever | |
753 | ## we build a new Emacs executable. | |
754 | ## To solve the circularity, we use 2 different Emacs executables, | |
755 | ## "emacs" is the main target and "bootstrap-emacs" is the one used | |
756 | ## to build the *.elc and loaddefs.el files. | |
757 | ## To solve the freshness issue, we used to use a third file "witness-emacs" | |
758 | ## which was used to witness the fact that there is a bootstrap-emacs | |
759 | ## executable, and then have dependencies on witness-emacs rather than | |
760 | ## bootstrap-emacs, but that lead to problems in parallel builds (because | |
761 | ## witness-emacs needed to be free from dependencies (to avoid rebuilding | |
762 | ## it), so it was compiled in parallel, leading typically to having 2 | |
763 | ## processes dumping bootstrap-emacs at the same time). | |
764 | ## So instead, we replace the witness-emacs dependencies by conditional | |
765 | ## bootstrap-dependencies (via ${BOOTSTRAPEMACS}). Of course, since we do | |
766 | ## not want to rely on GNU Make features, we have to rely on an external | |
767 | ## script to do the conditional part of the dependency | |
768 | ## (i.e. see the ${SUBDIR} rule ../Makefile.in). | |
fc46d219 | 769 | |
36565815 GM |
770 | .SUFFIXES: .elc .el |
771 | ||
81ac4f35 GM |
772 | ## These suffix rules do not allow additional dependencies, sadly, so |
773 | ## instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it | |
774 | ## separately below. | |
775 | ## With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)" | |
fc46d219 | 776 | .el.elc: |
82c3d67a AS |
777 | @cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \ |
778 | THEFILE=$< EMACS=${bootstrap_exe} | |
fc46d219 | 779 | |
81ac4f35 | 780 | ## Since the .el.elc rule cannot specify an extra dependency, we do it here. |
b4945b95 | 781 | ${lisp} ${SOME_MACHINE_LISP}: $(BOOTSTRAPEMACS) |
fc46d219 | 782 | |
81ac4f35 GM |
783 | ## VCSWITNESS points to the file that holds info about the current checkout. |
784 | ## We use it as a heuristic to decide when to rebuild loaddefs.el. | |
5b5262f4 | 785 | ${lispsource}loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS) |
82c3d67a | 786 | cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=${bootstrap_exe} |
49f6eb95 | 787 | |
81ac4f35 GM |
788 | ## Dump an Emacs executable named bootstrap-emacs containing the |
789 | ## files from loadup.el in source form. | |
fc46d219 | 790 | bootstrap-emacs${EXEEXT}: temacs${EXEEXT} |
b4945b95 | 791 | cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs |
e8752c66 GM |
792 | if test "${CANNOT_DUMP}" = "yes"; then \ |
793 | ln -f temacs${EXEEXT} bootstrap-emacs${EXEEXT}; \ | |
794 | else \ | |
795 | $(RUN_TEMACS) --batch --load loadup bootstrap || exit 1; \ | |
796 | mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}; \ | |
797 | fi | |
768efd84 | 798 | @: Compile some files earlier to speed up further compilation. |
82c3d67a | 799 | cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=${bootstrap_exe} |
a53cfbe5 | 800 | |
81ac4f35 | 801 | ## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk. |
9d5cf9b6 | 802 | @deps_frag@ |
81ac4f35 GM |
803 | |
804 | ||
805 | ### Makefile.in ends here |