Grammer fix
[emacs.git] / src / Makefile.in
blob7d91928acfe47a2bd36f88f46e63884576326f91
1 ### @configure_input@
3 # Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2013
4 # Free Software Foundation, Inc.
6 # This file is part of GNU Emacs.
8 # GNU Emacs is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # GNU Emacs is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 # Note that this file is edited by msdos/sed1v2.inp for MSDOS. That
23 # script may need modifying in sync with changes made here. Try to
24 # avoid shell-ism because the DOS build has to use the DOS shell.
26 SHELL = @SHELL@
28 # Here are the things that we expect ../configure to edit.
29 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
30 srcdir = @srcdir@
31 # MinGW CPPFLAGS may use this.
32 abs_top_srcdir=@abs_top_srcdir@
33 ntsource = $(srcdir)/../nt
34 VPATH = $(srcdir)
35 CC = @CC@
36 WINDRES = @WINDRES@
37 CFLAGS = @CFLAGS@
38 CPPFLAGS = @CPPFLAGS@
39 LDFLAGS = @LDFLAGS@
40 EXEEXT = @EXEEXT@
41 version = @version@
42 # Substitute an assignment for the MAKE variable, because
43 # BSD doesn't have it as a default.
44 @SET_MAKE@
45 MKDIR_P = @MKDIR_P@
46 # Don't use LIBS. configure puts stuff in it that either shouldn't be
47 # linked with Emacs or is duplicated by the other stuff below.
48 # LIBS = @LIBS@
49 LIBOBJS = @LIBOBJS@
51 lispsource = $(srcdir)/../lisp
52 lib = ../lib
53 libsrc = ../lib-src
54 etc = ../etc
55 leimdir = ${lispsource}/leim
56 oldXMenudir = ../oldXMenu
57 lwlibdir = ../lwlib
59 # Configuration files for .o files to depend on.
60 config_h = config.h $(srcdir)/conf_post.h
62 bootstrap_exe = ../src/bootstrap-emacs$(EXEEXT)
64 ## ns-app if HAVE_NS, else empty.
65 OTHER_FILES = @OTHER_FILES@
67 ## Flags to pass for profiling builds
68 PROFILING_CFLAGS = @PROFILING_CFLAGS@
70 ## Flags to pass to the compiler to enable build warnings
71 WARN_CFLAGS = @WARN_CFLAGS@
72 WERROR_CFLAGS = @WERROR_CFLAGS@
74 ## Machine-specific CFLAGS.
75 C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
76 ## System-specific CFLAGS.
77 C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
79 GNUSTEP_CFLAGS=@GNUSTEP_CFLAGS@
81 ## Define C_SWITCH_X_SITE to contain any special flags your compiler
82 ## may need to deal with X Windows. For instance, if you've defined
83 ## HAVE_X_WINDOWS and your X include files aren't in a place that your
84 ## compiler can find on its own, you might want to add "-I/..." or
85 ## something similar. This is normally set by configure.
86 C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
88 ## Define LD_SWITCH_X_SITE to contain any special flags your loader
89 ## may need to deal with X Windows. For instance, if your X libraries
90 ## aren't in a place that your loader can find on its own, you might
91 ## want to add "-L/..." or something similar. Only used if
92 ## HAVE_X_WINDOWS.
93 ## FIXME? configure sets a value for this, but it has never been
94 ## substituted in this or any other Makefile. Cf C_SWITCH_X_SITE.
95 LD_SWITCH_X_SITE=
97 ## This must come before LD_SWITCH_SYSTEM.
98 ## If needed, a -rpath option that says where to find X windows at run time.
99 LD_SWITCH_X_SITE_RPATH=@LD_SWITCH_X_SITE_RPATH@
101 ## System-specific LDFLAGS.
102 LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@
104 ## This holds any special options for linking temacs only (i.e., not
105 ## used by configure).
106 LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
108 ## Flags to pass to ld only for temacs.
109 TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS)
111 ## If available, the full path to the paxctl program.
112 ## On grsecurity/PaX systems, unexec will fail due to a gap between
113 ## the bss section and the heap. This can be prevented by disabling
114 ## memory randomization in temacs with "paxctl -r". See bug#11398.
115 PAXCTL = @PAXCTL@
117 ## Some systems define this to request special libraries.
118 LIBS_SYSTEM=@LIBS_SYSTEM@
120 ## -lm, or empty.
121 LIB_MATH=@LIB_MATH@
123 ## -lpthreads, or empty.
124 LIB_PTHREAD=@LIB_PTHREAD@
126 LIBIMAGE=@LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@
128 XFT_LIBS=@XFT_LIBS@
129 LIBX_EXTRA=-lX11 $(XFT_LIBS)
131 FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
132 FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
133 FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
134 FREETYPE_LIBS = @FREETYPE_LIBS@
135 LIBOTF_CFLAGS = @LIBOTF_CFLAGS@
136 LIBOTF_LIBS = @LIBOTF_LIBS@
137 M17N_FLT_CFLAGS = @M17N_FLT_CFLAGS@
138 M17N_FLT_LIBS = @M17N_FLT_LIBS@
140 LIB_ACL=@LIB_ACL@
141 LIB_CLOCK_GETTIME=@LIB_CLOCK_GETTIME@
142 LIB_EACCESS=@LIB_EACCESS@
143 LIB_FDATASYNC=@LIB_FDATASYNC@
144 LIB_TIMER_TIME=@LIB_TIMER_TIME@
146 DBUS_CFLAGS = @DBUS_CFLAGS@
147 DBUS_LIBS = @DBUS_LIBS@
148 ## dbusbind.o if HAVE_DBUS, else empty.
149 DBUS_OBJ = @DBUS_OBJ@
151 LIB_EXECINFO=@LIB_EXECINFO@
153 SETTINGS_CFLAGS = @SETTINGS_CFLAGS@
154 SETTINGS_LIBS = @SETTINGS_LIBS@
156 ## gtkutil.o if USE_GTK, else empty.
157 GTK_OBJ=@GTK_OBJ@
159 ## gfilenotify.o if HAVE_GFILENOTIFY.
160 ## inotify.o if HAVE_INOTIFY.
161 ## w32notify.o if HAVE_W32NOTIFY.
162 NOTIFY_OBJ = @NOTIFY_OBJ@
163 GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@
164 GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@
166 ## -ltermcap, or -lncurses, or -lcurses, or "".
167 LIBS_TERMCAP=@LIBS_TERMCAP@
168 ## terminfo.o if TERMINFO, else tparam.o.
169 TERMCAP_OBJ=@TERMCAP_OBJ@
171 LIBXMU=@LIBXMU@
173 LIBXSM=@LIBXSM@
175 LIBXTR6=@LIBXTR6@
177 ## $(LIBXMU) -lXt $(LIBXTR6) -lXext if USE_X_TOOLKIT, else $(LIBXSM).
178 ## Only used if HAVE_X_WINDOWS.
179 LIBXT_OTHER=@LIBXT_OTHER@
181 ## If !HAVE_X11 || USE_GTK, empty.
182 ## Else if USE_X_TOOLKIT, $(lwlibdir)/liblw.a.
183 ## Else $(oldXMenudir)/libXMenu11.a.
184 LIBXMENU=@LIBXMENU@
186 ## xmenu.o if HAVE_X_WINDOWS, else empty.
187 XMENU_OBJ=@XMENU_OBJ@
188 ## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o if
189 ## HAVE_X_WINDOWS, else empty.
190 XOBJ=@XOBJ@
192 # xgselect.o if linking with GLib, else empty
193 XGSELOBJ=@XGSELOBJ@
195 TOOLKIT_LIBW=@TOOLKIT_LIBW@
197 ## Only used if HAVE_X11, in LIBX_OTHER.
198 LIBXT=$(TOOLKIT_LIBW) $(LIBXT_OTHER)
200 ## If HAVE_X11, $(LIBXT) $(LIBX_EXTRA), else empty.
201 LIBX_OTHER=@LIBX_OTHER@
203 ## LIBXMENU is empty if !HAVE_X_WINDOWS.
204 ## LD_SWITCH_X_SITE should not be used if not using X, but nothing
205 ## sets it at present, and if something ever does, it should be
206 ## configure, which should set it to nil in non-X builds.
207 LIBX_BASE=$(LIBXMENU) $(LD_SWITCH_X_SITE)
209 ## Only used for GNUstep
210 LIBS_GNUSTEP=@LIBS_GNUSTEP@
212 LIBSOUND= @LIBSOUND@
213 CFLAGS_SOUND= @CFLAGS_SOUND@
215 RSVG_LIBS= @RSVG_LIBS@
216 RSVG_CFLAGS= @RSVG_CFLAGS@
218 IMAGEMAGICK_LIBS= @IMAGEMAGICK_LIBS@
219 IMAGEMAGICK_CFLAGS= @IMAGEMAGICK_CFLAGS@
221 LIBXML2_LIBS = @LIBXML2_LIBS@
222 LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
224 LIBZ = @LIBZ@
226 XRANDR_LIBS = @XRANDR_LIBS@
227 XRANDR_CFLAGS = @XRANDR_CFLAGS@
229 XINERAMA_LIBS = @XINERAMA_LIBS@
230 XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
232 ## widget.o if USE_X_TOOLKIT, otherwise empty.
233 WIDGET_OBJ=@WIDGET_OBJ@
235 ## sheap.o if CYGWIN, otherwise empty.
236 CYGWIN_OBJ=@CYGWIN_OBJ@
238 ## fontset.o fringe.o image.o if we have any window system
239 WINDOW_SYSTEM_OBJ=@WINDOW_SYSTEM_OBJ@
241 ## dosfns.o msdos.o w16select.o if MSDOS.
242 MSDOS_OBJ =
243 ## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS.
244 MSDOS_X_OBJ =
246 NS_OBJ=@NS_OBJ@
247 ## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o if HAVE_NS.
248 NS_OBJC_OBJ=@NS_OBJC_OBJ@
249 ## Only set if NS_IMPL_GNUSTEP.
250 GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@
251 ## w32fns.o w32menu.c w32reg.o fringe.o fontset.o w32font.o w32term.o
252 ## w32xfns.o w32select.o image.o w32uniscribe.o if HAVE_W32, else
253 ## empty.
254 W32_OBJ=@W32_OBJ@
255 ## -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32 lusp10 -lcomctl32
256 ## --lwinspool if HAVE_W32, else empty.
257 W32_LIBS=@W32_LIBS@
259 ## emacs.res if HAVE_W32
260 EMACSRES = @EMACSRES@
261 ## emacs-*.manifest if HAVE_W32
262 EMACS_MANIFEST = @EMACS_MANIFEST@
263 ## If HAVE_W32, compiler arguments for including
264 ## the resource file in the binary.
265 ## Cygwin: -Wl,emacs.res
266 ## MinGW: emacs.res
267 W32_RES_LINK=@W32_RES_LINK@
269 ## Empty if !HAVE_X_WINDOWS
270 ## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT
271 ## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE
272 ## else xfont.o
273 FONT_OBJ=@FONT_OBJ@
275 ## Empty for MinGW, cm.o for the rest.
276 CM_OBJ=@CM_OBJ@
278 LIBGPM = @LIBGPM@
280 ## -lresolv, or empty.
281 LIBRESOLV = @LIBRESOLV@
283 LIBSELINUX_LIBS = @LIBSELINUX_LIBS@
285 LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
286 LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
288 LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
290 INTERVALS_H = dispextern.h intervals.h composite.h
292 GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
294 RUN_TEMACS = ./temacs
296 ## Invoke ../nt/addsection for MinGW, ":" elsewhere.
297 TEMACS_POST_LINK = @TEMACS_POST_LINK@
298 ADDSECTION = @ADDSECTION@
299 EMACS_HEAPSIZE = @EMACS_HEAPSIZE@
300 MINGW_TEMACS_POST_LINK = \
301 mv temacs$(EXEEXT) temacs.tmp; \
302 ../nt/addsection temacs.tmp temacs$(EXEEXT) EMHEAP $(EMACS_HEAPSIZE)
304 UNEXEC_OBJ = @UNEXEC_OBJ@
306 CANNOT_DUMP=@CANNOT_DUMP@
308 DEPDIR=deps
309 ## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty.
310 DEPFLAGS=@DEPFLAGS@
311 ## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'.
312 MKDEPDIR=@MKDEPDIR@
314 ## DO NOT use -R. There is a special hack described in lastfile.c
315 ## which is used instead. Some initialized data areas are modified
316 ## at initial startup, then labeled as part of the text area when
317 ## Emacs is dumped for the first time, and never changed again.
319 ## -Demacs is needed to make some files produce the correct version
320 ## for use in Emacs.
322 ## FIXME? MYCPPFLAGS only referenced in etc/DEBUG.
323 ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \
324 -I$(lib) -I$(srcdir)/../lib \
325 $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
326 $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \
327 $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) \
328 $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \
329 $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \
330 $(LIBGNUTLS_CFLAGS) $(GFILENOTIFY_CFLAGS) \
331 $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
332 ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
334 .SUFFIXES: .m
335 .c.o:
336 @$(MKDEPDIR)
337 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(PROFILING_CFLAGS) $<
338 .m.o:
339 @$(MKDEPDIR)
340 $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $(PROFILING_CFLAGS) $<
342 ## lastfile must follow all files whose initialized data areas should
343 ## be dumped as pure by dump-emacs.
344 base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
345 charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
346 $(CM_OBJ) term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
347 emacs.o keyboard.o macros.o keymap.o sysdep.o \
348 buffer.o filelock.o insdel.o marker.o \
349 minibuf.o fileio.o dired.o \
350 cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
351 alloc.o data.o doc.o editfns.o callint.o \
352 eval.o floatfns.o fns.o font.o print.o lread.o \
353 syntax.o $(UNEXEC_OBJ) bytecode.o \
354 process.o gnutls.o callproc.o \
355 region-cache.o sound.o atimer.o \
356 doprnt.o intervals.o textprop.o composite.o xml.o $(NOTIFY_OBJ) \
357 profiler.o decompress.o \
358 $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
359 $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ)
360 obj = $(base_obj) $(NS_OBJC_OBJ)
362 ## Object files used on some machine or other.
363 ## These go in the DOC file on all machines in case they are needed.
364 ## Some of them have no DOC entries, but it does no harm to have them
365 ## in the list, in case they ever add any such entries.
366 SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
367 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
368 fontset.o dbusbind.o cygw32.o \
369 nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o \
370 w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
371 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
372 w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
373 xsettings.o xgselect.o termcap.o
375 ## gmalloc.o if !SYSTEM_MALLOC && !DOUG_LEA_MALLOC, else empty.
376 GMALLOC_OBJ=@GMALLOC_OBJ@
378 ## vm-limit.o if !SYSTEM_MALLOC, else empty.
379 VMLIMIT_OBJ=@VMLIMIT_OBJ@
381 ## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty.
382 RALLOC_OBJ=@RALLOC_OBJ@
384 ## Empty on Cygwin and MinGW, lastfile.o elsewhere.
385 PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@
386 ## lastfile.o on Cygwin and MinGW, empty elsewhere.
387 POST_ALLOC_OBJ=@POST_ALLOC_OBJ@
389 ## List of object files that make-docfile should not be told about.
390 otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
391 $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
393 ## All object files linked into temacs. $(VMLIMIT_OBJ) should be first.
394 ## (On MinGW, firstfile.o should be before vm-limit.o.)
395 FIRSTFILE_OBJ=@FIRSTFILE_OBJ@
396 ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj)
398 ## Configure inserts the file lisp.mk at this point, defining $lisp.
399 @lisp_frag@
402 ## Construct full set of libraries to be linked.
403 LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
404 $(LIBX_OTHER) $(LIBSOUND) \
405 $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(LIB_CLOCK_GETTIME) \
406 $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \
407 $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) \
408 $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
409 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
410 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
411 $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
412 $(GFILENOTIFY_LIBS) $(LIB_MATH) $(LIBZ)
414 all: emacs$(EXEEXT) $(OTHER_FILES)
415 .PHONY: all
417 $(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
418 cd ../leim && $(MAKE) $(MFLAGS) leim-list.el EMACS="$(bootstrap_exe)"
420 $(lispsource)/international/charprop.el: bootstrap-emacs$(EXEEXT)
421 cd ../admin/unidata && $(MAKE) $(MFLAGS) all EMACS="../$(bootstrap_exe)"
423 ## The dumped Emacs is as functional and more efficient than
424 ## bootstrap-emacs, so we replace the latter with the former.
425 ## Strictly speaking, emacs does not depend directly on all of $lisp,
426 ## since not all pieces are used on all platforms. But DOC depends
427 ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
428 emacs$(EXEEXT): temacs$(EXEEXT) $(ADDSECTION) \
429 $(etc)/DOC $(lisp) $(leimdir)/leim-list.el \
430 $(lispsource)/international/charprop.el
431 if test "$(CANNOT_DUMP)" = "yes"; then \
432 rm -f emacs$(EXEEXT); \
433 ln temacs$(EXEEXT) emacs$(EXEEXT); \
434 else \
435 LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \
436 test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \
437 rm -f bootstrap-emacs$(EXEEXT); \
438 ln emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
441 ## We run make-docfile twice because the command line may get too long
442 ## on some systems. The sed command operating on lisp.mk also reduces
443 ## the length of the command line. Unfortunately, no-one has any idea
444 ## exactly how long the maximum safe command line length is on all the
445 ## various systems that Emacs supports. Obviously, the length depends
446 ## on what your value of $srcdir is. If the length restriction goes
447 ## away, lisp.mk can be merged back into this file.
449 ## $(SOME_MACHINE_OBJECTS) comes before $(obj) because some files may
450 ## or may not be included in $(obj), but they are always included in
451 ## $(SOME_MACHINE_OBJECTS). Since a file is processed when it is mentioned
452 ## for the first time, this prevents any variation between configurations
453 ## in the contents of the DOC file.
455 $(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
456 $(MKDIR_P) $(etc)
457 -rm -f $(etc)/DOC
458 $(libsrc)/make-docfile -d $(srcdir) $(SOME_MACHINE_OBJECTS) $(obj) > $(etc)/DOC
459 $(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) `sed -n -e 's| \\\\||' -e 's|^[ ]*$$(lispsource)/||p' $(srcdir)/lisp.mk`
461 $(libsrc)/make-docfile$(EXEEXT):
462 cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT)
464 buildobj.h: Makefile
465 for i in $(ALLOBJS); do \
466 echo "$$i" | sed 's,.*/,,; s/\.obj$$/\.o/; s/^/"/; s/$$/",/' \
467 || exit; \
468 done >$@.tmp
469 mv $@.tmp $@
471 globals.h: gl-stamp; @true
473 GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m)
475 gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
476 $(libsrc)/make-docfile -d $(srcdir) -g $(obj) > gl.tmp
477 $(srcdir)/../build-aux/move-if-change gl.tmp globals.h
478 echo timestamp > $@
480 $(ALLOBJS): globals.h
482 $(lib)/libgnu.a: $(config_h)
483 cd $(lib) && $(MAKE) libgnu.a
485 ## We have to create $(etc) here because init_cmdargs tests its
486 ## existence when setting Vinstallation_directory (FIXME?).
487 ## This goes on to affect various things, and the emacs binary fails
488 ## to start if Vinstallation_directory has the wrong value.
489 temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \
490 $(lib)/libgnu.a $(EMACSRES)
491 $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
492 -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
493 $(MKDIR_P) $(etc)
494 $(TEMACS_POST_LINK)
495 test "$(CANNOT_DUMP)" = "yes" || \
496 test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
498 ## The following oldxmenu-related rules are only (possibly) used if
499 ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them.
500 $(lwlibdir)/liblw.a: $(config_h) globals.h lisp.h FORCE
501 cd $(lwlibdir) && \
502 $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)' \
503 liblw.a
504 $(oldXMenudir)/libXMenu11.a: FORCE
505 cd $(oldXMenudir) && \
506 $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)' \
507 libXMenu11.a
508 FORCE:
509 .PHONY: FORCE
511 ../config.status: config.in epaths.in
512 @echo "The file ${?:.in=.h} needs to be set up from $?."
513 @echo "Please run the 'configure' script again."
514 exit 1
516 doc.o: buildobj.h
518 emacs.res: $(ntsource)/emacs.rc \
519 $(ntsource)/icons/emacs.ico \
520 $(ntsource)/$(EMACS_MANIFEST)
521 $(WINDRES) -O COFF --include-dir=$(srcdir)/../nt \
522 -o $@ $(ntsource)/emacs.rc
524 ns-app: emacs$(EXEEXT)
525 cd ../nextstep && $(MAKE) $(MFLAGS) all
527 .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
528 .PHONY: versionclean extraclean
530 mostlyclean:
531 rm -f temacs$(EXEEXT) core *.core \#* *.o libXMenu11.a liblw.a
532 rm -f ../etc/DOC
533 rm -f bootstrap-emacs$(EXEEXT) emacs-$(version)$(EXEEXT)
534 rm -f buildobj.h
535 rm -f globals.h gl-stamp
536 rm -f *.res *.tmp
537 clean: mostlyclean
538 rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT)
539 -rm -rf $(DEPDIR)
541 ## bootstrap-clean is used to clean up just before a bootstrap.
542 ## It should remove all files generated during a compilation/bootstrap,
543 ## but not things like config.status or TAGS.
544 bootstrap-clean: clean
545 rm -f epaths.h config.h config.stamp stamp-h1
546 if test -f ./.gdbinit; then \
547 mv ./.gdbinit ./.gdbinit.save; \
548 if test -f "$(srcdir)/.gdbinit"; then rm -f ./.gdbinit.save; \
549 else mv ./.gdbinit.save ./.gdbinit; fi; \
552 distclean: bootstrap-clean
553 rm -f Makefile
555 maintainer-clean: distclean
556 rm -f TAGS
557 versionclean:
558 -rm -f emacs$(EXEEXT) emacs-*.*.*$(EXEEXT) ../etc/DOC*
559 extraclean: distclean
560 -rm -f *~ \#*
563 ETAGS = ../lib-src/etags
565 ctagsfiles1 = [xyzXYZ]*.[hc]
566 ctagsfiles2 = [a-wA-W]*.[hc]
567 ctagsfiles3 = [a-zA-Z]*.m
569 ## FIXME? In out-of-tree builds, should TAGS be generated in srcdir?
571 ## This does not need to depend on ../lisp and ../lwlib TAGS files,
572 ## because etags "--include" only includes a pointer to the file,
573 ## rather than the file contents.
574 TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(srcdir)/$(ctagsfiles3)
575 "$(ETAGS)" --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \
576 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
577 $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) \
578 --regex='{objc}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
579 $(srcdir)/$(ctagsfiles3)
581 ## Arrange to make tags tables for ../lisp and ../lwlib,
582 ## which the above TAGS file for the C files includes by reference.
583 ../lisp/TAGS:
584 cd ../lisp && $(MAKE) TAGS ETAGS="$(ETAGS)"
586 $(lwlibdir)/TAGS:
587 cd $(lwlibdir) && $(MAKE) TAGS ETAGS="$(ETAGS)"
589 tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS
590 .PHONY: tags
593 ### Bootstrapping.
595 ## Bootstrapping right is difficult because of the circular dependencies.
596 ## Furthermore, we have to deal with the fact that many compilation targets
597 ## such as loaddefs.el or *.elc can typically be produced by any old
598 ## Emacs executable, so we would like to avoid rebuilding them whenever
599 ## we build a new Emacs executable.
600 ## To solve the circularity, we use 2 different Emacs executables,
601 ## "emacs" is the main target and "bootstrap-emacs" is the one used
602 ## to build the *.elc and loaddefs.el files.
603 ## To solve the freshness issue, we used to use a third file "witness-emacs"
604 ## which was used to witness the fact that there is a bootstrap-emacs
605 ## executable, and then have dependencies on witness-emacs rather than
606 ## bootstrap-emacs, but that lead to problems in parallel builds (because
607 ## witness-emacs needed to be free from dependencies (to avoid rebuilding
608 ## it), so it was compiled in parallel, leading typically to having 2
609 ## processes dumping bootstrap-emacs at the same time).
610 ## So instead, we replace the witness-emacs dependencies by conditional
611 ## bootstrap-dependencies (via $(BOOTSTRAPEMACS)). Of course, since we do
612 ## not want to rely on GNU Make features, we have to rely on an external
613 ## script to do the conditional part of the dependency
614 ## (i.e. see the $(SUBDIR) rule ../Makefile.in).
616 .SUFFIXES: .elc .el
618 ## These suffix rules do not allow additional dependencies, sadly, so
619 ## instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it
620 ## separately below.
621 ## With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)"
622 .el.elc:
623 @cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \
624 THEFILE=$< EMACS="$(bootstrap_exe)"
626 ## Since the .el.elc rule cannot specify an extra dependency, we do it here.
627 $(lisp): $(BOOTSTRAPEMACS)
629 ## VCSWITNESS points to the file that holds info about the current checkout.
630 ## We use it as a heuristic to decide when to rebuild loaddefs.el.
631 ## If empty it is ignored; the parent makefile can set it to some other value.
632 VCSWITNESS =
634 $(lispsource)/loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS)
635 cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS="$(bootstrap_exe)"
637 ## Dump an Emacs executable named bootstrap-emacs containing the
638 ## files from loadup.el in source form.
639 bootstrap-emacs$(EXEEXT): temacs$(EXEEXT)
640 cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
641 if test "$(CANNOT_DUMP)" = "yes"; then \
642 rm -f bootstrap-emacs$(EXEEXT); \
643 ln temacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
644 else \
645 $(RUN_TEMACS) --batch --load loadup bootstrap || exit 1; \
646 test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \
647 mv -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
649 @: Compile some files earlier to speed up further compilation.
650 cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS="$(bootstrap_exe)"
652 ## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
653 @deps_frag@
656 ### Makefile.in ends here