1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
\r
2 # Copyright (C) 2000-2011 Free Software Foundation, Inc.
\r
4 # Top level makefile for building GNU Emacs on Windows NT
\r
6 # This file is part of GNU Emacs.
\r
8 # GNU Emacs is free software: you can redistribute it and/or modify
\r
9 # it under the terms of the GNU General Public License as published by
\r
10 # the Free Software Foundation, either version 3 of the License, or
\r
11 # (at your option) any later version.
\r
13 # GNU Emacs is distributed in the hope that it will be useful,
\r
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 # GNU General Public License for more details.
\r
18 # You should have received a copy of the GNU General Public License
\r
19 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
\r
22 # FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out
\r
23 # (and remove or replace this comment).
\r
27 TMP_DIST_DIR = emacs-$(VERSION)
\r
29 TRES = $(BLD)/emacs.res
\r
30 CLIENTRES = $(BLD)/emacsclient.res
\r
34 ALL = addpm ddeclient runemacs cmdproxy addsection preprep
\r
39 addpm: stamp_BLD $(BLD)/addpm.exe
\r
40 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)
\r
41 $(LINK) $(LINK_OUT)$@ \
\r
42 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) \
\r
43 $(USER32) $(OLE32) $(UUID) $(SHELL32)
\r
45 ddeclient: stamp_BLD $(BLD)/ddeclient.exe
\r
46 $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)
\r
47 $(LINK) $(LINK_OUT)$@ \
\r
48 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
50 cmdproxy: stamp_BLD $(BLD)/cmdproxy.exe
\r
51 $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)
\r
52 $(LINK) $(LINK_OUT)$@ \
\r
53 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
55 addsection: stamp_BLD $(BLD)/addsection.exe
\r
56 $(BLD)/addsection.exe: $(BLD)/addsection.$(O)
\r
57 $(LINK) $(LINK_OUT)$@ \
\r
58 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
60 preprep: stamp_BLD $(BLD)/preprep.exe
\r
61 $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
\r
62 $(LINK) $(LINK_OUT)$@ \
\r
63 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)
\r
66 # The resource file. NT 3.10 requires the use of cvtres; even though
\r
67 # it is not necessary on later versions, it is still ok to use it.
\r
69 $(TRES): emacs.rc icons/emacs.ico emacs.manifest stamp_BLD
\r
70 $(RC) $(RC_OUT)$(TRES) emacs.rc
\r
72 $(CLIENTRES): emacsclient.rc stamp_BLD
\r
73 $(RC) $(RC_OUT)$(CLIENTRES) emacsclient.rc
\r
75 runemacs: stamp_BLD $(BLD)/runemacs.exe
\r
76 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
\r
77 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \
\r
78 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
81 @echo Using $(THE_SHELL) as shell.
\r
83 # These depend on stamp_BLD to make sure the $(BLD) directory is created
\r
84 # before the compilation begins, even if Make runs several commands
\r
85 # in parallel under "make -j".
\r
87 $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O) $(BLD)/addsection.$(O) $(BLD)/preprep.$(O): stamp_BLD
\r
92 all: which-sh stamp_BLD $(ALL) $(CLIENTRES) maybe-bootstrap all-other-dirs-$(MAKETYPE)
\r
94 all-other-dirs-nmake: addsection
\r
96 $(MAKE) $(MFLAGS) all
\r
98 $(MAKE) $(MFLAGS) all
\r
100 $(MAKE) $(MFLAGS) all
\r
102 $(MAKE) $(MFLAGS) all
\r
104 $(MAKE) $(MFLAGS) all
\r
107 all-other-dirs-gmake: addsection
\r
108 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib all
\r
109 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src all
\r
110 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src all
\r
111 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp all
\r
112 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim all
\r
114 recompile: recompile-$(MAKETYPE)
\r
118 $(MAKE) $(MFLAGS) recompile
\r
122 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp recompile
\r
124 #### Bootstrapping.
\r
126 ### This is meant for Emacs maintainers only. It first cleans the
\r
127 ### lisp subdirectory, removing all compiled Lisp files. Then a
\r
128 ### special emacs executable is built from Lisp sources, which is then
\r
129 ### used to compile Lisp files. The last step is a "normal" make.
\r
131 maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)
\r
133 # dummy target to force other targets to be evaluated.
\r
136 maybe-bootstrap-CMD: doit
\r
138 @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either
\r
139 @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow
\r
141 @if not EXIST ..\lisp\abbrev.elc exit -1
\r
143 maybe-bootstrap-SH: doit
\r
144 @if [ ! -f ../lisp/abbrev.elc ] ; then \
\r
146 echo "Essential Lisp files seem to be missing. You should either"; \
\r
147 echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \
\r
152 # Bootstrap depends on cmdproxy because some Lisp functions
\r
153 # loaded during bootstrap may need to run shell commands.
\r
154 bootstrap: addsection cmdproxy bootstrap-$(MAKETYPE)
\r
155 $(MAKE) $(MFLAGS) $(XMFLAGS) all
\r
157 bootstrap-nmake: addsection cmdproxy
\r
159 $(MAKE) $(MFLAGS) bootstrap-clean
\r
161 $(MAKE) $(MFLAGS) clean
\r
163 $(MAKE) $(MFLAGS) clean make-docfile
\r
165 $(MAKE) $(MFLAGS) clean all
\r
167 $(MAKE) $(MFLAGS) bootstrap
\r
168 $(MAKE) $(MFLAGS) bootstrap-clean
\r
170 $(CP) $(BLD)/cmdproxy.exe ../bin
\r
172 $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
\r
174 $(MAKE) $(MFLAGS) DOC
\r
177 bootstrap-gmake: addsection cmdproxy
\r
178 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
\r
179 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
\r
180 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean make-docfile
\r
181 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean all
\r
182 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap
\r
183 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
\r
184 $(CP) $(BLD)/cmdproxy.exe ../bin
\r
185 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap
\r
186 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src DOC
\r
188 bootstrap-clean: bootstrap-clean-$(MAKETYPE)
\r
190 bootstrap-clean-nmake:
\r
192 $(MAKE) $(MFLAGS) bootstrap-clean
\r
194 $(MAKE) $(MFLAGS) clean
\r
196 $(MAKE) $(MFLAGS) bootstrap-clean
\r
198 bootstrap-clean-gmake:
\r
199 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
\r
200 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean
\r
201 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
\r
204 - mkdir "$(INSTALL_DIR)"
\r
206 $(INSTALL_DIR)/bin: $(INSTALL_DIR)
\r
207 - mkdir "$(INSTALL_DIR)/bin"
\r
210 # Build and install emacs in INSTALL_DIR
\r
212 .PHONY: install-bin install-shortcuts
\r
214 install: install-bin install-shortcuts
\r
216 install-bin: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
\r
217 - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin
\r
218 - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
\r
219 - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
\r
220 - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
\r
221 - $(CP) README.W32 $(INSTALL_DIR)
\r
222 - $(DEL) ../same-dir.tst
\r
223 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
224 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
\r
225 - mkdir "$(INSTALL_DIR)/etc"
\r
226 - mkdir "$(INSTALL_DIR)/info"
\r
227 - mkdir "$(INSTALL_DIR)/lock"
\r
228 - mkdir "$(INSTALL_DIR)/data"
\r
229 - mkdir "$(INSTALL_DIR)/site-lisp"
\r
230 - mkdir "$(INSTALL_DIR)/etc/icons"
\r
231 $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF)
\r
232 $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)
\r
233 - $(CP_DIR) icons $(INSTALL_DIR)/etc
\r
234 $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)
\r
235 $(IFNOTSAMEDIR) $(CP) ../COPYING $(INSTALL_DIR) $(ENDIF)
\r
236 - $(CP) ../COPYING $(INSTALL_DIR)/bin
\r
237 - $(DEL) ../same-dir.tst
\r
238 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
240 install-other-dirs-nmake:
\r
242 $(MAKE) $(MFLAGS) install
\r
244 $(MAKE) $(MFLAGS) install
\r
246 $(MAKE) $(MFLAGS) install
\r
248 $(MAKE) $(MFLAGS) install
\r
251 install-other-dirs-gmake:
\r
252 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src install
\r
253 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src install
\r
254 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp install
\r
255 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install
\r
258 "$(INSTALL_DIR)/bin/addpm" -q
\r
261 mkdir $(TMP_DIST_DIR)
\r
262 $(CP) "$(INSTALL_DIR)/BUGS" $(TMP_DIST_DIR)
\r
263 $(CP) "$(INSTALL_DIR)/COPYING" $(TMP_DIST_DIR)
\r
264 $(CP) "$(INSTALL_DIR)/README" $(TMP_DIST_DIR)
\r
265 $(CP) "$(INSTALL_DIR)/README.W32" $(TMP_DIST_DIR)
\r
266 $(CP) "$(INSTALL_DIR)/INSTALL" $(TMP_DIST_DIR)
\r
267 $(CP_DIR) "$(INSTALL_DIR)/bin" $(TMP_DIST_DIR)
\r
268 $(CP_DIR) "$(INSTALL_DIR)/etc" $(TMP_DIST_DIR)
\r
269 $(CP_DIR) "$(INSTALL_DIR)/info" $(TMP_DIST_DIR)
\r
270 $(CP_DIR) "$(INSTALL_DIR)/lisp" $(TMP_DIST_DIR)
\r
271 $(CP_DIR) "$(INSTALL_DIR)/leim" $(TMP_DIST_DIR)
\r
272 $(CP_DIR) "$(INSTALL_DIR)/site-lisp" $(TMP_DIST_DIR)
\r
273 $(CP_DIR) $(DIST_FILES) $(TMP_DIST_DIR)/bin
\r
274 $(COMSPEC)$(ComSpec) /c $(ARGQUOTE)zipdist.bat $(VERSION)$(ARGQUOTE)
\r
275 $(DEL_TREE) $(TMP_DIST_DIR)
\r
278 # Note that doc/emacs/makefile knows how to
\r
279 # put the info files in $(infodir),
\r
280 # so we can do ok running make in the build dir.
\r
281 info: force-info info-$(MAKETYPE)
\r
285 $(MAKE) $(MFLAGS) info
\r
287 $(MAKE) $(MFLAGS) info
\r
289 $(MAKE) $(MFLAGS) info
\r
291 $(MAKE) $(MFLAGS) info
\r
295 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs info
\r
296 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc info
\r
297 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref info
\r
298 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro info
\r
302 clean: clean-other-dirs-$(MAKETYPE)
\r
303 - $(DEL) $(COMPILER_TEMP_FILES)
\r
304 - $(DEL_TREE) $(OBJDIR)
\r
306 - $(DEL) ../etc/DOC ../etc/DOC-X
\r
308 clean-other-dirs-nmake:
\r
310 $(MAKE) $(MFLAGS) clean
\r
312 $(MAKE) $(MFLAGS) clean
\r
314 $(MAKE) $(MFLAGS) clean
\r
315 cd ..\doc\lispintro
\r
316 $(MAKE) $(MFLAGS) clean
\r
318 $(MAKE) $(MFLAGS) clean
\r
320 $(MAKE) $(MFLAGS) clean
\r
322 $(MAKE) $(MFLAGS) clean
\r
324 $(MAKE) $(MFLAGS) clean
\r
327 clean-other-dirs-gmake:
\r
328 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib clean
\r
329 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
\r
330 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
\r
331 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim clean
\r
332 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs clean
\r
333 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc clean
\r
334 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro clean
\r
335 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref clean
\r
337 cleanall-other-dirs-nmake:
\r
339 $(MAKE) $(MFLAGS) cleanall
\r
341 $(MAKE) $(MFLAGS) cleanall
\r
343 $(MAKE) $(MFLAGS) cleanall
\r
346 cleanall-other-dirs-gmake:
\r
347 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib cleanall
\r
348 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src cleanall
\r
349 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src cleanall
\r
351 # We used to delete *~ here, but that might inadvertently remove
\r
352 # precious files if it happens to match their short 8+3 aliases.
\r
353 cleanall: clean cleanall-other-dirs-$(MAKETYPE)
\r
355 - $(DEL_TREE) obj-spd
\r
357 - $(DEL_TREE) oo-spd
\r
360 - $(DEL) $(COMPILER_TEMP_FILES)
\r
362 - $(DEL_TREE) obj-spd
\r
364 - $(DEL_TREE) oo-spd
\r
366 - $(DEL) ../etc/DOC ../etc/DOC-X
\r
367 - $(DEL) config.log Makefile
\r
368 - $(DEL) ../README.W32
\r
370 distclean: distclean-other-dirs-$(MAKETYPE) top-distclean
\r
372 distclean-other-dirs-nmake:
\r
374 $(MAKE) $(MFLAGS) distclean
\r
376 $(MAKE) $(MFLAGS) distclean
\r
378 $(MAKE) $(MFLAGS) distclean
\r
380 $(MAKE) $(MFLAGS) distclean
\r
382 $(MAKE) $(MFLAGS) distclean
\r
384 $(MAKE) $(MFLAGS) distclean
\r
386 $(MAKE) $(MFLAGS) distclean
\r
387 cd ..\doc\lispintro
\r
388 $(MAKE) $(MFLAGS) distclean
\r
390 $(MAKE) $(MFLAGS) distclean
\r
393 distclean-other-dirs-gmake:
\r
394 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib distclean
\r
395 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src distclean
\r
396 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src distclean
\r
397 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp distclean
\r
398 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim distclean
\r
399 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs distclean
\r
400 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc distclean
\r
401 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro distclean
\r
402 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref distclean
\r
404 maintainer-clean: maintainer-clean-other-dirs-$(MAKETYPE) top-distclean
\r
406 maintainer-clean-other-dirs-nmake:
\r
408 $(MAKE) $(MFLAGS) maintainer-clean
\r
410 $(MAKE) $(MFLAGS) maintainer-clean
\r
412 $(MAKE) $(MFLAGS) maintainer-clean
\r
414 $(MAKE) $(MFLAGS) maintainer-clean
\r
416 $(MAKE) $(MFLAGS) maintainer-clean
\r
418 $(MAKE) $(MFLAGS) maintainer-clean
\r
420 $(MAKE) $(MFLAGS) maintainer-clean
\r
421 cd ..\doc\lispintro
\r
422 $(MAKE) $(MFLAGS) maintainer-clean
\r
424 $(MAKE) $(MFLAGS) maintainer-clean
\r
427 maintainer-clean-other-dirs-gmake:
\r
428 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib maintainer-clean
\r
429 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src maintainer-clean
\r
430 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src maintainer-clean
\r
431 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp maintainer-clean
\r
432 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim maintainer-clean
\r
433 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs maintainer-clean
\r
434 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc maintainer-clean
\r
435 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro maintainer-clean
\r
436 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref maintainer-clean
\r
438 realclean: cleanall
\r
439 - $(DEL_TREE) ../bin
\r
441 TAGS: TAGS-$(MAKETYPE)
\r
445 ../lib-src/$(BLD)/etags $(CURDIR)/*.c
\r
446 $(MAKE) $(MFLAGS) -C ../src TAGS TAGS-LISP
\r
447 $(MAKE) $(MFLAGS) -C ../lib-src TAGS
\r
448 $(MAKE) $(MFLAGS) -C ../lib TAGS
\r
451 echo This target is not supported with NMake
\r