* progmodes/cc-engine.el (c-forward-decl-or-cast-1): Use
[bpt/emacs.git] / lib-src / makefile.w32-in
... / ...
CommitLineData
1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2# Copyright (C) 2000-2011 Free Software Foundation, Inc.
3
4# This file is part of GNU Emacs.
5
6# GNU Emacs is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10
11# GNU Emacs is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15
16# You should have received a copy of the GNU General Public License
17# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
18
19
20ALL = make-docfile hexl ctags etags movemail ebrowse emacsclient
21
22.PHONY: $(ALL)
23
24LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \
25 -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../lib \
26 -I../nt/inc -I../src
27
28LIBS = $(BASE_LIBS) $(ADVAPI32)
29
30$(BLD)/make-docfile.exe: $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O)
31 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O) $(LIBS)
32$(BLD)/hexl.exe: $(BLD)/hexl.$(O)
33 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/hexl.$(O) $(LIBS)
34$(BLD)/fakemail.exe: $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O)
35 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) $(LIBS)
36$(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O)
37 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/test-distrib.$(O) $(LIBS)
38
39make-docfile: stamp_BLD $(BLD)/make-docfile.exe
40ctags: stamp_BLD $(BLD)/ctags.exe
41etags: stamp_BLD $(BLD)/etags.exe
42ebrowse: stamp_BLD $(BLD)/ebrowse.exe
43hexl: stamp_BLD $(BLD)/hexl.exe
44movemail: stamp_BLD $(BLD)/movemail.exe
45fakemail: stamp_BLD $(BLD)/fakemail.exe
46emacsclient: stamp_BLD $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe
47
48test-distrib: stamp_BLD $(BLD)/test-distrib.exe
49 "$(BLD)/test-distrib.exe" "$(SRC)/testfile"
50
51MOVEMAILOBJS = $(BLD)/movemail.$(O) \
52 $(BLD)/pop.$(O) \
53 ../lib/$(BLD)/libgnu.$(A) \
54 $(BLD)/ntlib.$(O)
55
56$(BLD)/movemail.exe: $(MOVEMAILOBJS) ../lib/getopt.h
57# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
58 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(MOVEMAILOBJS) $(WSOCK32) $(LIBS)
59
60ECLIENT_CFLAGS = -DHAVE_GETCWD -DHAVE_STRERROR
61ECLIENTOBJS = $(BLD)/emacsclient.$(O) \
62 $(BLD)/ntlib.$(O) \
63 ../lib/$(BLD)/libgnu.$(A)
64CLIENTRES = ../nt/$(BLD)/emacsclient.res
65
66$(CLIENTRES): ../nt/emacsclient.rc
67 @echo Emacsclient resource file must be built from nt directory
68 @exit -1
69
70$(BLD)/emacsclient.exe: $(ECLIENTOBJS)
71# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
72 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
73
74$(BLD)/emacsclientw.exe: $(ECLIENTOBJS) $(CLIENTRES)
75# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
76 $(LINK) $(LINK_OUT)$@ $(CLIENTRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
77
78$(BLD)/emacsclient.$(O): emacsclient.c
79 $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c
80
81ETAGSOBJ = $(BLD)/etags.$(O) \
82 ../lib/$(BLD)/libgnu.$(A) \
83 $(BLD)/ntlib.$(O) \
84 $(BLD)/regex.$(O)
85
86$(BLD)/etags.exe: $(ETAGSOBJ)
87 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ETAGSOBJ) $(LIBS)
88
89
90EBROWSEOBJ = $(BLD)/ebrowse.$(O) \
91 ../lib/$(BLD)/libgnu.$(A) \
92 $(BLD)/ntlib.$(O)
93
94$(BLD)/ebrowse.exe: $(EBROWSEOBJ)
95 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(EBROWSEOBJ) $(LIBS)
96
97$(BLD)/regex.$(O): ../src/regex.c ../src/regex.h ../src/config.h
98 $(CC) $(CFLAGS) -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
99 ../src/regex.c $(CC_OUT)$@
100
101ETAGS_CFLAGS = -DHAVE_GETCWD -DEMACS_NAME="\"GNU Emacs\""
102$(BLD)/etags.$(O): etags.c
103 $(CC) $(CFLAGS) $(ETAGS_CFLAGS) $(CC_OUT)$@ etags.c
104
105CTAGSOBJ = $(BLD)/ctags.$(O) \
106 ../lib/$(BLD)/libgnu.$(A) \
107 $(BLD)/ntlib.$(O) \
108 $(BLD)/regex.$(O)
109
110$(BLD)/ctags.exe: $(CTAGSOBJ)
111 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(CTAGSOBJ) $(LIBS)
112
113ctags.c: etags.c
114 - $(DEL) ctags.c
115 $(CP) etags.c ctags.c
116
117CTAGS_CFLAGS = -DCTAGS $(ETAGS_CFLAGS) -DEMACS_NAME="\"GNU Emacs\""
118$(BLD)/ctags.$(O): ctags.c
119 $(CC) $(CFLAGS) $(CTAGS_CFLAGS) $(CC_OUT)$@ ctags.c
120
121#
122# From ..\src\Makefile.in
123# It doesn't matter if the real name is *.obj for the files in this list,
124# make-docfile blindly replaces .o with .c anyway. Keep .o in this list
125# as it is required by code in doc.c.
126#
127obj = dosfns.o msdos.o \
128 xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
129 fontset.o menu.o \
130 w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
131 w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
132 font.o w32font.o w32uniscribe.o \
133 dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \
134 charset.o coding.o category.o ccl.o character.o chartab.o \
135 cm.o term.o terminal.o xfaces.o \
136 emacs.o keyboard.o macros.o keymap.o sysdep.o \
137 buffer.o filelock.o insdel.o marker.o \
138 minibuf.o fileio.o dired.o \
139 cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
140 alloc.o data.o doc.o editfns.o callint.o \
141 eval.o floatfns.o fns.o print.o lread.o \
142 syntax.o bytecode.o \
143 process.o callproc.o unexw32.o \
144 region-cache.o sound.o atimer.o \
145 doprnt.o intervals.o textprop.o composite.o
146
147#
148# These are the lisp files that are loaded up in loadup.el
149#
150lispsource = ../lisp/
151
152MOUSE_SUPPORT = \
153 $(lispsource)select.elc \
154 $(lispsource)scroll-bar.elc \
155 $(lispsource)mouse.elc
156WINNT_SUPPORT = \
157 $(lispsource)ls-lisp.elc \
158 $(lispsource)disp-table.elc \
159 $(lispsource)w32-fns.elc \
160 $(lispsource)dos-w32.elc \
161 $(lispsource)w32-vars.elc \
162 $(lispsource)term/common-win.elc \
163 $(lispsource)term/w32-win.elc
164TOOLTIP_SUPPORT = $(lispsource)tooltip.elc
165WINDOW_SUPPORT = \
166 $(lispsource)fringe.elc \
167 $(lispsource)image.elc \
168 $(lispsource)international/fontset.elc \
169 $(lispsource)dnd.elc \
170 $(lispsource)tool-bar.elc \
171 $(lispsource)mwheel.elc
172
173# lisp files that are loaded up on other platforms
174OTHER_PLATFORM_SUPPORT = \
175 $(lispsource)dos-fns.elc \
176 $(lispsource)dos-vars.elc \
177 $(lispsource)term/internal.elc \
178 $(lispsource)term/pc-win.elc \
179 $(lispsource)x-dnd.elc \
180 $(lispsource)term/x-win.elc \
181 $(lispsource)term/ns-win.elc
182
183
184lisp1= \
185 $(lispsource)abbrev.elc \
186 $(lispsource)buff-menu.elc \
187 $(lispsource)button.elc \
188 $(lispsource)emacs-lisp/byte-run.elc \
189 $(lispsource)composite.elc \
190 $(lispsource)cus-face.elc \
191 $(lispsource)cus-start.elc \
192 $(lispsource)custom.elc \
193 $(lispsource)emacs-lisp/backquote.elc \
194 $(lispsource)emacs-lisp/lisp-mode.elc \
195 $(lispsource)emacs-lisp/lisp.elc \
196 $(lispsource)env.elc \
197 $(lispsource)faces.elc \
198 $(lispsource)files.elc \
199 $(lispsource)format.elc \
200 $(lispsource)facemenu.elc \
201 $(MOUSE_SUPPORT) \
202 $(lispsource)emacs-lisp/float-sup.elc \
203 $(lispsource)frame.elc \
204 $(lispsource)help.elc \
205 $(lispsource)indent.elc \
206 $(lispsource)isearch.elc \
207 $(lispsource)rfn-eshadow.elc \
208 $(lispsource)loadup.el \
209 $(lispsource)loaddefs.el \
210 $(lispsource)bindings.elc \
211 $(lispsource)emacs-lisp/map-ynp.elc \
212 $(lispsource)menu-bar.elc \
213 $(lispsource)international/mule.elc \
214 $(lispsource)international/mule-conf.el \
215 $(lispsource)international/mule-cmds.elc \
216 $(lispsource)international/characters.elc \
217 $(lispsource)international/charprop.el \
218 $(lispsource)case-table.elc
219
220lisp2 = \
221 $(lispsource)language/chinese.el \
222 $(lispsource)language/cyrillic.el \
223 $(lispsource)language/indian.el \
224 $(lispsource)language/sinhala.el \
225 $(lispsource)language/english.el \
226 $(lispsource)language/ethiopic.elc \
227 $(lispsource)language/european.elc \
228 $(lispsource)language/czech.el \
229 $(lispsource)language/slovak.el \
230 $(lispsource)language/romanian.el \
231 $(lispsource)language/greek.el \
232 $(lispsource)language/hebrew.elc \
233 $(lispsource)language/japanese.el \
234 $(lispsource)language/korean.el \
235 $(lispsource)language/lao.el \
236 $(lispsource)language/cham.el \
237 $(lispsource)language/tai-viet.el \
238 $(lispsource)language/thai.el \
239 $(lispsource)language/tibetan.elc \
240 $(lispsource)language/vietnamese.el \
241 $(lispsource)language/misc-lang.el \
242 $(lispsource)language/utf-8-lang.el \
243 $(lispsource)language/georgian.el \
244 $(lispsource)language/khmer.el \
245 $(lispsource)language/burmese.el \
246 $(lispsource)paths.el \
247 $(lispsource)register.elc \
248 $(lispsource)replace.elc \
249 $(lispsource)simple.elc \
250 $(lispsource)minibuffer.elc \
251 $(lispsource)startup.elc \
252 $(lispsource)subr.elc \
253 $(lispsource)term/tty-colors.elc \
254 $(lispsource)font-core.elc \
255 $(lispsource)emacs-lisp/syntax.elc \
256 $(lispsource)font-lock.elc \
257 $(lispsource)jit-lock.elc \
258 $(lispsource)textmodes/fill.elc \
259 $(lispsource)textmodes/page.elc \
260 $(lispsource)textmodes/paragraphs.elc \
261 $(lispsource)textmodes/text-mode.elc \
262 $(lispsource)emacs-lisp/timer.elc \
263 $(lispsource)jka-cmpr-hook.elc \
264 $(lispsource)vc/vc-hooks.elc \
265 $(lispsource)vc/ediff-hook.elc \
266 $(lispsource)epa-hook.elc \
267 $(TOOLTIP_SUPPORT) \
268 $(WINNT_SUPPORT) \
269 $(WINDOW_SUPPORT) \
270 $(lispsource)widget.elc \
271 $(lispsource)window.elc \
272 $(lispsource)version.el
273
274# Used by batch-update-autoloads.
275echolisp:
276 @echo $(lisp1)
277 @echo $(lisp2)
278
279# This is needed the first time we build the tree, since temacs.exe
280# does not exist yet, and the DOC rule needs it to rebuild DOC whenever
281# Emacs is rebuilt.
282../src/$(BLD)/temacs.exe:
283 - mkdir "../src/$(OBJDIR)"
284 - mkdir "../src/$(BLD)"
285 @echo temacs > temacs.exe
286 $(CP) temacs.exe ../src/$(BLD)
287 - $(DEL) temacs.exe
288
289DOC = DOC
290$(DOC): stamp_BLD $(BLD)/make-docfile.exe ../src/$(BLD)/temacs.exe $(lisp1) $(lisp2) $(OTHER_PLATFORM_SUPPORT)
291 - $(DEL) $(DOC)
292 "$(THISDIR)/$(BLD)/make-docfile" -o $(DOC) -d ../src $(obj)
293 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1)
294 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2)
295 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(OTHER_PLATFORM_SUPPORT)
296 $(CP) $(DOC) ../etc/DOC-X
297 - mkdir "../src/$(OBJDIR)"
298 - mkdir "../src/$(OBJDIR)/etc"
299 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC-X
300
301{$(BLD)}.$(O){$(BLD)}.exe:
302 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
303
304#
305# Build the executables
306#
307all: stamp_BLD $(ALL) $(DOC)
308
309#
310# Assuming INSTALL_DIR is defined, build and install emacs in it.
311#
312INSTALL_FILES = $(ALL)
313install: $(INSTALL_FILES)
314 - mkdir "$(INSTALL_DIR)/bin"
315 $(CP) $(BLD)/etags.exe $(INSTALL_DIR)/bin
316 $(CP) $(BLD)/ebrowse.exe $(INSTALL_DIR)/bin
317 $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin
318 $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin
319 $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin
320 $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin
321 $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin
322 - mkdir "$(INSTALL_DIR)/etc"
323 $(CP) $(DOC) $(INSTALL_DIR)/etc
324
325#
326# Maintenance
327#
328# We used to delete *~ here, but that might inadvertently remove
329# precious files if it happens to match their short 8+3 aliases.
330clean:
331 - $(DEL) DOC* $(COMPILER_TEMP_FILES)
332 - $(DEL) ctags.c
333 - $(DEL_TREE) $(OBJDIR)
334 - $(DEL) stamp_BLD
335 - $(DEL) echolisp.tmp
336
337distclean: cleanall
338 - $(DEL) TAGS
339 - $(DEL) Makefile
340
341maintainer-clean: distclean
342
343cleanall: clean
344 - $(DEL_TREE) obj
345 - $(DEL_TREE) obj-spd
346 - $(DEL_TREE) oo
347 - $(DEL_TREE) oo-spd
348
349#
350# Headers we would preprocess if we could.
351#
352../src/config.h: ../nt/$(CONFIG_H)
353 $(DEL) $@
354 echo $(CONFIG_H) has changed. Re-run configure.bat.
355 exit -1
356
357### TAGS ###
358
359TAGS: $(BLD)/etags.exe *.c *.h
360 $(BLD)/etags.exe *.c *.h
361
362### DEPENDENCIES ###
363
364EMACS_ROOT = ..
365SRC = .
366
367$(BLD)/alloca.$(O) : \
368 $(SRC)/alloca.c \
369 $(EMACS_ROOT)/src/s/ms-w32.h \
370 $(EMACS_ROOT)/src/m/intel386.h \
371 $(EMACS_ROOT)/src/config.h \
372 $(EMACS_ROOT)/src/blockinput.h
373
374$(BLD)/ctags.$(O) : \
375 $(SRC)/ctags.c \
376 $(EMACS_ROOT)/nt/inc/sys/param.h \
377 $(EMACS_ROOT)/nt/inc/sys/stat.h \
378 $(EMACS_ROOT)/src/s/ms-w32.h \
379 $(EMACS_ROOT)/src/m/intel386.h \
380 $(EMACS_ROOT)/lib-src/../src/config.h \
381 $(SRC)/ntlib.h \
382 $(EMACS_ROOT)/lib/getopt.h
383
384$(BLD)/ebrowse.$(O) : \
385 $(SRC)/ebrowse.c \
386 $(EMACS_ROOT)/lib/min-max.h \
387 $(EMACS_ROOT)/src/s/ms-w32.h \
388 $(EMACS_ROOT)/src/m/intel386.h \
389 $(EMACS_ROOT)/lib-src/../src/config.h
390
391$(BLD)/emacsclient.$(O) : \
392 $(SRC)/emacsclient.c \
393 $(EMACS_ROOT)/nt/inc/sys/stat.h \
394 $(EMACS_ROOT)/src/s/ms-w32.h \
395 $(EMACS_ROOT)/src/m/intel386.h \
396 $(EMACS_ROOT)/lib-src/../src/config.h
397
398$(BLD)/etags.$(O) : \
399 $(SRC)/etags.c \
400 $(EMACS_ROOT)/nt/inc/sys/param.h \
401 $(EMACS_ROOT)/nt/inc/sys/stat.h \
402 $(EMACS_ROOT)/src/s/ms-w32.h \
403 $(EMACS_ROOT)/src/m/intel386.h \
404 $(EMACS_ROOT)/lib-src/../src/config.h \
405 $(SRC)/ntlib.h \
406 $(EMACS_ROOT)/lib/getopt.h
407
408$(BLD)/fakemail.$(O) : \
409 $(SRC)/fakemail.c \
410 $(SRC)/ntlib.h \
411 $(EMACS_ROOT)/src/s/ms-w32.h \
412 $(EMACS_ROOT)/src/m/intel386.h \
413 $(EMACS_ROOT)/lib-src/../src/config.h \
414 $(EMACS_ROOT)/nt/inc/pwd.h
415
416$(BLD)/getdate.$(O) : \
417 $(SRC)/getdate.c \
418 $(EMACS_ROOT)/src/s/ms-w32.h \
419 $(EMACS_ROOT)/src/m/intel386.h \
420 $(EMACS_ROOT)/src/config.h \
421 $(MSTOOLS_SYS)/types.h
422
423$(BLD)/hexl.$(O) : \
424 $(SRC)/hexl.c
425
426$(BLD)/leditcfns.$(O) : \
427 $(SRC)/leditcfns.c
428
429$(BLD)/make-docfile.$(O) : \
430 $(SRC)/make-docfile.c \
431 $(EMACS_ROOT)/src/config.h
432
433$(BLD)/make-path.$(O) : \
434 $(SRC)/make-path.c
435
436$(BLD)/movemail.$(O) : \
437 $(SRC)/movemail.c \
438 $(EMACS_ROOT)/src/s/ms-w32.h \
439 $(EMACS_ROOT)/src/m/intel386.h \
440 $(EMACS_ROOT)/lib-src/../src/config.h \
441 $(EMACS_ROOT)/nt/inc/sys/file.h \
442 $(EMACS_ROOT)/nt/inc/sys/stat.h \
443 $(EMACS_ROOT)/lib-src/../src/syswait.h \
444 $(EMACS_ROOT)/nt/inc/pwd.h \
445 $(SRC)/ntlib.h
446 $(CC) $(CFLAGS) -DUSG $(CC_OUT)$@ movemail.c
447
448$(BLD)/ntlib.$(O) : \
449 $(SRC)/ntlib.c \
450 $(SRC)/ntlib.h \
451 $(EMACS_ROOT)/nt/inc/sys/stat.h \
452 $(EMACS_ROOT)/nt/inc/pwd.h
453
454$(BLD)/pop.$(O) : \
455 $(SRC)/pop.c \
456 $(SRC)/pop.h \
457 $(EMACS_ROOT)/lib/min-max.h \
458 $(SRC)/ntlib.h
459
460$(BLD)/profile.$(O) : \
461 $(SRC)/profile.c \
462 $(EMACS_ROOT)/src/s/ms-w32.h \
463 $(EMACS_ROOT)/src/m/intel386.h \
464 $(EMACS_ROOT)/lib-src/../src/config.h \
465 $(EMACS_ROOT)/lib-src/../src/systime.h
466
467$(BLD)/qsort.$(O) : \
468 $(SRC)/qsort.c
469
470$(BLD)/tcp.$(O) : \
471 $(SRC)/tcp.c
472
473$(BLD)/test-distrib.$(O) : \
474 $(SRC)/test-distrib.c
475
476$(BLD)/timer.$(O) : \
477 $(SRC)/timer.c \
478 $(EMACS_ROOT)/src/s/ms-w32.h \
479 $(EMACS_ROOT)/src/m/intel386.h \
480 $(EMACS_ROOT)/lib-src/../src/config.h
481
482# The following dependencies are for supporting parallel builds, where
483# we must make sure $(BLD) exists before any compilation starts.
484#
485$(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O) $(BLD)/fakemail.$(O): stamp_BLD
486
487$(BLD)/test-distrib.$(O) $(MOVEMAILOBJS): stamp_BLD
488
489$(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD
490
491$(BLD)/ebrowse.$(O) $(BLD)/ctags.$(O): stamp_BLD