* lisp/ChangeLog: Fix a typo.
[bpt/emacs.git] / src / Makefile.in
CommitLineData
bbece175 1### @configure_input@
3de25479 2
ab422c4d
PE
3# Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2013 Free Software
4# Foundation, Inc.
a0528984
EZ
5
6# This file is part of GNU Emacs.
7
b9b1cc14 8# GNU Emacs is free software: you can redistribute it and/or modify
a0528984 9# it under the terms of the GNU General Public License as published by
b9b1cc14
GM
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
a0528984
EZ
12
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.
17
18# You should have received a copy of the GNU General Public License
b9b1cc14 19# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
a0528984
EZ
20
21
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.
25
50b13cde 26SHELL = @SHELL@
a0528984
EZ
27
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.
82c3d67a 30srcdir = @srcdir@
11e5e2eb
GM
31# MinGW CPPFLAGS may use this.
32abs_top_srcdir=@abs_top_srcdir@
1cf1bbd5 33ntsource = $(srcdir)/../nt
82c3d67a
AS
34abs_builddir = @abs_builddir@
35VPATH = $(srcdir)
36CC = @CC@
1cf1bbd5 37WINDRES = @WINDRES@
82c3d67a
AS
38CFLAGS = @CFLAGS@
39CPPFLAGS = @CPPFLAGS@
40LDFLAGS = @LDFLAGS@
82c3d67a
AS
41EXEEXT = @EXEEXT@
42version = @version@
a0528984
EZ
43# Substitute an assignment for the MAKE variable, because
44# BSD doesn't have it as a default.
45@SET_MAKE@
3fe7cdc8 46MKDIR_P = @MKDIR_P@
a0528984 47# Don't use LIBS. configure puts stuff in it that either shouldn't be
81ac4f35 48# linked with Emacs or is duplicated by the other stuff below.
a0528984
EZ
49# LIBS = @LIBS@
50LIBOBJS = @LIBOBJS@
51
aba1381b 52lispsource = $(srcdir)/../lisp
9a514d4a 53lib = ../lib
aba1381b
DN
54libsrc = ../lib-src
55etc = ../etc
50fe702a 56leimdir = ../leim
aba1381b
DN
57oldXMenudir = ../oldXMenu
58lwlibdir = ../lwlib
59lispdir = ../lisp
a0528984
EZ
60
61# Configuration files for .o files to depend on.
4b94e8cf 62config_h = config.h $(srcdir)/conf_post.h
a0528984 63
2cb72a75 64bootstrap_exe = $(abs_builddir)/bootstrap-emacs$(EXEEXT)
7763401b 65
1a82cca9 66## ns-app if HAVE_NS, else empty.
005bd5a2
DN
67OTHER_FILES = @OTHER_FILES@
68
2cb72a75 69## Flags to pass for profiling builds
e6cfa7c3 70PROFILING_CFLAGS = @PROFILING_CFLAGS@
e6cfa7c3
AS
71
72## Flags to pass to the compiler to enable build warnings
b8df54ff
PE
73WARN_CFLAGS = @WARN_CFLAGS@
74WERROR_CFLAGS = @WERROR_CFLAGS@
e6cfa7c3 75
49628785
GM
76## Machine-specific CFLAGS.
77C_SWITCH_MACHINE=@C_SWITCH_MACHINE@
78## System-specific CFLAGS.
79C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
5a903aa9 80
2f097256 81GNUSTEP_CFLAGS=@GNUSTEP_CFLAGS@
5a903aa9
GM
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.
5a903aa9
GM
88C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
89
0116466b
GM
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
94## HAVE_X_WINDOWS.
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.
97LD_SWITCH_X_SITE=
98
4737362e
GM
99## This must come before LD_SWITCH_SYSTEM.
100## If needed, a -rpath option that says where to find X windows at run time.
4d5c6349 101LD_SWITCH_X_SITE_RPATH=@LD_SWITCH_X_SITE_RPATH@
5a903aa9 102
2f86b22b
GM
103## System-specific LDFLAGS.
104LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@
5a903aa9 105
1ddc2bd6
PE
106## This holds any special options for linking temacs only (i.e., not
107## used by configure).
8009a5e8
GM
108LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
109
2f86b22b 110## Flags to pass to ld only for temacs.
ccd89fb3 111TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS)
49628785 112
c71232db
UM
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.
117PAXCTL = @PAXCTL@
118
97efb629
GM
119## Some systems define this to request special libraries.
120LIBS_SYSTEM=@LIBS_SYSTEM@
121
5a903aa9
GM
122## -lm, or empty.
123LIB_MATH=@LIB_MATH@
124
ae9e757a
JD
125## -lpthreads, or empty.
126LIB_PTHREAD=@LIB_PTHREAD@
127
0fda9b75
DC
128LIBIMAGE=@LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@
129
0dc2e11d 130XFT_LIBS=@XFT_LIBS@
0fda9b75 131LIBX_EXTRA=-lX11 $(XFT_LIBS)
8d9c8ece 132
5a903aa9
GM
133FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
134FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
135FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
136FREETYPE_LIBS = @FREETYPE_LIBS@
137LIBOTF_CFLAGS = @LIBOTF_CFLAGS@
138LIBOTF_LIBS = @LIBOTF_LIBS@
139M17N_FLT_CFLAGS = @M17N_FLT_CFLAGS@
140M17N_FLT_LIBS = @M17N_FLT_LIBS@
141
ffdc270a 142LIB_ACL=@LIB_ACL@
d35af63c 143LIB_CLOCK_GETTIME=@LIB_CLOCK_GETTIME@
73dcdb9f 144LIB_EACCESS=@LIB_EACCESS@
47d7532e 145LIB_FDATASYNC=@LIB_FDATASYNC@
89d17fd0 146LIB_TIMER_TIME=@LIB_TIMER_TIME@
d35af63c 147
19d4c244
DN
148DBUS_CFLAGS = @DBUS_CFLAGS@
149DBUS_LIBS = @DBUS_LIBS@
33cf345f 150## dbusbind.o if HAVE_DBUS, else empty.
10efe302 151DBUS_OBJ = @DBUS_OBJ@
19d4c244 152
f4a681b0
PE
153LIB_EXECINFO=@LIB_EXECINFO@
154
9851bfc5 155SETTINGS_CFLAGS = @SETTINGS_CFLAGS@
3279eb87 156SETTINGS_LIBS = @SETTINGS_LIBS@
19d4c244 157
33cf345f 158## gtkutil.o if USE_GTK, else empty.
10efe302
GM
159GTK_OBJ=@GTK_OBJ@
160
c9628c79
MA
161## gfilenotify.o if HAVE_GFILENOTIFY.
162## inotify.o if HAVE_INOTIFY.
163## w32notify.o if HAVE_W32NOTIFY.
164NOTIFY_OBJ = @NOTIFY_OBJ@
7f203aa1
EZ
165GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@
166GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@
c9628c79 167
40c17879
GM
168## -ltermcap, or -lncurses, or -lcurses, or "".
169LIBS_TERMCAP=@LIBS_TERMCAP@
170## terminfo.o if TERMINFO, else tparam.o.
171TERMCAP_OBJ=@TERMCAP_OBJ@
172
294c50a0
GM
173LIBXMU=@LIBXMU@
174
10efe302
GM
175LIBXSM=@LIBXSM@
176
8fdac2c3
GM
177LIBXTR6=@LIBXTR6@
178
3dee6fdb
GM
179## $(LIBXMU) -lXt $(LIBXTR6) -lXext if USE_X_TOOLKIT, else $(LIBXSM).
180## Only used if HAVE_X_WINDOWS.
181LIBXT_OTHER=@LIBXT_OTHER@
182
04384b2d
GM
183## If !HAVE_X11 || USE_GTK, empty.
184## Else if USE_X_TOOLKIT really-lwlib, else really-oldxmenu.
1a82cca9
GM
185OLDXMENU_TARGET=@OLDXMENU_TARGET@
186
c0b0aed5 187## If !HAVE_X11 || USE_GTK, empty.
aba1381b 188## Else if USE_X_TOOLKIT, $(lwlibdir)/liblw.a.
ff851b61 189## Else $(oldXMenudir)/libXMenu11.a.
04384b2d
GM
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.)
c0b0aed5
GM
197OLDXMENU=@OLDXMENU@
198
2cb72a75 199## If HAVE_X11 && !USE_GTK, $(OLDXMENU) ../src/$(OLDXMENU); else empty.
16455a85
GM
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,
f9f2e7f5 202## and remake temacs if lwlib gets changed by this.
16455a85
GM
203OLDXMENU_DEPS=@OLDXMENU_DEPS@
204
4235ca47
GM
205## If !HAVE_X11 && HAVE_X_WINDOWS, -lXMenu (this case no longer possible).
206## Else if !HAVE_X11 || USE_GTK, empty.
207## Else $(OLDXMENU).
208LIBXMENU=@LIBXMENU@
209
33cf345f 210## xmenu.o if HAVE_X_WINDOWS, else empty.
10efe302 211XMENU_OBJ=@XMENU_OBJ@
55a87246 212## xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o if
17a2cbbd 213## HAVE_X_WINDOWS, else empty.
10efe302
GM
214XOBJ=@XOBJ@
215
55a87246
JD
216# xgselect.o if linking with GLib, else empty
217XGSELOBJ=@XGSELOBJ@
218
986fb647 219TOOLKIT_LIBW=@TOOLKIT_LIBW@
b678dd8b 220
676b6304
GM
221## Only used if HAVE_X11, in LIBX_OTHER.
222LIBXT=$(TOOLKIT_LIBW) $(LIBXT_OTHER)
223
8a95f0e7
GM
224## If HAVE_X11, $(LIBXT) $(LIBX_EXTRA), else empty.
225LIBX_OTHER=@LIBX_OTHER@
226
9beab9ce
GM
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.
231LIBX_BASE=$(LIBXMENU) $(LD_SWITCH_X_SITE)
232
2550c6e4
AS
233## Only used for GNUstep
234LIBS_GNUSTEP=@LIBS_GNUSTEP@
235
19d4c244
DN
236LIBSOUND= @LIBSOUND@
237CFLAGS_SOUND= @CFLAGS_SOUND@
238
239RSVG_LIBS= @RSVG_LIBS@
240RSVG_CFLAGS= @RSVG_CFLAGS@
241
ce07fa9a
JV
242IMAGEMAGICK_LIBS= @IMAGEMAGICK_LIBS@
243IMAGEMAGICK_CFLAGS= @IMAGEMAGICK_CFLAGS@
244
381408e2
LMI
245LIBXML2_LIBS = @LIBXML2_LIBS@
246LIBXML2_CFLAGS = @LIBXML2_CFLAGS@
ce07fa9a 247
313546eb
LMI
248LIBZ = @LIBZ@
249
4e3f9230
YM
250XRANDR_LIBS = @XRANDR_LIBS@
251XRANDR_CFLAGS = @XRANDR_CFLAGS@
252
253XINERAMA_LIBS = @XINERAMA_LIBS@
254XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
255
b678dd8b
GM
256## widget.o if USE_X_TOOLKIT, otherwise empty.
257WIDGET_OBJ=@WIDGET_OBJ@
258
c40f9449
GM
259## sheap.o if CYGWIN, otherwise empty.
260CYGWIN_OBJ=@CYGWIN_OBJ@
261
17a2cbbd
DC
262## fontset.o fringe.o image.o if we have any window system
263WINDOW_SYSTEM_OBJ=@WINDOW_SYSTEM_OBJ@
264
dbd3f723 265## dosfns.o msdos.o w16select.o if MSDOS.
f14d1dfd
GM
266MSDOS_OBJ =
267## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS.
268MSDOS_X_OBJ =
f14d1dfd 269
e6ec4e99 270NS_OBJ=@NS_OBJ@
3fa2054e 271## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o if HAVE_NS.
00b3c7ac 272NS_OBJC_OBJ=@NS_OBJC_OBJ@
8877ca0f 273## Only set if NS_IMPL_GNUSTEP.
5a903aa9 274GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@
0fda9b75
DC
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
277## empty.
278W32_OBJ=@W32_OBJ@
279## -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32 lusp10 -lcomctl32
280## --lwinspool if HAVE_W32, else empty.
281W32_LIBS=@W32_LIBS@
e6ec4e99 282
1cf1bbd5 283## emacs.res if HAVE_W32
095bf253
EZ
284EMACSRES = @EMACSRES@
285## emacs-*.manifest if HAVE_W32
286EMACS_MANIFEST = @EMACS_MANIFEST@
f1fecede 287## If HAVE_W32, compiler arguments for including
1cf1bbd5 288## the resource file in the binary.
eb7a410c 289## Cygwin: -Wl,emacs.res
f1fecede 290## MinGW: emacs.res
1cf1bbd5
DC
291W32_RES_LINK=@W32_RES_LINK@
292
6e546d18
GM
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
296## else xfont.o
bc0b5f61
GM
297FONT_OBJ=@FONT_OBJ@
298
86e93460
EZ
299## Empty for MinGW, cm.o for the rest.
300CM_OBJ=@CM_OBJ@
301
5a903aa9 302LIBGPM = @LIBGPM@
11842bd8 303
5a903aa9
GM
304## -lresolv, or empty.
305LIBRESOLV = @LIBRESOLV@
306
2807228d
GM
307LIBSELINUX_LIBS = @LIBSELINUX_LIBS@
308
8af55556
TZ
309LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
310LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
311
2a84b02d
PE
312LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
313
19d4c244
DN
314INTERVALS_H = dispextern.h intervals.h composite.h
315
316GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
317
b8e3b0a9 318RUN_TEMACS = ./temacs
19d4c244 319
095bf253
EZ
320## Invoke ../nt/addsection for MinGW, ":" elsewhere.
321TEMACS_POST_LINK = @TEMACS_POST_LINK@
322ADDSECTION = @ADDSECTION@
323EMACS_HEAPSIZE = @EMACS_HEAPSIZE@
324MINGW_TEMACS_POST_LINK = \
325 mv temacs$(EXEEXT) temacs.tmp; \
326 ../nt/addsection temacs.tmp temacs$(EXEEXT) EMHEAP $(EMACS_HEAPSIZE)
327
eb697db5 328UNEXEC_OBJ = @UNEXEC_OBJ@
5a903aa9 329
6259c2ec 330CANNOT_DUMP=@CANNOT_DUMP@
e8752c66 331
9d5cf9b6 332DEPDIR=deps
2cb72a75 333## -MMD -MF $(DEPDIR)/$*.d if AUTO_DEPEND; else empty.
9d5cf9b6 334DEPFLAGS=@DEPFLAGS@
3fe7cdc8 335## ${MKDIR_P} ${DEPDIR} (if AUTO_DEPEND); else ':'.
9d5cf9b6
GM
336MKDEPDIR=@MKDEPDIR@
337
81ac4f35
GM
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.
342##
343## -Demacs is needed to make some files produce the correct version
344## for use in Emacs.
345##
81ac4f35 346## FIXME? MYCPPFLAGS only referenced in etc/DEBUG.
cf38a720 347ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \
9a514d4a 348 -I$(lib) -I$(srcdir)/../lib \
2cb72a75 349 $(C_SWITCH_MACHINE) $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
2f097256 350 $(GNUSTEP_CFLAGS) $(CFLAGS_SOUND) $(RSVG_CFLAGS) $(IMAGEMAGICK_CFLAGS) \
4e3f9230 351 $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) \
9851bfc5 352 $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \
876da980 353 $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \
7f203aa1 354 $(LIBGNUTLS_CFLAGS) $(GFILENOTIFY_CFLAGS) \
b8df54ff 355 $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS)
5a903aa9 356ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS)
48fad8e8 357
edfda783 358.SUFFIXES: .m
a0528984 359.c.o:
9d5cf9b6 360 @$(MKDEPDIR)
876da980 361 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $(PROFILING_CFLAGS) $<
edfda783 362.m.o:
9d5cf9b6 363 @$(MKDEPDIR)
876da980 364 $(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $(PROFILING_CFLAGS) $<
a0528984 365
81ac4f35
GM
366## lastfile must follow all files whose initialized data areas should
367## be dumped as pure by dump-emacs.
00b3c7ac 368base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
f44e260c 369 charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
86e93460 370 $(CM_OBJ) term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
a0528984
EZ
371 emacs.o keyboard.o macros.o keymap.o sysdep.o \
372 buffer.o filelock.o insdel.o marker.o \
cfd812fa 373 minibuf.o fileio.o dired.o \
a0528984
EZ
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 \
0f91ebe6 376 eval.o floatfns.o fns.o font.o print.o lread.o \
5a903aa9 377 syntax.o $(UNEXEC_OBJ) bytecode.o \
8af55556 378 process.o gnutls.o callproc.o \
a0528984 379 region-cache.o sound.o atimer.o \
c9628c79 380 doprnt.o intervals.o textprop.o composite.o xml.o $(NOTIFY_OBJ) \
313546eb 381 profiler.o decompress.o \
17a2cbbd 382 $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
55a87246 383 $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ)
00b3c7ac 384obj = $(base_obj) $(NS_OBJC_OBJ)
a0528984 385
81ac4f35
GM
386## Object files used on some machine or other.
387## These go in the DOC file on all machines in case they are needed.
33cf345f
GM
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.
04a697fe 390SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
d87a9ab8 391 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
0fda9b75 392 fontset.o dbusbind.o cygw32.o \
3fa2054e 393 nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o \
87c141ce 394 w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
33cf345f
GM
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
a0528984 398
81ac4f35 399## gmalloc.o if !SYSTEM_MALLOC && !DOUG_LEA_MALLOC, else empty.
be4ff9da 400GMALLOC_OBJ=@GMALLOC_OBJ@
2fa0eedf 401
81ac4f35 402## vm-limit.o if !SYSTEM_MALLOC, else empty.
be4ff9da 403VMLIMIT_OBJ=@VMLIMIT_OBJ@
2fa0eedf 404
81ac4f35 405## ralloc.o if !SYSTEM_MALLOC && REL_ALLOC, else empty.
40dc6bf4 406RALLOC_OBJ=@RALLOC_OBJ@
a0528984 407
095bf253 408## Empty on Cygwin and MinGW, lastfile.o elsewhere.
7acac9f4 409PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@
095bf253 410## lastfile.o on Cygwin and MinGW, empty elsewhere.
7acac9f4 411POST_ALLOC_OBJ=@POST_ALLOC_OBJ@
a0528984 412
81ac4f35 413## List of object files that make-docfile should not be told about.
40dc6bf4 414otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \
1ddc2bd6 415 $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
a0528984 416
1ddc2bd6 417## All object files linked into temacs. $(VMLIMIT_OBJ) should be first.
095bf253
EZ
418## (On MinGW, firstfile.o should be before vm-limit.o.)
419FIRSTFILE_OBJ=@FIRSTFILE_OBJ@
420ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj)
b9704ad9
GM
421
422## Configure inserts the file lisp.mk at this point, defining $lisp.
423@lisp_frag@
424
a0528984 425
81ac4f35 426## Construct full set of libraries to be linked.
2550c6e4 427LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
0fda9b75 428 $(LIBX_OTHER) $(LIBSOUND) \
ffdc270a 429 $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(LIB_CLOCK_GETTIME) \
47d7532e 430 $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \
4e3f9230 431 $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) \
2cb72a75 432 $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
9851bfc5 433 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
5a903aa9 434 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
ffdc270a 435 $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \
313546eb 436 $(GFILENOTIFY_LIBS) $(LIB_MATH) $(LIBZ)
a0528984 437
2cb72a75 438all: emacs$(EXEEXT) $(OTHER_FILES)
0aee6912 439.PHONY: all
a0528984 440
50fe702a 441$(leimdir)/leim-list.el: bootstrap-emacs$(EXEEXT)
b8e3b0a9 442 cd $(leimdir) && $(MAKE) $(MFLAGS) leim-list.el EMACS="$(bootstrap_exe)"
50fe702a 443
81ac4f35
GM
444## The dumped Emacs is as functional and more efficient than
445## bootstrap-emacs, so we replace the latter with the former.
4a720484
GM
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.
095bf253
EZ
449emacs$(EXEEXT): temacs$(EXEEXT) $(ADDSECTION) \
450 $(etc)/DOC $(lisp) $(leimdir)/leim-list.el
2cb72a75 451 if test "$(CANNOT_DUMP)" = "yes"; then \
24564fe1
GM
452 rm -f emacs$(EXEEXT); \
453 ln temacs$(EXEEXT) emacs$(EXEEXT); \
e8752c66
GM
454 else \
455 LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump || exit 1; \
c71232db 456 test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \
24564fe1
GM
457 rm -f bootstrap-emacs$(EXEEXT); \
458 ln emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
e8752c66 459 fi
a0528984 460
81ac4f35 461## We run make-docfile twice because the command line may get too long
b9704ad9
GM
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.
468##
2cb72a75
DN
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
81ac4f35
GM
472## for the first time, this prevents any variation between configurations
473## in the contents of the DOC file.
b9704ad9 474##
4a720484 475$(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
60967f56 476 $(MKDIR_P) $(etc)
aba1381b
DN
477 -rm -f $(etc)/DOC
478 $(libsrc)/make-docfile -d $(srcdir) $(SOME_MACHINE_OBJECTS) $(obj) > $(etc)/DOC
32078c8d 479 $(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) `sed -n -e 's| \\\\||' -e 's|^[ ]*$$(lispsource)/||p' $(srcdir)/lisp.mk`
a0528984 480
aba1381b 481$(libsrc)/make-docfile$(EXEEXT):
2cb72a75 482 cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT)
a0528984 483
878bde49 484buildobj.h: Makefile
c2418359
PE
485 for i in $(ALLOBJS); do \
486 echo "$$i" | sed 's,.*/,,; s/\.obj$$/\.o/; s/^/"/; s/$$/",/' \
487 || exit; \
488 done >$@.tmp
489 mv $@.tmp $@
878bde49 490
33cd3ee4 491globals.h: gl-stamp; @true
00b3c7ac
TT
492
493GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m)
494
495gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
c2418359
PE
496 $(libsrc)/make-docfile -d $(srcdir) -g $(obj) > gl.tmp
497 $(srcdir)/../build-aux/move-if-change gl.tmp globals.h
33cd3ee4 498 echo timestamp > $@
00b3c7ac 499
1ddc2bd6 500$(ALLOBJS): globals.h
00b3c7ac 501
9a514d4a
PE
502$(lib)/libgnu.a: $(config_h)
503 cd $(lib) && $(MAKE) libgnu.a
c1d0dcfd 504
60967f56
GM
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.
1ddc2bd6 509temacs$(EXEEXT): stamp-oldxmenu $(ALLOBJS) \
095bf253 510 $(lib)/libgnu.a $(EMACSRES)
1ddc2bd6 511 $(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
f1fecede 512 -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
60967f56 513 $(MKDIR_P) $(etc)
095bf253 514 $(TEMACS_POST_LINK)
c71232db
UM
515 test "$(CANNOT_DUMP)" = "yes" || \
516 test "X$(PAXCTL)" = X || $(PAXCTL) -r temacs$(EXEEXT)
a0528984 517
81ac4f35
GM
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).
5ac75e8f 521really-lwlib: globals.h
2cb72a75
DN
522 cd $(lwlibdir); $(MAKE) $(MFLAGS) \
523 CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)'
81ac4f35 524 @true # make -t should not create really-lwlib.
a0528984 525.PHONY: really-lwlib
a0528984 526
a0528984 527really-oldXMenu:
cc98b256 528 cd $(oldXMenudir); $(MAKE) $(MFLAGS) \
2cb72a75 529 CC='$(CC)' CFLAGS='$(CFLAGS)' MAKE='$(MAKE)'
81ac4f35 530 @true # make -t should not create really-oldXMenu.
a0528984 531.PHONY: really-oldXMenu
a0528984 532
81ac4f35
GM
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.
2cb72a75 535stamp-oldxmenu: $(OLDXMENU_DEPS)
a0528984 536 touch stamp-oldxmenu
16455a85 537
81ac4f35 538## Supply an ordering for parallel make.
2cb72a75 539../src/$(OLDXMENU): $(OLDXMENU)
1a82cca9
GM
540
541$(OLDXMENU): $(OLDXMENU_TARGET)
a0528984 542
224e313d
PE
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."
a0528984
EZ
546 exit 1
547
a53cfbe5
JD
548doc.o: buildobj.h
549
1cf1bbd5
DC
550emacs.res: $(ntsource)/emacs.rc \
551 $(ntsource)/icons/emacs.ico \
095bf253 552 $(ntsource)/$(EMACS_MANIFEST)
030a1c5e
EZ
553 $(WINDRES) -O COFF --include-dir=$(srcdir)/../nt \
554 -o $@ $(ntsource)/emacs.rc
a53cfbe5 555
83da1b55
GM
556ns-app: emacs$(EXEEXT)
557 cd ../nextstep && $(MAKE) $(MFLAGS) all
558
0aee6912 559.PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
8b2e00a3 560.PHONY: versionclean extraclean frc
e0f712ba 561
a0528984 562mostlyclean:
2cb72a75 563 rm -f temacs$(EXEEXT) core *.core \#* *.o libXMenu11.a liblw.a
a0528984 564 rm -f ../etc/DOC
2cb72a75 565 rm -f bootstrap-emacs$(EXEEXT) emacs-$(version)$(EXEEXT)
878bde49 566 rm -f buildobj.h
33cd3ee4 567 rm -f globals.h gl-stamp
c2418359 568 rm -f *.res *.tmp
a0528984 569clean: mostlyclean
2cb72a75
DN
570 rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT)
571 -rm -rf $(DEPDIR)
7541dad5 572
81ac4f35
GM
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.
fd13748d 576bootstrap-clean: clean
6e911150 577 rm -f epaths.h config.h config.stamp stamp-h1 stamp-oldxmenu
fd13748d
AS
578 if test -f ./.gdbinit; then \
579 mv ./.gdbinit ./.gdbinit.save; \
2cb72a75 580 if test -f "$(srcdir)/.gdbinit"; then rm -f ./.gdbinit.save; \
fd13748d
AS
581 else mv ./.gdbinit.save ./.gdbinit; fi; \
582 fi
81ac4f35
GM
583## This is used in making a distribution.
584## Do not use it on development directories!
fd13748d
AS
585distclean: bootstrap-clean
586 rm -f Makefile
a0528984
EZ
587maintainer-clean: distclean
588 @echo "This command is intended for maintainers to use;"
589 @echo "it deletes files that may require special tools to rebuild."
590 rm -f TAGS
591versionclean:
2cb72a75 592 -rm -f emacs$(EXEEXT) emacs-*.*.*$(EXEEXT) ../etc/DOC*
a0528984
EZ
593extraclean: distclean
594 -rm -f *~ \#* m/?*~ s/?*~
595
81ac4f35
GM
596## Arrange to make a tags table TAGS-LISP for ../lisp,
597## plus TAGS for the C files, which includes ../lisp/TAGS by reference.
a0528984 598
a822acff
EZ
599ctagsfiles1 = [xyzXYZ]*.[hc]
600ctagsfiles2 = [a-wA-W]*.[hc]
601ctagsfiles3 = [a-zA-Z]*.m
a0528984 602
34374650 603TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE)
2cb72a75 604 ../lib-src/etags --include=TAGS-LISP --include=$(lwlibdir)/TAGS \
a822acff
EZ
605 --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
606 $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE) \
607 --regex='{objc}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
608 $(srcdir)/$(ctagsfiles3)
a0528984
EZ
609frc:
610TAGS-LISP: frc
aba1381b 611 $(MAKE) -f $(lispdir)/Makefile TAGS-LISP ETAGS=../lib-src/etags
a0528984 612
aba1381b
DN
613$(lwlibdir)/TAGS:
614 (cd $(lwlibdir); $(MAKE) -f $(lwlibdir)/Makefile tags ETAGS=../lib-src/etags)
a0528984 615
aba1381b 616tags: TAGS TAGS-LISP $(lwlibdir)/TAGS
a0528984
EZ
617.PHONY: tags
618
619
81ac4f35
GM
620### Bootstrapping.
621
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
2cb72a75 638## bootstrap-dependencies (via $(BOOTSTRAPEMACS)). Of course, since we do
81ac4f35
GM
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
2cb72a75 641## (i.e. see the $(SUBDIR) rule ../Makefile.in).
fc46d219 642
36565815
GM
643.SUFFIXES: .elc .el
644
81ac4f35
GM
645## These suffix rules do not allow additional dependencies, sadly, so
646## instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it
647## separately below.
648## With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)"
fc46d219 649.el.elc:
82c3d67a 650 @cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \
b8e3b0a9 651 THEFILE=$< EMACS="$(bootstrap_exe)"
fc46d219 652
81ac4f35 653## Since the .el.elc rule cannot specify an extra dependency, we do it here.
4a720484 654$(lisp): $(BOOTSTRAPEMACS)
fc46d219 655
81ac4f35
GM
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.
224e313d
PE
658## If empty it is ignored; the parent makefile can set it to some other value.
659VCSWITNESS =
660
aba1381b 661$(lispsource)/loaddefs.el: $(BOOTSTRAPEMACS) $(VCSWITNESS)
b8e3b0a9 662 cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS="$(bootstrap_exe)"
49f6eb95 663
81ac4f35
GM
664## Dump an Emacs executable named bootstrap-emacs containing the
665## files from loadup.el in source form.
2cb72a75 666bootstrap-emacs$(EXEEXT): temacs$(EXEEXT)
b4945b95 667 cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
2cb72a75 668 if test "$(CANNOT_DUMP)" = "yes"; then \
24564fe1
GM
669 rm -f bootstrap-emacs$(EXEEXT); \
670 ln temacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
e8752c66
GM
671 else \
672 $(RUN_TEMACS) --batch --load loadup bootstrap || exit 1; \
c71232db 673 test "X$(PAXCTL)" = X || $(PAXCTL) -zex emacs$(EXEEXT); \
2cb72a75 674 mv -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT); \
e8752c66 675 fi
768efd84 676 @: Compile some files earlier to speed up further compilation.
b8e3b0a9 677 cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS="$(bootstrap_exe)"
a53cfbe5 678
81ac4f35 679## Insert either autodeps.mk (if AUTO_DEPEND), else deps.mk.
9d5cf9b6 680@deps_frag@
81ac4f35
GM
681
682
683### Makefile.in ends here