3 # Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2013 Free Software
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.
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.
31 # MinGW CPPFLAGS may use this.
32 abs_top_srcdir
=@abs_top_srcdir@
33 ntsource
= $(srcdir)/..
/nt
34 abs_builddir
= @abs_builddir@
43 # Substitute an assignment for the MAKE variable, because
44 # BSD doesn't have it as a default.
47 # Don't use LIBS. configure puts stuff in it that either shouldn't be
48 # linked with Emacs or is duplicated by the other stuff below.
52 lispsource
= $(srcdir)/..
/lisp
57 oldXMenudir
= ..
/oldXMenu
61 # Configuration files for .o files to depend on.
62 config_h
= config.h
$(srcdir)/conf_post.h
64 bootstrap_exe
= $(abs_builddir
)/bootstrap-emacs
$(EXEEXT
)
66 ## ns-app if HAVE_NS, else empty.
67 OTHER_FILES
= @OTHER_FILES@
69 ## Flags to pass for profiling builds
70 PROFILING_CFLAGS
= @PROFILING_CFLAGS@
72 ## Flags to pass to the compiler to enable build warnings
73 WARN_CFLAGS
= @WARN_CFLAGS@
74 WERROR_CFLAGS
= @WERROR_CFLAGS@
76 ## Machine-specific CFLAGS.
77 C_SWITCH_MACHINE
=@C_SWITCH_MACHINE@
78 ## System-specific CFLAGS.
79 C_SWITCH_SYSTEM
=@C_SWITCH_SYSTEM@
81 GNUSTEP_CFLAGS
=@GNUSTEP_CFLAGS@
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 C_SWITCH_X_SITE
=@C_SWITCH_X_SITE@
90 ## Define LD_SWITCH_X_SITE to contain any special flags your loader
91 ## may need to deal with X Windows. For instance, if your X libraries
92 ## aren't in a place that your loader can find on its own, you might
93 ## want to add "-L/..." or something similar. Only used if
95 ## FIXME? configure sets a value for this, but it has never been
96 ## substituted in this or any other Makefile. Cf C_SWITCH_X_SITE.
99 ## This must come before LD_SWITCH_SYSTEM.
100 ## If needed, a -rpath option that says where to find X windows at run time.
101 LD_SWITCH_X_SITE_RPATH
=@LD_SWITCH_X_SITE_RPATH@
103 ## System-specific LDFLAGS.
104 LD_SWITCH_SYSTEM
=@LD_SWITCH_SYSTEM@
106 ## This holds any special options for linking temacs only (i.e., not
107 ## used by configure).
108 LD_SWITCH_SYSTEM_TEMACS
=@LD_SWITCH_SYSTEM_TEMACS@
110 ## Flags to pass to ld only for temacs.
111 TEMACS_LDFLAGS
= $(LD_SWITCH_SYSTEM
) $(LD_SWITCH_SYSTEM_TEMACS
)
113 ## If available, the full path to the paxctl program.
114 ## On grsecurity/PaX systems, unexec will fail due to a gap between
115 ## the bss section and the heap. This can be prevented by disabling
116 ## memory randomization in temacs with "paxctl -r". See bug#11398.
119 ## Some systems define this to request special libraries.
120 LIBS_SYSTEM
=@LIBS_SYSTEM@
125 ## -lpthreads, or empty.
126 LIB_PTHREAD
=@LIB_PTHREAD@
128 LIBIMAGE
=@LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@
131 LIBX_EXTRA
=-lX11
$(XFT_LIBS
)
133 FONTCONFIG_CFLAGS
= @FONTCONFIG_CFLAGS@
134 FONTCONFIG_LIBS
= @FONTCONFIG_LIBS@
135 FREETYPE_CFLAGS
= @FREETYPE_CFLAGS@
136 FREETYPE_LIBS
= @FREETYPE_LIBS@
137 LIBOTF_CFLAGS
= @LIBOTF_CFLAGS@
138 LIBOTF_LIBS
= @LIBOTF_LIBS@
139 M17N_FLT_CFLAGS
= @M17N_FLT_CFLAGS@
140 M17N_FLT_LIBS
= @M17N_FLT_LIBS@
143 LIB_CLOCK_GETTIME
=@LIB_CLOCK_GETTIME@
144 LIB_EACCESS
=@LIB_EACCESS@
145 LIB_FDATASYNC
=@LIB_FDATASYNC@
146 LIB_TIMER_TIME
=@LIB_TIMER_TIME@
148 DBUS_CFLAGS
= @DBUS_CFLAGS@
149 DBUS_LIBS
= @DBUS_LIBS@
150 ## dbusbind.o if HAVE_DBUS, else empty.
151 DBUS_OBJ
= @DBUS_OBJ@
153 LIB_EXECINFO
=@LIB_EXECINFO@
155 SETTINGS_CFLAGS
= @SETTINGS_CFLAGS@
156 SETTINGS_LIBS
= @SETTINGS_LIBS@
158 ## gtkutil.o if USE_GTK, else empty.
161 ## gfilenotify.o if HAVE_GFILENOTIFY.
162 ## inotify.o if HAVE_INOTIFY.
163 ## w32notify.o if HAVE_W32NOTIFY.
164 NOTIFY_OBJ
= @NOTIFY_OBJ@
165 GFILENOTIFY_CFLAGS
= @GFILENOTIFY_CFLAGS@
166 GFILENOTIFY_LIBS
= @GFILENOTIFY_LIBS@
168 ## -ltermcap, or -lncurses, or -lcurses, or "".
169 LIBS_TERMCAP
=@LIBS_TERMCAP@
170 ## terminfo.o if TERMINFO, else tparam.o.
171 TERMCAP_OBJ
=@TERMCAP_OBJ@
179 ## $(LIBXMU) -lXt $(LIBXTR6) -lXext if USE_X_TOOLKIT, else $(LIBXSM).
180 ## Only used if HAVE_X_WINDOWS.
181 LIBXT_OTHER
=@LIBXT_OTHER@
183 ## If !HAVE_X11 || USE_GTK, empty.
184 ## Else if USE_X_TOOLKIT really-lwlib, else really-oldxmenu.
185 OLDXMENU_TARGET
=@OLDXMENU_TARGET@
187 ## If !HAVE_X11 || USE_GTK, empty.
188 ## Else if USE_X_TOOLKIT, $(lwlibdir)/liblw.a.
189 ## Else $(oldXMenudir)/libXMenu11.a.
190 ## (Actually, rather than being empty, it is set to "nothing".
191 ## It is never actually used for anything in this case.
192 ## This is done because there is a rule with target $(OLDXMENU) below,
193 ## and I think it might be a syntax error with some makes to have
194 ## an empty target, even if the associated rule is never run.
195 ## http://lists.gnu.org/archive/html/help-make/2010-05/msg00058.html
196 ## The alternative would be to put that rule in a makefile fragment.)
199 ## If HAVE_X11 && !USE_GTK, $(OLDXMENU) ../src/$(OLDXMENU); else empty.
200 ## We use stamp-xmenu with these two deps to both ensure that lwlib
201 ## gets remade based on its dependencies in its own makefile,
202 ## and remake temacs if lwlib gets changed by this.
203 OLDXMENU_DEPS
=@OLDXMENU_DEPS@
205 ## If !HAVE_X11 && HAVE_X_WINDOWS, -lXMenu (this case no longer possible).
206 ## Else if !HAVE_X11 || USE_GTK, empty.
210 ## xmenu.o if HAVE_X_WINDOWS, else empty.
211 XMENU_OBJ
=@XMENU_OBJ@
212 ## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o if
213 ## HAVE_X_WINDOWS, else empty.
216 # xgselect.o if linking with GLib, else empty
219 TOOLKIT_LIBW
=@TOOLKIT_LIBW@
221 ## Only used if HAVE_X11, in LIBX_OTHER.
222 LIBXT
=$(TOOLKIT_LIBW
) $(LIBXT_OTHER
)
224 ## If HAVE_X11, $(LIBXT) $(LIBX_EXTRA), else empty.
225 LIBX_OTHER
=@LIBX_OTHER@
227 ## LIBXMENU is nil if !HAVE_X_WINDOWS.
228 ## LD_SWITCH_X_SITE should not be used if not using X, but nothing
229 ## sets it at present, and if something ever does, it should be
230 ## configure, which should set it to nil in non-X builds.
231 LIBX_BASE
=$(LIBXMENU
) $(LD_SWITCH_X_SITE
)
233 ## Only used for GNUstep
234 LIBS_GNUSTEP
=@LIBS_GNUSTEP@
237 CFLAGS_SOUND
= @CFLAGS_SOUND@
239 RSVG_LIBS
= @RSVG_LIBS@
240 RSVG_CFLAGS
= @RSVG_CFLAGS@
242 IMAGEMAGICK_LIBS
= @IMAGEMAGICK_LIBS@
243 IMAGEMAGICK_CFLAGS
= @IMAGEMAGICK_CFLAGS@
245 LIBXML2_LIBS
= @LIBXML2_LIBS@
246 LIBXML2_CFLAGS
= @LIBXML2_CFLAGS@
250 XRANDR_LIBS
= @XRANDR_LIBS@
251 XRANDR_CFLAGS
= @XRANDR_CFLAGS@
253 XINERAMA_LIBS
= @XINERAMA_LIBS@
254 XINERAMA_CFLAGS
= @XINERAMA_CFLAGS@
256 ## widget.o if USE_X_TOOLKIT, otherwise empty.
257 WIDGET_OBJ
=@WIDGET_OBJ@
259 ## sheap.o if CYGWIN, otherwise empty.
260 CYGWIN_OBJ
=@CYGWIN_OBJ@
262 ## fontset.o fringe.o image.o if we have any window system
263 WINDOW_SYSTEM_OBJ
=@WINDOW_SYSTEM_OBJ@
265 ## dosfns.o msdos.o w16select.o if MSDOS.
267 ## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS.
271 ## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o if HAVE_NS.
272 NS_OBJC_OBJ
=@NS_OBJC_OBJ@
273 ## Only set if NS_IMPL_GNUSTEP.
274 GNU_OBJC_CFLAGS
=@GNU_OBJC_CFLAGS@
275 ## w32fns.o w32menu.c w32reg.o fringe.o fontset.o w32font.o w32term.o
276 ## w32xfns.o w32select.o image.o w32uniscribe.o if HAVE_W32, else
279 ## -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32 lusp10 -lcomctl32
280 ## --lwinspool if HAVE_W32, else empty.
283 ## emacs.res if HAVE_W32
284 EMACSRES
= @EMACSRES@
285 ## emacs-*.manifest if HAVE_W32
286 EMACS_MANIFEST
= @EMACS_MANIFEST@
287 ## If HAVE_W32, compiler arguments for including
288 ## the resource file in the binary.
289 ## Cygwin: -Wl,emacs.res
291 W32_RES_LINK
=@W32_RES_LINK@
293 ## Empty if !HAVE_X_WINDOWS
294 ## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT
295 ## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE
299 ## Empty for MinGW, cm.o for the rest.
304 ## -lresolv, or empty.
305 LIBRESOLV
= @LIBRESOLV@
307 LIBSELINUX_LIBS
= @LIBSELINUX_LIBS@
309 LIBGNUTLS_LIBS
= @LIBGNUTLS_LIBS@
310 LIBGNUTLS_CFLAGS
= @LIBGNUTLS_CFLAGS@
312 LIB_PTHREAD_SIGMASK
= @LIB_PTHREAD_SIGMASK@
314 INTERVALS_H
= dispextern.h intervals.h composite.h
316 GETLOADAVG_LIBS
= @GETLOADAVG_LIBS@
318 RUN_TEMACS
= .
/temacs
320 ## Invoke ../nt/addsection for MinGW, ":" elsewhere.
321 TEMACS_POST_LINK
= @TEMACS_POST_LINK@
322 ADDSECTION
= @ADDSECTION@
323 EMACS_HEAPSIZE
= @EMACS_HEAPSIZE@
324 MINGW_TEMACS_POST_LINK
= \
325 mv temacs
$(EXEEXT
) temacs.tmp
; \
326 ..
/nt
/addsection temacs.tmp temacs
$(EXEEXT
) EMHEAP
$(EMACS_HEAPSIZE
)
328 UNEXEC_OBJ
= @UNEXEC_OBJ@
330 CANNOT_DUMP
=@CANNOT_DUMP@
333 ## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty.
335 ## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'.
338 ## DO NOT use -R. There is a special hack described in lastfile.c
339 ## which is used instead. Some initialized data areas are modified
340 ## at initial startup, then labeled as part of the text area when
341 ## Emacs is dumped for the first time, and never changed again.
343 ## -Demacs is needed to make some files produce the correct version
346 ## FIXME? MYCPPFLAGS only referenced in etc/DEBUG.
347 ALL_CFLAGS
=-Demacs
$(MYCPPFLAGS
) -I.
-I
$(srcdir) \
348 -I
$(lib
) -I
$(srcdir)/..
/lib \
349 $(C_SWITCH_MACHINE
) $(C_SWITCH_SYSTEM
) $(C_SWITCH_X_SITE
) \
350 $(GNUSTEP_CFLAGS
) $(CFLAGS_SOUND
) $(RSVG_CFLAGS
) $(IMAGEMAGICK_CFLAGS
) \
351 $(LIBXML2_CFLAGS
) $(DBUS_CFLAGS
) $(XRANDR_CFLAGS
) $(XINERAMA_CFLAGS
) \
352 $(SETTINGS_CFLAGS
) $(FREETYPE_CFLAGS
) $(FONTCONFIG_CFLAGS
) \
353 $(LIBOTF_CFLAGS
) $(M17N_FLT_CFLAGS
) $(DEPFLAGS
) \
354 $(LIBGNUTLS_CFLAGS
) $(GFILENOTIFY_CFLAGS
) \
355 $(WARN_CFLAGS
) $(WERROR_CFLAGS
) $(CFLAGS
)
356 ALL_OBJC_CFLAGS
=$(ALL_CFLAGS
) $(GNU_OBJC_CFLAGS
)
361 $(CC
) -c
$(CPPFLAGS
) $(ALL_CFLAGS
) $(PROFILING_CFLAGS
) $<
364 $(CC
) -c
$(CPPFLAGS
) $(ALL_OBJC_CFLAGS
) $(PROFILING_CFLAGS
) $<
366 ## lastfile must follow all files whose initialized data areas should
367 ## be dumped as pure by dump-emacs.
368 base_obj
= dispnew.o frame.o scroll.o xdisp.o menu.o
$(XMENU_OBJ
) window.o \
369 charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
370 $(CM_OBJ
) term.o terminal.o xfaces.o
$(XOBJ
) $(GTK_OBJ
) $(DBUS_OBJ
) \
371 emacs.o keyboard.o macros.o keymap.o sysdep.o \
372 buffer.o filelock.o insdel.o marker.o \
373 minibuf.o fileio.o dired.o \
374 cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
375 alloc.o data.o doc.o editfns.o callint.o \
376 eval.o floatfns.o fns.o font.o
print.o lread.o \
377 syntax.o
$(UNEXEC_OBJ
) bytecode.o \
378 process.o gnutls.o callproc.o \
379 region-cache.o sound.o atimer.o \
380 doprnt.o intervals.o textprop.o composite.o xml.o
$(NOTIFY_OBJ
) \
381 profiler.o decompress.o \
382 $(MSDOS_OBJ
) $(MSDOS_X_OBJ
) $(NS_OBJ
) $(CYGWIN_OBJ
) $(FONT_OBJ
) \
383 $(W32_OBJ
) $(WINDOW_SYSTEM_OBJ
) $(XGSELOBJ
)
384 obj
= $(base_obj
) $(NS_OBJC_OBJ
)
386 ## Object files used on some machine or other.
387 ## These go in the DOC file on all machines in case they are needed.
388 ## Some of them have no DOC entries, but it does no harm to have them
389 ## in the list, in case they ever add any such entries.
390 SOME_MACHINE_OBJECTS
= dosfns.o msdos.o \
391 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
392 fontset.o dbusbind.o cygw32.o \
393 nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o \
394 w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
395 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
396 w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
397 xsettings.o xgselect.o termcap.o
399 ## gmalloc.o if !SYSTEM_MALLOC && !DOUG_LEA_MALLOC, else empty.
400 GMALLOC_OBJ
=@GMALLOC_OBJ@
402 ## vm-limit.o if !SYSTEM_MALLOC, else empty.
403 VMLIMIT_OBJ
=@VMLIMIT_OBJ@
405 ## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty.
406 RALLOC_OBJ
=@RALLOC_OBJ@
408 ## Empty on Cygwin and MinGW, lastfile.o elsewhere.
409 PRE_ALLOC_OBJ
=@PRE_ALLOC_OBJ@
410 ## lastfile.o on Cygwin and MinGW, empty elsewhere.
411 POST_ALLOC_OBJ
=@POST_ALLOC_OBJ@
413 ## List of object files that make-docfile should not be told about.
414 otherobj
= $(TERMCAP_OBJ
) $(PRE_ALLOC_OBJ
) $(GMALLOC_OBJ
) $(RALLOC_OBJ
) \
415 $(POST_ALLOC_OBJ
) $(WIDGET_OBJ
) $(LIBOBJS
)
417 ## All object files linked into temacs. $(VMLIMIT_OBJ) should be first.
418 ## (On MinGW, firstfile.o should be before vm-limit.o.)
419 FIRSTFILE_OBJ
=@FIRSTFILE_OBJ@
420 ALLOBJS
= $(FIRSTFILE_OBJ
) $(VMLIMIT_OBJ
) $(obj
) $(otherobj
)
422 ## Configure inserts the file lisp.mk at this point, defining $lisp.
426 ## Construct full set of libraries to be linked.
427 LIBES
= $(LIBS
) $(W32_LIBS
) $(LIBS_GNUSTEP
) $(LIBX_BASE
) $(LIBIMAGE
) \
428 $(LIBX_OTHER
) $(LIBSOUND
) \
429 $(RSVG_LIBS
) $(IMAGEMAGICK_LIBS
) $(LIB_ACL
) $(LIB_CLOCK_GETTIME
) \
430 $(LIB_EACCESS
) $(LIB_FDATASYNC
) $(LIB_TIMER_TIME
) $(DBUS_LIBS
) \
431 $(LIB_EXECINFO
) $(XRANDR_LIBS
) $(XINERAMA_LIBS
) \
432 $(LIBXML2_LIBS
) $(LIBGPM
) $(LIBRESOLV
) $(LIBS_SYSTEM
) \
433 $(LIBS_TERMCAP
) $(GETLOADAVG_LIBS
) $(SETTINGS_LIBS
) $(LIBSELINUX_LIBS
) \
434 $(FREETYPE_LIBS
) $(FONTCONFIG_LIBS
) $(LIBOTF_LIBS
) $(M17N_FLT_LIBS
) \
435 $(LIBGNUTLS_LIBS
) $(LIB_PTHREAD
) $(LIB_PTHREAD_SIGMASK
) \
436 $(GFILENOTIFY_LIBS
) $(LIB_MATH
) $(LIBZ
)
438 all: emacs
$(EXEEXT
) $(OTHER_FILES
)
441 $(leimdir
)/leim-list.el
: bootstrap-emacs
$(EXEEXT
)
442 cd
$(leimdir
) && $(MAKE
) $(MFLAGS
) leim-list.el EMACS
="$(bootstrap_exe)"
444 ## The dumped Emacs is as functional and more efficient than
445 ## bootstrap-emacs, so we replace the latter with the former.
446 ## Strictly speaking, emacs does not depend directly on all of $lisp,
447 ## since not all pieces are used on all platforms. But DOC depends
448 ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
449 emacs
$(EXEEXT
): temacs
$(EXEEXT
) $(ADDSECTION
) \
450 $(etc
)/DOC
$(lisp
) $(leimdir
)/leim-list.el
451 if
test "$(CANNOT_DUMP)" = "yes"; then \
452 rm -f emacs
$(EXEEXT
); \
453 ln temacs
$(EXEEXT
) emacs
$(EXEEXT
); \
455 LC_ALL
=C
$(RUN_TEMACS
) -batch
-l loadup dump || exit
1; \
456 test "X$(PAXCTL)" = X ||
$(PAXCTL
) -zex emacs
$(EXEEXT
); \
457 rm -f bootstrap-emacs
$(EXEEXT
); \
458 ln emacs
$(EXEEXT
) bootstrap-emacs
$(EXEEXT
); \
461 ## We run make-docfile twice because the command line may get too long
462 ## on some systems. The sed command operating on lisp.mk also reduces
463 ## the length of the command line. Unfortunately, no-one has any idea
464 ## exactly how long the maximum safe command line length is on all the
465 ## various systems that Emacs supports. Obviously, the length depends
466 ## on what your value of $srcdir is. If the length restriction goes
467 ## away, lisp.mk can be merged back into this file.
469 ## $(SOME_MACHINE_OBJECTS) comes before $(obj) because some files may
470 ## or may not be included in $(obj), but they are always included in
471 ## $(SOME_MACHINE_OBJECTS). Since a file is processed when it is mentioned
472 ## for the first time, this prevents any variation between configurations
473 ## in the contents of the DOC file.
475 $(etc
)/DOC
: $(libsrc
)/make-docfile
$(EXEEXT
) $(obj
) $(lisp
)
478 $(libsrc
)/make-docfile
-d
$(srcdir) $(SOME_MACHINE_OBJECTS
) $(obj
) > $(etc
)/DOC
479 $(libsrc
)/make-docfile
-a
$(etc
)/DOC
-d
$(lispsource
) `sed -n -e 's| \\\\||' -e 's|^[ ]*$$(lispsource)/||p' $(srcdir)/lisp.mk`
481 $(libsrc
)/make-docfile
$(EXEEXT
):
482 cd
$(libsrc
); $(MAKE
) $(MFLAGS
) make-docfile
$(EXEEXT
)
485 for i in
$(ALLOBJS
); do \
486 echo
"$$i" | sed
's,.*/,,; s/\.obj$$/\.o/; s/^/"/; s/$$/",/' \
491 globals.h
: gl-stamp
; @true
493 GLOBAL_SOURCES
= $(base_obj
:.o
=.c
) $(NS_OBJC_OBJ
:.o
=.m
)
495 gl-stamp
: $(libsrc
)/make-docfile
$(EXEEXT
) $(GLOBAL_SOURCES
)
496 $(libsrc
)/make-docfile
-d
$(srcdir) -g
$(obj
) > gl.tmp
497 $(srcdir)/..
/build-aux
/move-if-change gl.tmp globals.h
500 $(ALLOBJS
): globals.h
502 $(lib
)/libgnu.a
: $(config_h
)
503 cd
$(lib
) && $(MAKE
) libgnu.a
505 ## We have to create $(etc) here because init_cmdargs tests its
506 ## existence when setting Vinstallation_directory (FIXME?).
507 ## This goes on to affect various things, and the emacs binary fails
508 ## to start if Vinstallation_directory has the wrong value.
509 temacs
$(EXEEXT
): stamp-oldxmenu
$(ALLOBJS
) \
510 $(lib
)/libgnu.a
$(EMACSRES
)
511 $(CC
) $(ALL_CFLAGS
) $(TEMACS_LDFLAGS
) $(LDFLAGS
) \
512 -o temacs
$(ALLOBJS
) $(lib
)/libgnu.a
$(W32_RES_LINK
) $(LIBES
)
515 test "$(CANNOT_DUMP)" = "yes" || \
516 test "X$(PAXCTL)" = X ||
$(PAXCTL
) -r temacs
$(EXEEXT
)
518 ## The following oldxmenu-related rules are only (possibly) used if
519 ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them
520 ## (provided we take a little care that OLDXMENU is never empty).
521 really-lwlib
: globals.h
522 cd
$(lwlibdir
); $(MAKE
) $(MFLAGS
) \
523 CC
='$(CC)' CFLAGS
='$(CFLAGS)' MAKE
='$(MAKE)'
524 @true
# make -t should not create really-lwlib.
528 cd
$(oldXMenudir
); $(MAKE
) $(MFLAGS
) \
529 CC
='$(CC)' CFLAGS
='$(CFLAGS)' MAKE
='$(MAKE)'
530 @true
# make -t should not create really-oldXMenu.
531 .PHONY
: really-oldXMenu
533 ## We do not really need this when OLDXMENU_DEPS is empty, but as
534 ## things stand we need something to satisfy the temacs dependency.
535 stamp-oldxmenu
: $(OLDXMENU_DEPS
)
538 ## Supply an ordering for parallel make.
539 ..
/src
/$(OLDXMENU
): $(OLDXMENU
)
541 $(OLDXMENU
): $(OLDXMENU_TARGET
)
543 ..
/config.status
: config.in epaths.in
544 @echo
"The file ${?:.in=.h} needs to be set up from $?."
545 @echo
"Please run the 'configure' script again."
550 emacs.res
: $(ntsource
)/emacs.rc \
551 $(ntsource
)/icons
/emacs.ico \
552 $(ntsource
)/$(EMACS_MANIFEST
)
553 $(WINDRES
) -O COFF
--include-dir
=$(srcdir)/..
/nt \
554 -o
$@
$(ntsource
)/emacs.rc
556 ns-app
: emacs
$(EXEEXT
)
557 cd ..
/nextstep
&& $(MAKE
) $(MFLAGS
) all
559 .PHONY
: mostlyclean clean bootstrap-clean
distclean maintainer-clean
560 .PHONY
: versionclean extraclean frc
563 rm -f temacs
$(EXEEXT
) core
*.core \
#* *.o libXMenu11.a liblw.a
565 rm -f bootstrap-emacs
$(EXEEXT
) emacs-
$(version
)$(EXEEXT
)
567 rm -f globals.h gl-stamp
570 rm -f emacs-
*.
*.
*$(EXEEXT
) emacs
$(EXEEXT
)
573 ## bootstrap-clean is used to clean up just before a bootstrap.
574 ## It should remove all files generated during a compilation/bootstrap,
575 ## but not things like config.status or TAGS.
576 bootstrap-clean
: clean
577 rm -f epaths.h config.h config.stamp stamp-h1 stamp-oldxmenu
578 if
test -f .
/.gdbinit
; then \
579 mv .
/.gdbinit .
/.gdbinit.save
; \
580 if
test -f
"$(srcdir)/.gdbinit"; then
rm -f .
/.gdbinit.save
; \
581 else mv .
/.gdbinit.save .
/.gdbinit
; fi
; \
583 ## This is used in making a distribution.
584 ## Do not use it on development directories!
585 distclean: bootstrap-clean
587 maintainer-clean
: distclean
588 @echo
"This command is intended for maintainers to use;"
589 @echo
"it deletes files that may require special tools to rebuild."
592 -rm -f emacs
$(EXEEXT
) emacs-
*.
*.
*$(EXEEXT
) ..
/etc
/DOC
*
593 extraclean
: distclean
594 -rm -f
*~ \
#* m/?*~ s/?*~
596 ## Arrange to make a tags table TAGS-LISP for ../lisp,
597 ## plus TAGS for the C files, which includes ../lisp/TAGS by reference.
599 ctagsfiles1
= [xyzXYZ
]*.
[hc
]
600 ctagsfiles2
= [a-wA-W
]*.
[hc
]
601 ctagsfiles3
= [a-zA-Z
]*.m
603 TAGS
: $(srcdir)/$(ctagsfiles1
) $(srcdir)/$(ctagsfiles2
) $(S_FILE
)
604 ..
/lib-src
/etags
--include=TAGS-LISP
--include=$(lwlibdir
)/TAGS \
605 --regex
='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
606 $(srcdir)/$(ctagsfiles1
) $(srcdir)/$(ctagsfiles2
) $(S_FILE
) \
607 --regex
='{objc}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
608 $(srcdir)/$(ctagsfiles3
)
611 $(MAKE
) -f
$(lispdir
)/Makefile TAGS-LISP ETAGS
=..
/lib-src
/etags
614 (cd
$(lwlibdir
); $(MAKE
) -f
$(lwlibdir
)/Makefile
tags ETAGS
=..
/lib-src
/etags
)
616 tags: TAGS TAGS-LISP
$(lwlibdir
)/TAGS
622 ## Bootstrapping right is difficult because of the circular dependencies.
623 ## Furthermore, we have to deal with the fact that many compilation targets
624 ## such as loaddefs.el or *.elc can typically be produced by any old
625 ## Emacs executable, so we would like to avoid rebuilding them whenever
626 ## we build a new Emacs executable.
627 ## To solve the circularity, we use 2 different Emacs executables,
628 ## "emacs" is the main target and "bootstrap-emacs" is the one used
629 ## to build the *.elc and loaddefs.el files.
630 ## To solve the freshness issue, we used to use a third file "witness-emacs"
631 ## which was used to witness the fact that there is a bootstrap-emacs
632 ## executable, and then have dependencies on witness-emacs rather than
633 ## bootstrap-emacs, but that lead to problems in parallel builds (because
634 ## witness-emacs needed to be free from dependencies (to avoid rebuilding
635 ## it), so it was compiled in parallel, leading typically to having 2
636 ## processes dumping bootstrap-emacs at the same time).
637 ## So instead, we replace the witness-emacs dependencies by conditional
638 ## bootstrap-dependencies (via $(BOOTSTRAPEMACS)). Of course, since we do
639 ## not want to rely on GNU Make features, we have to rely on an external
640 ## script to do the conditional part of the dependency
641 ## (i.e. see the $(SUBDIR) rule ../Makefile.in).
645 ## These suffix rules do not allow additional dependencies, sadly, so
646 ## instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it
648 ## With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)"
650 @cd ..
/lisp
; $(MAKE
) $(MFLAGS
) compile-onefile \
651 THEFILE
=$< EMACS
="$(bootstrap_exe)"
653 ## Since the .el.elc rule cannot specify an extra dependency, we do it here.
654 $(lisp
): $(BOOTSTRAPEMACS
)
656 ## VCSWITNESS points to the file that holds info about the current checkout.
657 ## We use it as a heuristic to decide when to rebuild loaddefs.el.
658 ## If empty it is ignored; the parent makefile can set it to some other value.
661 $(lispsource
)/loaddefs.el
: $(BOOTSTRAPEMACS
) $(VCSWITNESS
)
662 cd ..
/lisp
; $(MAKE
) $(MFLAGS
) autoloads EMACS
="$(bootstrap_exe)"
664 ## Dump an Emacs executable named bootstrap-emacs containing the
665 ## files from loadup.el in source form.
666 bootstrap-emacs
$(EXEEXT
): temacs
$(EXEEXT
)
667 cd ..
/lisp
; $(MAKE
) $(MFLAGS
) update-subdirs
668 if
test "$(CANNOT_DUMP)" = "yes"; then \
669 rm -f bootstrap-emacs
$(EXEEXT
); \
670 ln temacs
$(EXEEXT
) bootstrap-emacs
$(EXEEXT
); \
672 $(RUN_TEMACS
) --batch
--load loadup bootstrap || exit
1; \
673 test "X$(PAXCTL)" = X ||
$(PAXCTL
) -zex emacs
$(EXEEXT
); \
674 mv
-f emacs
$(EXEEXT
) bootstrap-emacs
$(EXEEXT
); \
676 @
: Compile some files earlier to speed up further compilation.
677 cd ..
/lisp
; $(MAKE
) $(MFLAGS
) compile-first EMACS
="$(bootstrap_exe)"
679 ## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
683 ### Makefile.in ends here