(appt-disp-window): Move minibuffer check
[emacs.git] / nt / makefile.w32-in
blob026b8ab58033c97ba2ebf69cdb34238b93029aa7
1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.\r
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,\r
3 #    2008 Free Software Foundation, Inc.\r
4 #\r
5 # Top level makefile for building GNU Emacs on Windows NT\r
6 #\r
7 # This file is part of GNU Emacs.\r
8 \r
9 # GNU Emacs is free software: you can redistribute it and/or modify\r
10 # it under the terms of the GNU General Public License as published by\r
11 # the Free Software Foundation, either version 3 of the License, or\r
12 # (at your option) any later version.\r
14 # GNU Emacs is distributed in the hope that it will be useful,\r
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17 # GNU General Public License for more details.\r
19 # You should have received a copy of the GNU General Public License\r
20 # along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.\r
23 # FIXME: This file uses DOS EOLs.  Convert to Unix after 22.1 is out\r
24 #        (and remove or replace this comment).\r
26 TRES            = $(BLD)/emacs.res\r
27 CLIENTRES       = $(BLD)/emacsclient.res\r
29 XMFLAGS         =\r
31 ALL             = addpm ddeclient runemacs cmdproxy addsection preprep\r
33 .PHONY: $(ALL)\r
36 addpm:            stamp_BLD $(BLD)/addpm.exe\r
37 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)\r
38                   $(LINK) $(LINK_OUT)$@ \\r
39                   $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)\r
41 ddeclient:        stamp_BLD $(BLD)/ddeclient.exe\r
42 $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)\r
43                   $(LINK) $(LINK_OUT)$@ \\r
44                   $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)\r
46 cmdproxy:         stamp_BLD $(BLD)/cmdproxy.exe\r
47 $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)\r
48                   $(LINK) $(LINK_OUT)$@ \\r
49                   $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)\r
51 addsection:       stamp_BLD $(BLD)/addsection.exe\r
52 $(BLD)/addsection.exe: $(BLD)/addsection.$(O)\r
53                   $(LINK) $(LINK_OUT)$@ \\r
54                   $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)\r
56 preprep:          stamp_BLD $(BLD)/preprep.exe\r
57 $(BLD)/preprep.exe: $(BLD)/preprep.$(O)\r
58                   $(LINK) $(LINK_OUT)$@ \\r
59                   $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)\r
61 #\r
62 # The resource file.  NT 3.10 requires the use of cvtres; even though\r
63 # it is not necessary on later versions, it is still ok to use it.\r
64 #\r
65 $(TRES):        emacs.rc icons/emacs.ico emacs.manifest stamp_BLD\r
66                 $(RC) $(RC_OUT)$(TRES) emacs.rc\r
68 $(CLIENTRES):   emacsclient.rc stamp_BLD\r
69                 $(RC) $(RC_OUT)$(CLIENTRES) emacsclient.rc\r
71 runemacs:         stamp_BLD $(BLD)/runemacs.exe\r
72 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)\r
73                   $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \\r
74                   $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)\r
76 which-sh:\r
77         @echo Using $(THE_SHELL) as shell.\r
79 # These depend on stamp_BLD to make sure the $(BLD) directory is created\r
80 # before the compilation begins, even if Make runs several commands\r
81 # in parallel under "make -j".\r
82 #\r
83 $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O) $(BLD)/addsection.$(O) $(BLD)/preprep.$(O): stamp_BLD\r
85 #\r
86 # Build emacs\r
87 #\r
88 all:    which-sh stamp_BLD $(ALL) $(CLIENTRES) maybe-bootstrap all-other-dirs-$(MAKETYPE)\r
90 all-other-dirs-nmake: addsection\r
91         cd ..\lib-src\r
92         $(MAKE) $(MFLAGS) all\r
93         cd ..\src\r
94         $(MAKE) $(MFLAGS) all\r
95         cd ..\lisp\r
96         $(MAKE) $(MFLAGS) all\r
97         cd ..\leim\r
98         $(MAKE) $(MFLAGS) all\r
99         cd ..\nt\r
101 all-other-dirs-gmake: addsection\r
102         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src all\r
103         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src all\r
104         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp all\r
105         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim all\r
107 recompile:      recompile-$(MAKETYPE)\r
109 recompile-nmake:\r
110         cd ..\lisp\r
111         $(MAKE) $(MFLAGS) recompile\r
112         cd ..\nt\r
114 recompile-gmake:\r
115         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp recompile\r
117 #### Bootstrapping.\r
119 ### This is meant for Emacs maintainers only.  It first cleans the\r
120 ### lisp subdirectory, removing all compiled Lisp files.  Then a\r
121 ### special emacs executable is built from Lisp sources, which is then\r
122 ### used to compile Lisp files.  The last step is a "normal" make.\r
124 maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)\r
126 # dummy target to force other targets to be evaluated.\r
127 doit:\r
129 maybe-bootstrap-CMD:    doit\r
130         @echo .\r
131         @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing.  You should either\r
132         @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow\r
133         @echo .\r
134         @if not EXIST ..\lisp\abbrev.elc exit -1\r
136 maybe-bootstrap-SH: doit\r
137         @if [ ! -f ../lisp/abbrev.elc ] ; then \\r
138           echo; \\r
139           echo "Essential Lisp files seem to be missing.  You should either"; \\r
140           echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow.";  \\r
141           echo; \\r
142           exit -1; \\r
143         fi\r
145 # Bootstrap depends on cmdproxy because some Lisp functions\r
146 # loaded during bootstrap may need to run shell commands.\r
147 bootstrap:      addsection cmdproxy bootstrap-$(MAKETYPE)\r
148         $(MAKE) $(MFLAGS) $(XMFLAGS) all\r
150 bootstrap-nmake: addsection cmdproxy\r
151         cd ..\lisp\r
152         $(MAKE) $(MFLAGS) bootstrap-clean\r
153         cd ..\src\r
154         $(MAKE) $(MFLAGS) clean\r
155         cd ..\lib-src\r
156         $(MAKE) $(MFLAGS) clean\r
157         cd ..\src\r
158         $(MAKE) $(MFLAGS) bootstrap\r
159         $(MAKE) $(MFLAGS) bootstrap-clean\r
160         cd ..\nt\r
161         $(CP) $(BLD)/cmdproxy.exe ../bin\r
162         cd ..\lisp\r
163         $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap\r
164         cd ..\lib-src\r
165         $(MAKE) $(MFLAGS) DOC\r
166         cd ..\nt\r
168 bootstrap-gmake: addsection cmdproxy\r
169         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean\r
170         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean\r
171         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean\r
172         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap\r
173         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean\r
174         $(CP) $(BLD)/cmdproxy.exe ../bin\r
175         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap\r
176         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src DOC\r
178 bootstrap-clean: bootstrap-clean-$(MAKETYPE)\r
180 bootstrap-clean-nmake:\r
181         cd ..\src\r
182         $(MAKE) $(MFLAGS) bootstrap-clean\r
183         cd ..\lisp\r
184         $(MAKE) $(MFLAGS) bootstrap-clean\r
186 bootstrap-clean-gmake:\r
187         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean\r
188         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean\r
190 $(INSTALL_DIR):\r
191         - mkdir "$(INSTALL_DIR)"\r
193 $(INSTALL_DIR)/bin: $(INSTALL_DIR)\r
194         - mkdir "$(INSTALL_DIR)/bin"\r
197 # Build and install emacs in INSTALL_DIR\r
199 install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)\r
200         - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin\r
201         - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin\r
202         - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin\r
203         - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin\r
204         - "$(INSTALL_DIR)/bin/addpm" -q\r
205         - $(DEL) ../same-dir.tst\r
206         - $(DEL) $(INSTALL_DIR)/same-dir.tst\r
207         echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"\r
208         - mkdir "$(INSTALL_DIR)/etc"\r
209         - mkdir "$(INSTALL_DIR)/info"\r
210         - mkdir "$(INSTALL_DIR)/lock"\r
211         - mkdir "$(INSTALL_DIR)/data"\r
212         - mkdir "$(INSTALL_DIR)/site-lisp"\r
213         - mkdir "$(INSTALL_DIR)/etc/icons"\r
214         $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF)\r
215         $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)\r
216         - $(CP_DIR) icons $(INSTALL_DIR)/etc\r
217         $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)\r
218         $(IFNOTSAMEDIR) $(CP) ../COPYING $(INSTALL_DIR) $(ENDIF)\r
219         - $(CP) ../COPYING $(INSTALL_DIR)/bin\r
220         - $(DEL) ../same-dir.tst\r
221         - $(DEL) $(INSTALL_DIR)/same-dir.tst\r
223 install-other-dirs-nmake:\r
224         cd ..\lib-src\r
225         $(MAKE) $(MFLAGS) install\r
226         cd ..\src\r
227         $(MAKE) $(MFLAGS) install\r
228         cd ..\lisp\r
229         $(MAKE) $(MFLAGS) install\r
230         cd ..\leim\r
231         $(MAKE) $(MFLAGS) install\r
232         cd ..\nt\r
234 install-other-dirs-gmake:\r
235         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src install\r
236         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src install\r
237         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp install\r
238         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install\r
240 force-info:\r
241 # Note that doc/emacs/makefile knows how to\r
242 # put the info files in $(infodir),\r
243 # so we can do ok running make in the build dir.\r
244 info: force-info info-$(MAKETYPE)\r
246 info-nmake:\r
247         cd ..\doc\emacs\r
248         $(MAKE) $(MFLAGS) info\r
249         cd ..\misc\r
250         $(MAKE) $(MFLAGS) info\r
251         cd ..\lispref\r
252         $(MAKE) $(MFLAGS) info\r
253         cd ..\lispintro\r
254         $(MAKE) $(MFLAGS) info\r
255         cd $(MAKEDIR)\r
257 info-gmake:\r
258         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs info\r
259         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc info\r
260         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref info\r
261         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro info\r
263 # Maintenance\r
265 clean:  clean-other-dirs-$(MAKETYPE)\r
266         - $(DEL) $(COMPILER_TEMP_FILES)\r
267         - $(DEL_TREE) $(OBJDIR)\r
268         - $(DEL) stamp_BLD\r
269         - $(DEL) ../etc/DOC ../etc/DOC-X\r
271 clean-other-dirs-nmake:\r
272         cd ..\lib-src\r
273         $(MAKE) $(MFLAGS) clean\r
274         cd ..\src\r
275         $(MAKE) $(MFLAGS) clean\r
276         cd ..\doc\lispintro\r
277         $(MAKE) $(MFLAGS) clean\r
278         cd ..\doc\lispref\r
279         $(MAKE) $(MFLAGS) clean\r
280         cd ..\leim\r
281         $(MAKE) $(MFLAGS) clean\r
282         cd ..\doc\emacs\r
283         $(MAKE) $(MFLAGS) clean\r
284         cd ..\doc\misc\r
285         $(MAKE) $(MFLAGS) clean\r
286         cd ..\nt\r
288 clean-other-dirs-gmake:\r
289         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean\r
290         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean\r
291         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim clean\r
292         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs clean\r
293         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc clean\r
294         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro clean\r
295         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref clean\r
297 cleanall-other-dirs-nmake:\r
298         cd ..\lib-src\r
299         $(MAKE) $(MFLAGS) cleanall\r
300         cd ..\src\r
301         $(MAKE) $(MFLAGS) cleanall\r
302         cd ..\nt\r
304 cleanall-other-dirs-gmake:\r
305         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src cleanall\r
306         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src cleanall\r
308 # We used to delete *~ here, but that might inadvertently remove\r
309 # precious files if it happens to match their short 8+3 aliases.\r
310 cleanall: clean cleanall-other-dirs-$(MAKETYPE)\r
311          - $(DEL_TREE) obj\r
312          - $(DEL_TREE) obj-spd\r
313          - $(DEL_TREE) oo\r
314          - $(DEL_TREE) oo-spd\r
316 top-distclean:\r
317         - $(DEL) $(COMPILER_TEMP_FILES)\r
318         - $(DEL_TREE) obj\r
319         - $(DEL_TREE) obj-spd\r
320         - $(DEL_TREE) oo\r
321         - $(DEL_TREE) oo-spd\r
322         - $(DEL) stamp_BLD\r
323         - $(DEL) ../etc/DOC ../etc/DOC-X\r
324         - $(DEL) config.log Makefile\r
326 distclean: distclean-other-dirs-$(MAKETYPE) top-distclean\r
328 distclean-other-dirs-nmake:\r
329         cd ..\lib-src\r
330         $(MAKE) $(MFLAGS) distclean\r
331         cd ..\src\r
332         $(MAKE) $(MFLAGS) distclean\r
333         cd ..\lisp\r
334         $(MAKE) $(MFLAGS) distclean\r
335         cd ..\leim\r
336         $(MAKE) $(MFLAGS) distclean\r
337         cd ..\doc\emacs\r
338         $(MAKE) $(MFLAGS) distclean\r
339         cd ..\doc\misc\r
340         $(MAKE) $(MFLAGS) distclean\r
341         cd ..\doc\lispintro\r
342         $(MAKE) $(MFLAGS) distclean\r
343         cd ..\doc\lispref\r
344         $(MAKE) $(MFLAGS) distclean\r
345         cd ..\nt\r
347 distclean-other-dirs-gmake:\r
348         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src distclean\r
349         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src distclean\r
350         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp distclean\r
351         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim distclean\r
352         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs distclean\r
353         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc distclean\r
354         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro distclean\r
355         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref distclean\r
357 maintainer-clean: maintainer-clean-other-dirs-$(MAKETYPE) top-distclean\r
359 maintainer-clean-other-dirs-nmake:\r
360         cd ..\lib-src\r
361         $(MAKE) $(MFLAGS) maintainer-clean\r
362         cd ..\src\r
363         $(MAKE) $(MFLAGS) maintainer-clean\r
364         cd ..\lisp\r
365         $(MAKE) $(MFLAGS) maintainer-clean\r
366         cd ..\leim\r
367         $(MAKE) $(MFLAGS) maintainer-clean\r
368         cd ..\doc\emacs\r
369         $(MAKE) $(MFLAGS) maintainer-clean\r
370         cd ..\doc\misc\r
371         $(MAKE) $(MFLAGS) maintainer-clean\r
372         cd ..\doc\lispintro\r
373         $(MAKE) $(MFLAGS) maintainer-clean\r
374         cd ..\doc\lispref\r
375         $(MAKE) $(MFLAGS) maintainer-clean\r
376         cd ..\nt\r
378 maintainer-clean-other-dirs-gmake:\r
379         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src maintainer-clean\r
380         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src maintainer-clean\r
381         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp maintainer-clean\r
382         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim maintainer-clean\r
383         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs maintainer-clean\r
384         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc maintainer-clean\r
385         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro maintainer-clean\r
386         $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref maintainer-clean\r
388 realclean: cleanall\r
389         - $(DEL_TREE) ../bin\r