1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 # 2005, 2006 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 2, or (at your option)
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; see the file COPYING. If not, write to the
19 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 # Boston, MA 02110-1301, USA.
23 ALL = make-docfile hexl ctags etags movemail ebrowse sorted-doc digest-doc 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)/sorted-doc.exe: $(BLD)/sorted-doc.$(O)
40 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/sorted-doc.$(O) $(LIBS)
41 $(BLD)/digest-doc.exe: $(BLD)/digest-doc.$(O)
42 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/digest-doc.$(O) $(LIBS)
43 $(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O)
44 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/test-distrib.$(O) $(LIBS)
46 make-docfile: $(BLD) $(BLD)/make-docfile.exe
47 ctags: $(BLD) $(BLD)/ctags.exe
48 etags: $(BLD) $(BLD)/etags.exe
49 ebrowse: $(BLD) $(BLD)/ebrowse.exe
50 hexl: $(BLD) $(BLD)/hexl.exe
51 movemail: $(BLD) $(BLD)/movemail.exe
52 fakemail: $(BLD) $(BLD)/fakemail.exe
53 sorted-doc: $(BLD) $(BLD)/sorted-doc.exe
54 digest-doc: $(BLD) $(BLD)/digest-doc.exe
55 emacsclient: $(BLD) $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe
57 test-distrib: $(BLD) $(BLD)/test-distrib.exe
58 "$(BLD)/test-distrib.exe" "$(SRC)/testfile"
60 GETOPTOBJS = $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O)
61 GETOPTDEPS = $(GETOPTOBJS) getopt.h
62 MOVEMAILOBJS = $(BLD)/movemail.$(O) \
67 $(BLD)/movemail.exe: $(MOVEMAILOBJS) getopt.h
68 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
69 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(MOVEMAILOBJS) $(WSOCK32) $(LIBS)
71 ECLIENT_CFLAGS = -DHAVE_GETCWD -DHAVE_STRERROR
72 ECLIENTOBJS = $(BLD)/emacsclient.$(O) \
77 $(BLD)/emacsclient.exe: $(ECLIENTOBJS)
78 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
79 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(LIBS)
81 $(BLD)/emacsclientw.exe: $(ECLIENTOBJS)
82 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
83 $(LINK) $(LINK_OUT)$@ -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(LIBS)
85 $(BLD)/emacsclient.$(O): emacsclient.c
86 $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c
88 ETAGSOBJ = $(BLD)/etags.$(O) \
94 $(BLD)/etags.exe: $(ETAGSOBJ)
95 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ETAGSOBJ) $(LIBS)
98 EBROWSEOBJ = $(BLD)/ebrowse.$(O) \
100 $(BLD)/getopt1.$(O) \
103 $(BLD)/ebrowse.exe: $(EBROWSEOBJ)
104 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(EBROWSEOBJ) $(LIBS)
106 $(BLD)/regex.$(O): ../src/regex.c ../src/regex.h ../src/config.h
107 $(CC) $(CFLAGS) -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
108 ../src/regex.c $(CC_OUT)$@
110 ETAGS_CFLAGS = -DHAVE_GETCWD
111 $(BLD)/etags.$(O): etags.c
112 $(CC) $(CFLAGS) $(ETAGS_CFLAGS) $(CC_OUT)$@ etags.c
114 CTAGSOBJ = $(BLD)/ctags.$(O) \
116 $(BLD)/getopt1.$(O) \
120 $(BLD)/ctags.exe: $(CTAGSOBJ)
121 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(CTAGSOBJ) $(LIBS)
125 $(CP) etags.c ctags.c
127 CTAGS_CFLAGS = -DCTAGS $(ETAGS_CFLAGS)
128 $(BLD)/ctags.$(O): ctags.c
129 $(CC) $(CFLAGS) $(CTAGS_CFLAGS) $(CC_OUT)$@ ctags.c
132 # From ..\src\Makefile.in
133 # It doesn't matter if the real name is *.obj for the files in this list,
134 # make-docfile blindly replaces .o with .c anyway. Keep .o in this list
135 # as it is required by code in doc.c.
137 obj= sunfns.o dosfns.o msdos.o \
138 xterm.o xfns.o xmenu.o xselect.o xrdb.o fringe.o image.o \
139 mac.o macterm.o macfns.o macmenu.o fontset.o \
140 w32.o w32bdf.o w32console.o w32fns.o w32heap.o w32inevt.o \
141 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
142 dispnew.o frame.o scroll.o xdisp.o window.o \
143 charset.o coding.o category.o ccl.o \
144 cm.o term.o xfaces.o \
145 emacs.o keyboard.o macros.o keymap.o sysdep.o \
146 buffer.o filelock.o insdel.o marker.o \
147 minibuf.o fileio.o dired.o filemode.o \
148 cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
149 alloc.o data.o doc.o editfns.o callint.o \
150 eval.o floatfns.o fns.o print.o lread.o \
151 abbrev.o syntax.o bytecode.o \
152 process.o callproc.o \
153 region-cache.o sound.o atimer.o \
154 doprnt.o strftime.o intervals.o textprop.o composite.o md5.o
157 # These are the lisp files that are loaded up in loadup.el
159 lispsource = ../lisp/
161 MOUSE_SUPPORT = $(lispsource)select.elc $(lispsource)scroll-bar.elc $(lispsource)mouse.elc $(lispsource)tooltip.elc
162 WINNT_SUPPORT = $(lispsource)ls-lisp.elc $(lispsource)disp-table.elc $(lispsource)w32-fns.elc $(lispsource)dos-w32.elc $(lispsource)w32-vars.elc
164 # lisp files that are loaded up on other platforms
165 MSDOS_SUPPORT = $(lispsource)dos-fns.elc $(lispsource)dos-vars.elc $(lispsource)international/ccl.elc $(lispsource)international/codepage.elc
166 VMS_SUPPORT = $(lispsource)vmsproc.elc $(lispsource)vms-patch.elc
169 $(lispsource)abbrev.elc \
170 $(lispsource)buff-menu.elc \
171 $(lispsource)button.elc \
172 $(lispsource)emacs-lisp/byte-run.elc \
173 $(lispsource)cus-face.elc \
174 $(lispsource)cus-start.elc \
175 $(lispsource)custom.elc \
176 $(lispsource)emacs-lisp/backquote.elc \
177 $(lispsource)emacs-lisp/lisp-mode.elc \
178 $(lispsource)emacs-lisp/lisp.elc \
179 $(lispsource)facemenu.elc \
181 $(lispsource)faces.elc \
182 $(lispsource)files.elc \
183 $(lispsource)emacs-lisp/float-sup.elc \
184 $(lispsource)format.elc \
185 $(lispsource)frame.elc \
186 $(lispsource)help.elc \
187 $(lispsource)indent.elc \
188 $(lispsource)isearch.elc \
189 $(lispsource)rfn-eshadow.elc \
190 $(lispsource)loadup.el \
191 $(lispsource)loaddefs.el \
192 $(lispsource)bindings.elc \
193 $(lispsource)emacs-lisp/map-ynp.elc \
194 $(lispsource)env.elc \
195 $(lispsource)international/mule.elc \
196 $(lispsource)international/mule-conf.el \
197 $(lispsource)international/mule-cmds.elc \
198 $(lispsource)international/characters.elc \
199 $(lispsource)fringe.elc \
200 $(lispsource)image.elc \
201 $(lispsource)international/fontset.elc \
202 $(lispsource)dnd.elc \
203 $(lispsource)mwheel.elc \
204 $(lispsource)tool-bar.elc \
205 $(lispsource)case-table.elc
208 $(lispsource)language/chinese.elc \
209 $(lispsource)language/cyrillic.elc \
210 $(lispsource)language/indian.elc \
211 $(lispsource)language/devanagari.el \
212 $(lispsource)language/kannada.el \
213 $(lispsource)language/malayalam.el \
214 $(lispsource)language/tamil.el \
215 $(lispsource)language/english.el \
216 $(lispsource)language/ethiopic.elc \
217 $(lispsource)language/european.elc \
218 $(lispsource)language/czech.el \
219 $(lispsource)language/slovak.el \
220 $(lispsource)language/romanian.el \
221 $(lispsource)language/greek.el \
222 $(lispsource)language/hebrew.el \
223 $(lispsource)language/japanese.el \
224 $(lispsource)language/korean.el \
225 $(lispsource)language/lao.el \
226 $(lispsource)language/thai.el \
227 $(lispsource)language/tibetan.elc \
228 $(lispsource)language/vietnamese.elc \
229 $(lispsource)language/misc-lang.el \
230 $(lispsource)language/utf-8-lang.el \
231 $(lispsource)language/georgian.el \
232 $(lispsource)menu-bar.elc \
233 $(lispsource)paths.el \
234 $(lispsource)register.elc \
235 $(lispsource)replace.elc \
236 $(lispsource)simple.elc \
237 $(lispsource)startup.elc \
238 $(lispsource)subr.elc \
239 $(lispsource)term/tty-colors.elc \
240 $(lispsource)font-core.elc \
241 $(lispsource)emacs-lisp/syntax.elc \
242 $(lispsource)font-lock.elc \
243 $(lispsource)jit-lock.elc \
244 $(lispsource)textmodes/fill.elc \
245 $(lispsource)textmodes/page.elc \
246 $(lispsource)textmodes/paragraphs.elc \
247 $(lispsource)textmodes/text-mode.elc \
248 $(lispsource)emacs-lisp/timer.elc \
249 $(lispsource)vc-hooks.elc \
250 $(lispsource)jka-cmpr-hook.elc \
251 $(lispsource)ediff-hook.elc \
255 $(lispsource)widget.elc \
256 $(lispsource)window.elc \
257 $(lispsource)version.el
259 # This is needed the first time we build the tree, since temacs.exe
260 # does not exist yet, and the DOC rule needs it to rebuild DOC whenever
262 ../src/$(BLD)/temacs.exe:
263 - mkdir "../src/$(OBJDIR)"
264 - mkdir "../src/$(BLD)"
265 @echo temacs > temacs.exe
266 $(CP) temacs.exe ../src/$(BLD)
270 $(DOC): $(BLD) $(BLD)/make-docfile.exe ../src/$(BLD)/temacs.exe $(lisp1) $(lisp2)
272 "$(THISDIR)/$(BLD)/make-docfile" -o $(DOC) -d ../src $(obj)
273 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1)
274 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2)
275 $(CP) $(DOC) ../etc/DOC-X
276 - mkdir "../src/$(OBJDIR)"
277 - mkdir "../src/$(OBJDIR)/etc"
278 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC-X
280 {$(BLD)}.$(O){$(BLD)}.exe:
281 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
284 # Build the executables
286 all: $(BLD) $(ALL) $(DOC)
289 # Assuming INSTALL_DIR is defined, build and install emacs in it.
291 INSTALL_FILES = $(ALL)
292 install: $(INSTALL_FILES)
293 - mkdir "$(INSTALL_DIR)/bin"
294 $(CP) $(BLD)/etags.exe $(INSTALL_DIR)/bin
295 $(CP) $(BLD)/ebrowse.exe $(INSTALL_DIR)/bin
296 $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin
297 $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin
298 $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin
299 $(CP) $(BLD)/sorted-doc.exe $(INSTALL_DIR)/bin
300 $(CP) $(BLD)/digest-doc.exe $(INSTALL_DIR)/bin
301 $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin
302 $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin
303 - mkdir "$(INSTALL_DIR)/etc"
304 $(CP) $(DOC) $(INSTALL_DIR)/etc
310 - $(DEL) *~ DOC* $(COMPILER_TEMP_FILES)
313 - $(DEL_TREE) $(OBJDIR)
317 - $(DEL_TREE) obj-spd
322 # Headers we would preprocess if we could.
324 ../src/config.h: ../nt/$(CONFIG_H)
325 echo $(CONFIG_H) has changed. Re-run configure.bat.
336 $(BLD)/alloca.$(O) : \
338 $(EMACS_ROOT)/src/s/ms-w32.h \
339 $(EMACS_ROOT)/src/m/intel386.h \
340 $(EMACS_ROOT)/src/config.h \
341 $(EMACS_ROOT)/src/blockinput.h
345 $(EMACS_ROOT)/src/s/ms-w32.h \
346 $(EMACS_ROOT)/src/m/intel386.h \
347 $(EMACS_ROOT)/lib-src/../src/config.h
349 $(BLD)/ctags.$(O) : \
351 $(EMACS_ROOT)/nt/inc/sys/param.h \
352 $(EMACS_ROOT)/src/s/ms-w32.h \
353 $(EMACS_ROOT)/src/m/intel386.h \
354 $(EMACS_ROOT)/lib-src/../src/config.h \
358 $(BLD)/digest-doc.$(O) : \
361 $(BLD)/emacsclient.$(O) : \
362 $(SRC)/emacsclient.c \
363 $(EMACS_ROOT)/src/s/ms-w32.h \
364 $(EMACS_ROOT)/src/m/intel386.h \
365 $(EMACS_ROOT)/lib-src/../src/config.h
367 $(BLD)/etags.$(O) : \
369 $(EMACS_ROOT)/nt/inc/sys/param.h \
370 $(EMACS_ROOT)/src/s/ms-w32.h \
371 $(EMACS_ROOT)/src/m/intel386.h \
372 $(EMACS_ROOT)/lib-src/../src/config.h \
376 $(BLD)/fakemail.$(O) : \
379 $(EMACS_ROOT)/src/s/ms-w32.h \
380 $(EMACS_ROOT)/src/m/intel386.h \
381 $(EMACS_ROOT)/lib-src/../src/config.h \
382 $(EMACS_ROOT)/nt/inc/pwd.h
384 $(BLD)/getdate.$(O) : \
386 $(EMACS_ROOT)/src/s/ms-w32.h \
387 $(EMACS_ROOT)/src/m/intel386.h \
388 $(EMACS_ROOT)/src/config.h \
389 $(MSTOOLS_SYS)/types.h
391 $(BLD)/getopt.$(O) : \
393 $(EMACS_ROOT)/src/s/ms-w32.h \
394 $(EMACS_ROOT)/src/m/intel386.h \
395 $(EMACS_ROOT)/src/config.h \
399 $(BLD)/getopt1.$(O) : \
401 $(EMACS_ROOT)/src/s/ms-w32.h \
402 $(EMACS_ROOT)/src/m/intel386.h \
403 $(EMACS_ROOT)/src/config.h \
409 $(BLD)/leditcfns.$(O) : \
412 $(BLD)/make-docfile.$(O) : \
413 $(SRC)/make-docfile.c \
414 $(EMACS_ROOT)/src/config.h
416 $(BLD)/make-path.$(O) : \
419 $(BLD)/movemail.$(O) : \
421 $(EMACS_ROOT)/src/s/ms-w32.h \
422 $(EMACS_ROOT)/src/m/intel386.h \
423 $(EMACS_ROOT)/lib-src/../src/config.h \
424 $(EMACS_ROOT)/nt/inc/sys/file.h \
425 $(EMACS_ROOT)/lib-src/../src/syswait.h \
426 $(EMACS_ROOT)/nt/inc/pwd.h \
428 $(CC) $(CFLAGS) -DUSG $(CC_OUT)$@ movemail.c
430 $(BLD)/ntlib.$(O) : \
433 $(EMACS_ROOT)/nt/inc/pwd.h
440 $(BLD)/profile.$(O) : \
442 $(EMACS_ROOT)/src/s/ms-w32.h \
443 $(EMACS_ROOT)/src/m/intel386.h \
444 $(EMACS_ROOT)/lib-src/../src/config.h \
445 $(EMACS_ROOT)/lib-src/../src/systime.h
447 $(BLD)/qsort.$(O) : \
450 $(BLD)/sorted-doc.$(O) : \
451 $(SRC)/sorted-doc.c \
452 $(EMACS_ROOT)/src/s/ms-w32.h \
453 $(EMACS_ROOT)/src/m/intel386.h \
454 $(EMACS_ROOT)/src/config.h \
459 $(BLD)/test-distrib.$(O) : \
460 $(SRC)/test-distrib.c
462 $(BLD)/timer.$(O) : \
464 $(EMACS_ROOT)/src/s/ms-w32.h \
465 $(EMACS_ROOT)/src/m/intel386.h \
466 $(EMACS_ROOT)/lib-src/../src/config.h