Merge from emacs--devo--0
[bpt/emacs.git] / lib-src / makefile.w32-in
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.
4 #
5 # This file is part of GNU Emacs.
6 #
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)
10 # any later version.
11 #
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.
16 #
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.
21 #
22
23 ALL = make-docfile hexl ctags etags movemail ebrowse sorted-doc digest-doc emacsclient
24
25 .PHONY: $(ALL)
26
27 LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \
28 -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../nt/inc \
29 -I../src
30
31 LIBS = $(BASE_LIBS) $(ADVAPI32)
32
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)
45
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
56
57 test-distrib: $(BLD) $(BLD)/test-distrib.exe
58 "$(BLD)/test-distrib.exe" "$(SRC)/testfile"
59
60 GETOPTOBJS = $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O)
61 GETOPTDEPS = $(GETOPTOBJS) getopt.h
62 MOVEMAILOBJS = $(BLD)/movemail.$(O) \
63 $(BLD)/pop.$(O) \
64 $(BLD)/ntlib.$(O) \
65 $(GETOPTOBJS)
66
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)
70
71 ECLIENT_CFLAGS = -DHAVE_GETCWD -DHAVE_STRERROR
72 ECLIENTOBJS = $(BLD)/emacsclient.$(O) \
73 $(BLD)/getopt.$(O) \
74 $(BLD)/getopt1.$(O) \
75 $(BLD)/ntlib.$(O)
76
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)
80
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)
84
85 $(BLD)/emacsclient.$(O): emacsclient.c
86 $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c
87
88 ETAGSOBJ = $(BLD)/etags.$(O) \
89 $(BLD)/getopt.$(O) \
90 $(BLD)/getopt1.$(O) \
91 $(BLD)/ntlib.$(O) \
92 $(BLD)/regex.$(O)
93
94 $(BLD)/etags.exe: $(ETAGSOBJ)
95 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ETAGSOBJ) $(LIBS)
96
97
98 EBROWSEOBJ = $(BLD)/ebrowse.$(O) \
99 $(BLD)/getopt.$(O) \
100 $(BLD)/getopt1.$(O) \
101 $(BLD)/ntlib.$(O)
102
103 $(BLD)/ebrowse.exe: $(EBROWSEOBJ)
104 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(EBROWSEOBJ) $(LIBS)
105
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)$@
109
110 ETAGS_CFLAGS = -DHAVE_GETCWD
111 $(BLD)/etags.$(O): etags.c
112 $(CC) $(CFLAGS) $(ETAGS_CFLAGS) $(CC_OUT)$@ etags.c
113
114 CTAGSOBJ = $(BLD)/ctags.$(O) \
115 $(BLD)/getopt.$(O) \
116 $(BLD)/getopt1.$(O) \
117 $(BLD)/ntlib.$(O) \
118 $(BLD)/regex.$(O)
119
120 $(BLD)/ctags.exe: $(CTAGSOBJ)
121 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(CTAGSOBJ) $(LIBS)
122
123 ctags.c: etags.c
124 - $(DEL) ctags.c
125 $(CP) etags.c ctags.c
126
127 CTAGS_CFLAGS = -DCTAGS $(ETAGS_CFLAGS)
128 $(BLD)/ctags.$(O): ctags.c
129 $(CC) $(CFLAGS) $(CTAGS_CFLAGS) $(CC_OUT)$@ ctags.c
130
131 #
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.
136 #
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
155
156 #
157 # These are the lisp files that are loaded up in loadup.el
158 #
159 lispsource = ../lisp/
160
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
163
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
167
168 lisp1= \
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 \
180 $(MOUSE_SUPPORT) \
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
206
207 lisp2 = \
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 \
252 $(VMS_SUPPORT) \
253 $(MSDOS_SUPPORT) \
254 $(WINNT_SUPPORT) \
255 $(lispsource)widget.elc \
256 $(lispsource)window.elc \
257 $(lispsource)version.el
258
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
261 # Emacs is rebuilt.
262 ../src/$(BLD)/temacs.exe:
263 - mkdir "../src/$(OBJDIR)"
264 - mkdir "../src/$(BLD)"
265 @echo temacs > temacs.exe
266 $(CP) temacs.exe ../src/$(BLD)
267 - $(DEL) temacs.exe
268
269 DOC = DOC
270 $(DOC): $(BLD) $(BLD)/make-docfile.exe ../src/$(BLD)/temacs.exe $(lisp1) $(lisp2)
271 - $(DEL) $(DOC)
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
279
280 {$(BLD)}.$(O){$(BLD)}.exe:
281 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
282
283 #
284 # Build the executables
285 #
286 all: $(BLD) $(ALL) $(DOC)
287
288 #
289 # Assuming INSTALL_DIR is defined, build and install emacs in it.
290 #
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
305
306 #
307 # Maintenance
308 #
309 clean:
310 - $(DEL) *~ DOC* $(COMPILER_TEMP_FILES)
311 - $(DEL) ctags.c
312 - $(DEL) getopt.h
313 - $(DEL_TREE) $(OBJDIR)
314
315 cleanall: clean
316 - $(DEL_TREE) obj
317 - $(DEL_TREE) obj-spd
318 - $(DEL_TREE) oo
319 - $(DEL_TREE) oo-spd
320
321 #
322 # Headers we would preprocess if we could.
323 #
324 ../src/config.h: ../nt/$(CONFIG_H)
325 echo $(CONFIG_H) has changed. Re-run configure.bat.
326 exit -1
327
328 getopt.h: getopt_.h
329 $(CP) $(ALL_DEPS) $@
330
331 ### DEPENDENCIES ###
332
333 EMACS_ROOT = ..
334 SRC = .
335
336 $(BLD)/alloca.$(O) : \
337 $(SRC)/alloca.c \
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
342
343 $(BLD)/b2m.$(O) : \
344 $(SRC)/b2m.c \
345 $(EMACS_ROOT)/src/s/ms-w32.h \
346 $(EMACS_ROOT)/src/m/intel386.h \
347 $(EMACS_ROOT)/lib-src/../src/config.h
348
349 $(BLD)/ctags.$(O) : \
350 $(SRC)/ctags.c \
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 \
355 $(SRC)/ntlib.h \
356 $(SRC)/getopt.h
357
358 $(BLD)/digest-doc.$(O) : \
359 $(SRC)/digest-doc.c
360
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
366
367 $(BLD)/etags.$(O) : \
368 $(SRC)/etags.c \
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 \
373 $(SRC)/ntlib.h \
374 $(SRC)/getopt.h
375
376 $(BLD)/fakemail.$(O) : \
377 $(SRC)/fakemail.c \
378 $(SRC)/ntlib.h \
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
383
384 $(BLD)/getdate.$(O) : \
385 $(SRC)/getdate.c \
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
390
391 $(BLD)/getopt.$(O) : \
392 $(SRC)/getopt.c \
393 $(EMACS_ROOT)/src/s/ms-w32.h \
394 $(EMACS_ROOT)/src/m/intel386.h \
395 $(EMACS_ROOT)/src/config.h \
396 $(SRC)/ntlib.h \
397 $(SRC)/getopt.h
398
399 $(BLD)/getopt1.$(O) : \
400 $(SRC)/getopt1.c \
401 $(EMACS_ROOT)/src/s/ms-w32.h \
402 $(EMACS_ROOT)/src/m/intel386.h \
403 $(EMACS_ROOT)/src/config.h \
404 $(SRC)/getopt.h
405
406 $(BLD)/hexl.$(O) : \
407 $(SRC)/hexl.c
408
409 $(BLD)/leditcfns.$(O) : \
410 $(SRC)/leditcfns.c
411
412 $(BLD)/make-docfile.$(O) : \
413 $(SRC)/make-docfile.c \
414 $(EMACS_ROOT)/src/config.h
415
416 $(BLD)/make-path.$(O) : \
417 $(SRC)/make-path.c
418
419 $(BLD)/movemail.$(O) : \
420 $(SRC)/movemail.c \
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 \
427 $(SRC)/ntlib.h
428 $(CC) $(CFLAGS) -DUSG $(CC_OUT)$@ movemail.c
429
430 $(BLD)/ntlib.$(O) : \
431 $(SRC)/ntlib.c \
432 $(SRC)/ntlib.h \
433 $(EMACS_ROOT)/nt/inc/pwd.h
434
435 $(BLD)/pop.$(O) : \
436 $(SRC)/pop.c \
437 $(SRC)/pop.h \
438 $(SRC)/ntlib.h
439
440 $(BLD)/profile.$(O) : \
441 $(SRC)/profile.c \
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
446
447 $(BLD)/qsort.$(O) : \
448 $(SRC)/qsort.c
449
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 \
455
456 $(BLD)/tcp.$(O) : \
457 $(SRC)/tcp.c
458
459 $(BLD)/test-distrib.$(O) : \
460 $(SRC)/test-distrib.c
461
462 $(BLD)/timer.$(O) : \
463 $(SRC)/timer.c \
464 $(EMACS_ROOT)/src/s/ms-w32.h \
465 $(EMACS_ROOT)/src/m/intel386.h \
466 $(EMACS_ROOT)/lib-src/../src/config.h