1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
3 # 2009, 2010 Free Software Foundation, Inc.
5 # This file is part of GNU Emacs.
7 # GNU Emacs is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # GNU Emacs is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21 ALL = make-docfile hexl ctags etags movemail ebrowse emacsclient
27 LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \
28 -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../nt/inc \
31 LIBS = $(BASE_LIBS) $(ADVAPI32)
33 $(BLD)/make-docfile.exe: $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O)
34 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O) $(LIBS)
35 $(BLD)/hexl.exe: $(BLD)/hexl.$(O)
36 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/hexl.$(O) $(LIBS)
37 $(BLD)/fakemail.exe: $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O)
38 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) $(LIBS)
39 $(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O)
40 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/test-distrib.$(O) $(LIBS)
42 make-docfile: stamp_BLD $(BLD)/make-docfile.exe
43 ctags: stamp_BLD $(BLD)/ctags.exe
44 etags: stamp_BLD $(BLD)/etags.exe
45 ebrowse: stamp_BLD $(BLD)/ebrowse.exe
46 hexl: stamp_BLD $(BLD)/hexl.exe
47 movemail: stamp_BLD $(BLD)/movemail.exe
48 fakemail: stamp_BLD $(BLD)/fakemail.exe
49 emacsclient: stamp_BLD $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe
51 test-distrib: stamp_BLD $(BLD)/test-distrib.exe
52 "$(BLD)/test-distrib.exe" "$(SRC)/testfile"
54 GETOPTOBJS = $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O)
55 GETOPTDEPS = $(GETOPTOBJS) getopt.h
56 MOVEMAILOBJS = $(BLD)/movemail.$(O) \
61 $(BLD)/movemail.exe: $(MOVEMAILOBJS) getopt.h
62 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
63 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(MOVEMAILOBJS) $(WSOCK32) $(LIBS)
65 ECLIENT_CFLAGS = -DHAVE_GETCWD -DHAVE_STRERROR -DVERSION="\"$(VERSION)\""
66 ECLIENTOBJS = $(BLD)/emacsclient.$(O) \
70 CLIENTRES = ../nt/$(BLD)/emacsclient.res
72 $(CLIENTRES): ../nt/emacsclient.rc
73 @echo Emacsclient resource file must be built from nt directory
76 $(BLD)/emacsclient.exe: $(ECLIENTOBJS)
77 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
78 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
80 $(BLD)/emacsclientw.exe: $(ECLIENTOBJS) $(CLIENTRES)
81 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
82 $(LINK) $(LINK_OUT)$@ $(CLIENTRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
84 # emacsclient.$(O) depends on makefile.w32-in because makefile.w32-in
85 # can be edited to define VERSION string, which is part of ECLIENT_CFLAGS.
86 $(BLD)/emacsclient.$(O): emacsclient.c makefile.w32-in
87 $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c
89 ETAGSOBJ = $(BLD)/etags.$(O) \
95 $(BLD)/etags.exe: $(ETAGSOBJ)
96 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ETAGSOBJ) $(LIBS)
99 EBROWSEOBJ = $(BLD)/ebrowse.$(O) \
101 $(BLD)/getopt1.$(O) \
104 $(BLD)/ebrowse.exe: $(EBROWSEOBJ)
105 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(EBROWSEOBJ) $(LIBS)
107 $(BLD)/regex.$(O): ../src/regex.c ../src/regex.h ../src/config.h
108 $(CC) $(CFLAGS) -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
109 ../src/regex.c $(CC_OUT)$@
111 ETAGS_CFLAGS = -DHAVE_GETCWD
112 $(BLD)/etags.$(O): etags.c
113 $(CC) $(CFLAGS) $(ETAGS_CFLAGS) $(CC_OUT)$@ etags.c
115 CTAGSOBJ = $(BLD)/ctags.$(O) \
117 $(BLD)/getopt1.$(O) \
121 $(BLD)/ctags.exe: $(CTAGSOBJ)
122 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(CTAGSOBJ) $(LIBS)
126 $(CP) etags.c ctags.c
128 CTAGS_CFLAGS = -DCTAGS $(ETAGS_CFLAGS)
129 $(BLD)/ctags.$(O): ctags.c
130 $(CC) $(CFLAGS) $(CTAGS_CFLAGS) $(CC_OUT)$@ ctags.c
133 # From ..\src\Makefile.in
134 # It doesn't matter if the real name is *.obj for the files in this list,
135 # make-docfile blindly replaces .o with .c anyway. Keep .o in this list
136 # as it is required by code in doc.c.
138 obj = dosfns.o msdos.o \
139 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
141 w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
142 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
143 font.o w32font.o w32uniscribe.o \
144 dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \
145 charset.o coding.o category.o ccl.o character.o chartab.o \
146 cm.o term.o terminal.o xfaces.o \
147 emacs.o keyboard.o macros.o keymap.o sysdep.o \
148 buffer.o filelock.o insdel.o marker.o \
149 minibuf.o fileio.o dired.o filemode.o \
150 cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
151 alloc.o data.o doc.o editfns.o callint.o \
152 eval.o floatfns.o fns.o print.o lread.o \
153 syntax.o bytecode.o \
154 process.o callproc.o unexw32.o \
155 region-cache.o sound.o atimer.o \
156 doprnt.o strftime.o intervals.o textprop.o composite.o md5.o
159 # These are the lisp files that are loaded up in loadup.el
161 lispsource = ../lisp/
164 $(lispsource)select.elc \
165 $(lispsource)scroll-bar.elc \
166 $(lispsource)mouse.elc
168 $(lispsource)ls-lisp.elc \
169 $(lispsource)disp-table.elc \
170 $(lispsource)w32-fns.elc \
171 $(lispsource)dos-w32.elc \
172 $(lispsource)w32-vars.elc \
173 $(lispsource)term/common-win.elc \
174 $(lispsource)term/w32-win.elc
175 TOOLTIP_SUPPORT = $(lispsource)tooltip.elc
177 $(lispsource)fringe.elc \
178 $(lispsource)image.elc \
179 $(lispsource)international/fontset.elc \
180 $(lispsource)dnd.elc \
181 $(lispsource)tool-bar.elc \
182 $(lispsource)mwheel.elc
184 # lisp files that are loaded up on other platforms
185 OTHER_PLATFORM_SUPPORT = \
186 $(lispsource)dos-fns.elc \
187 $(lispsource)dos-vars.elc \
188 $(lispsource)term/internal.elc \
189 $(lispsource)term/pc-win.elc \
190 $(lispsource)x-dnd.elc \
191 $(lispsource)term/x-win.elc \
192 $(lispsource)term/ns-win.elc
196 $(lispsource)abbrev.elc \
197 $(lispsource)buff-menu.elc \
198 $(lispsource)button.elc \
199 $(lispsource)emacs-lisp/byte-run.elc \
200 $(lispsource)composite.elc \
201 $(lispsource)cus-face.elc \
202 $(lispsource)cus-start.elc \
203 $(lispsource)custom.elc \
204 $(lispsource)emacs-lisp/backquote.elc \
205 $(lispsource)emacs-lisp/lisp-mode.elc \
206 $(lispsource)emacs-lisp/lisp.elc \
207 $(lispsource)env.elc \
208 $(lispsource)faces.elc \
209 $(lispsource)files.elc \
210 $(lispsource)format.elc \
211 $(lispsource)facemenu.elc \
213 $(lispsource)emacs-lisp/float-sup.elc \
214 $(lispsource)frame.elc \
215 $(lispsource)help.elc \
216 $(lispsource)indent.elc \
217 $(lispsource)isearch.elc \
218 $(lispsource)rfn-eshadow.elc \
219 $(lispsource)loadup.el \
220 $(lispsource)loaddefs.el \
221 $(lispsource)bindings.elc \
222 $(lispsource)emacs-lisp/map-ynp.elc \
223 $(lispsource)menu-bar.elc \
224 $(lispsource)international/mule.elc \
225 $(lispsource)international/mule-conf.el \
226 $(lispsource)international/mule-cmds.elc \
227 $(lispsource)international/characters.elc \
228 $(lispsource)international/charprop.el \
229 $(lispsource)case-table.elc
232 $(lispsource)language/chinese.el \
233 $(lispsource)language/cyrillic.el \
234 $(lispsource)language/indian.el \
235 $(lispsource)language/sinhala.el \
236 $(lispsource)language/english.el \
237 $(lispsource)language/ethiopic.elc \
238 $(lispsource)language/european.elc \
239 $(lispsource)language/czech.el \
240 $(lispsource)language/slovak.el \
241 $(lispsource)language/romanian.el \
242 $(lispsource)language/greek.el \
243 $(lispsource)language/hebrew.elc \
244 $(lispsource)language/japanese.el \
245 $(lispsource)language/korean.el \
246 $(lispsource)language/lao.el \
247 $(lispsource)language/cham.el \
248 $(lispsource)language/tai-viet.el \
249 $(lispsource)language/thai.el \
250 $(lispsource)language/tibetan.elc \
251 $(lispsource)language/vietnamese.el \
252 $(lispsource)language/misc-lang.el \
253 $(lispsource)language/utf-8-lang.el \
254 $(lispsource)language/georgian.el \
255 $(lispsource)language/khmer.el \
256 $(lispsource)language/burmese.el \
257 $(lispsource)paths.el \
258 $(lispsource)register.elc \
259 $(lispsource)replace.elc \
260 $(lispsource)simple.elc \
261 $(lispsource)minibuffer.elc \
262 $(lispsource)startup.elc \
263 $(lispsource)subr.elc \
264 $(lispsource)term/tty-colors.elc \
265 $(lispsource)font-core.elc \
266 $(lispsource)emacs-lisp/syntax.elc \
267 $(lispsource)font-lock.elc \
268 $(lispsource)jit-lock.elc \
269 $(lispsource)textmodes/fill.elc \
270 $(lispsource)textmodes/page.elc \
271 $(lispsource)textmodes/paragraphs.elc \
272 $(lispsource)textmodes/text-mode.elc \
273 $(lispsource)emacs-lisp/timer.elc \
274 $(lispsource)jka-cmpr-hook.elc \
275 $(lispsource)vc/vc-hooks.elc \
276 $(lispsource)vc/ediff-hook.elc \
277 $(lispsource)epa-hook.elc \
281 $(lispsource)widget.elc \
282 $(lispsource)window.elc \
283 $(lispsource)version.el
285 # Used by batch-update-autoloads.
290 # This is needed the first time we build the tree, since temacs.exe
291 # does not exist yet, and the DOC rule needs it to rebuild DOC whenever
293 ../src/$(BLD)/temacs.exe:
294 - mkdir "../src/$(OBJDIR)"
295 - mkdir "../src/$(BLD)"
296 @echo temacs > temacs.exe
297 $(CP) temacs.exe ../src/$(BLD)
301 $(DOC): stamp_BLD $(BLD)/make-docfile.exe ../src/$(BLD)/temacs.exe $(lisp1) $(lisp2) $(OTHER_PLATFORM_SUPPORT)
303 "$(THISDIR)/$(BLD)/make-docfile" -o $(DOC) -d ../src $(obj)
304 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1)
305 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2)
306 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(OTHER_PLATFORM_SUPPORT)
307 $(CP) $(DOC) ../etc/DOC-X
308 - mkdir "../src/$(OBJDIR)"
309 - mkdir "../src/$(OBJDIR)/etc"
310 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC-X
312 {$(BLD)}.$(O){$(BLD)}.exe:
313 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
316 # Build the executables
318 all: stamp_BLD $(ALL) $(DOC)
321 # Assuming INSTALL_DIR is defined, build and install emacs in it.
323 INSTALL_FILES = $(ALL)
324 install: $(INSTALL_FILES)
325 - mkdir "$(INSTALL_DIR)/bin"
326 $(CP) $(BLD)/etags.exe $(INSTALL_DIR)/bin
327 $(CP) $(BLD)/ebrowse.exe $(INSTALL_DIR)/bin
328 $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin
329 $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin
330 $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin
331 $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin
332 $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin
333 - mkdir "$(INSTALL_DIR)/etc"
334 $(CP) $(DOC) $(INSTALL_DIR)/etc
339 # We used to delete *~ here, but that might inadvertently remove
340 # precious files if it happens to match their short 8+3 aliases.
342 - $(DEL) DOC* $(COMPILER_TEMP_FILES)
345 - $(DEL_TREE) $(OBJDIR)
347 - $(DEL) echolisp.tmp
353 maintainer-clean: distclean
357 - $(DEL_TREE) obj-spd
362 # Headers we would preprocess if we could.
364 ../src/config.h: ../nt/$(CONFIG_H)
366 echo $(CONFIG_H) has changed. Re-run configure.bat.
374 TAGS: $(BLD)/etags.exe *.c *.h
375 $(BLD)/etags.exe *.c *.h
382 $(BLD)/alloca.$(O) : \
384 $(EMACS_ROOT)/src/s/ms-w32.h \
385 $(EMACS_ROOT)/src/m/intel386.h \
386 $(EMACS_ROOT)/src/config.h \
387 $(EMACS_ROOT)/src/blockinput.h
389 $(BLD)/ctags.$(O) : \
391 $(EMACS_ROOT)/nt/inc/sys/param.h \
392 $(EMACS_ROOT)/src/s/ms-w32.h \
393 $(EMACS_ROOT)/src/m/intel386.h \
394 $(EMACS_ROOT)/lib-src/../src/config.h \
398 $(BLD)/emacsclient.$(O) : \
399 $(SRC)/emacsclient.c \
400 $(EMACS_ROOT)/src/s/ms-w32.h \
401 $(EMACS_ROOT)/src/m/intel386.h \
402 $(EMACS_ROOT)/lib-src/../src/config.h
404 $(BLD)/etags.$(O) : \
406 $(EMACS_ROOT)/nt/inc/sys/param.h \
407 $(EMACS_ROOT)/src/s/ms-w32.h \
408 $(EMACS_ROOT)/src/m/intel386.h \
409 $(EMACS_ROOT)/lib-src/../src/config.h \
413 $(BLD)/fakemail.$(O) : \
416 $(EMACS_ROOT)/src/s/ms-w32.h \
417 $(EMACS_ROOT)/src/m/intel386.h \
418 $(EMACS_ROOT)/lib-src/../src/config.h \
419 $(EMACS_ROOT)/nt/inc/pwd.h
421 $(BLD)/getdate.$(O) : \
423 $(EMACS_ROOT)/src/s/ms-w32.h \
424 $(EMACS_ROOT)/src/m/intel386.h \
425 $(EMACS_ROOT)/src/config.h \
426 $(MSTOOLS_SYS)/types.h
428 $(BLD)/getopt.$(O) : \
430 $(EMACS_ROOT)/src/s/ms-w32.h \
431 $(EMACS_ROOT)/src/m/intel386.h \
432 $(EMACS_ROOT)/src/config.h \
436 $(BLD)/getopt1.$(O) : \
438 $(EMACS_ROOT)/src/s/ms-w32.h \
439 $(EMACS_ROOT)/src/m/intel386.h \
440 $(EMACS_ROOT)/src/config.h \
446 $(BLD)/leditcfns.$(O) : \
449 $(BLD)/make-docfile.$(O) : \
450 $(SRC)/make-docfile.c \
451 $(EMACS_ROOT)/src/config.h
453 $(BLD)/make-path.$(O) : \
456 $(BLD)/movemail.$(O) : \
458 $(EMACS_ROOT)/src/s/ms-w32.h \
459 $(EMACS_ROOT)/src/m/intel386.h \
460 $(EMACS_ROOT)/lib-src/../src/config.h \
461 $(EMACS_ROOT)/nt/inc/sys/file.h \
462 $(EMACS_ROOT)/lib-src/../src/syswait.h \
463 $(EMACS_ROOT)/nt/inc/pwd.h \
465 $(CC) $(CFLAGS) -DUSG $(CC_OUT)$@ movemail.c
467 $(BLD)/ntlib.$(O) : \
470 $(EMACS_ROOT)/nt/inc/pwd.h
477 $(BLD)/profile.$(O) : \
479 $(EMACS_ROOT)/src/s/ms-w32.h \
480 $(EMACS_ROOT)/src/m/intel386.h \
481 $(EMACS_ROOT)/lib-src/../src/config.h \
482 $(EMACS_ROOT)/lib-src/../src/systime.h
484 $(BLD)/qsort.$(O) : \
490 $(BLD)/test-distrib.$(O) : \
491 $(SRC)/test-distrib.c
493 $(BLD)/timer.$(O) : \
495 $(EMACS_ROOT)/src/s/ms-w32.h \
496 $(EMACS_ROOT)/src/m/intel386.h \
497 $(EMACS_ROOT)/lib-src/../src/config.h
499 # The following dependencies are for supporting parallel builds, where
500 # we must make sure $(BLD) exists before any compilation starts.
502 $(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O) $(BLD)/fakemail.$(O): stamp_BLD
504 $(BLD)/test-distrib.$(O) $(GETOPTOBJS) $(MOVEMAILOBJS): stamp_BLD
506 $(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD
508 $(BLD)/ebrowse.$(O) $(BLD)/ctags.$(O): stamp_BLD