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, 2009 Free Software Foundation, Inc.
\r
5 # Top level makefile for building GNU Emacs on Windows NT
\r
7 # This file is part of GNU Emacs.
\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
31 ALL = addpm ddeclient runemacs cmdproxy addsection preprep
\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
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
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
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
83 $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O) $(BLD)/addsection.$(O) $(BLD)/preprep.$(O): stamp_BLD
\r
88 all: which-sh stamp_BLD $(ALL) $(CLIENTRES) maybe-bootstrap all-other-dirs-$(MAKETYPE)
\r
90 all-other-dirs-nmake: addsection
\r
92 $(MAKE) $(MFLAGS) all
\r
94 $(MAKE) $(MFLAGS) all
\r
96 $(MAKE) $(MFLAGS) all
\r
98 $(MAKE) $(MFLAGS) all
\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
111 $(MAKE) $(MFLAGS) recompile
\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
129 maybe-bootstrap-CMD: doit
\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
134 @if not EXIST ..\lisp\abbrev.elc exit -1
\r
136 maybe-bootstrap-SH: doit
\r
137 @if [ ! -f ../lisp/abbrev.elc ] ; then \
\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
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
152 $(MAKE) $(MFLAGS) bootstrap-clean
\r
154 $(MAKE) $(MFLAGS) clean
\r
156 $(MAKE) $(MFLAGS) clean
\r
158 $(MAKE) $(MFLAGS) bootstrap
\r
159 $(MAKE) $(MFLAGS) bootstrap-clean
\r
161 $(CP) $(BLD)/cmdproxy.exe ../bin
\r
163 $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
\r
165 $(MAKE) $(MFLAGS) DOC
\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
182 $(MAKE) $(MFLAGS) bootstrap-clean
\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
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
225 $(MAKE) $(MFLAGS) install
\r
227 $(MAKE) $(MFLAGS) install
\r
229 $(MAKE) $(MFLAGS) install
\r
231 $(MAKE) $(MFLAGS) install
\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
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
248 $(MAKE) $(MFLAGS) info
\r
250 $(MAKE) $(MFLAGS) info
\r
252 $(MAKE) $(MFLAGS) info
\r
254 $(MAKE) $(MFLAGS) info
\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
265 clean: clean-other-dirs-$(MAKETYPE)
\r
266 - $(DEL) $(COMPILER_TEMP_FILES)
\r
267 - $(DEL_TREE) $(OBJDIR)
\r
269 - $(DEL) ../etc/DOC ../etc/DOC-X
\r
271 clean-other-dirs-nmake:
\r
273 $(MAKE) $(MFLAGS) clean
\r
275 $(MAKE) $(MFLAGS) clean
\r
276 cd ..\doc\lispintro
\r
277 $(MAKE) $(MFLAGS) clean
\r
279 $(MAKE) $(MFLAGS) clean
\r
281 $(MAKE) $(MFLAGS) clean
\r
283 $(MAKE) $(MFLAGS) clean
\r
285 $(MAKE) $(MFLAGS) clean
\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
299 $(MAKE) $(MFLAGS) cleanall
\r
301 $(MAKE) $(MFLAGS) cleanall
\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
312 - $(DEL_TREE) obj-spd
\r
314 - $(DEL_TREE) oo-spd
\r
317 - $(DEL) $(COMPILER_TEMP_FILES)
\r
319 - $(DEL_TREE) obj-spd
\r
321 - $(DEL_TREE) oo-spd
\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
330 $(MAKE) $(MFLAGS) distclean
\r
332 $(MAKE) $(MFLAGS) distclean
\r
334 $(MAKE) $(MFLAGS) distclean
\r
336 $(MAKE) $(MFLAGS) distclean
\r
338 $(MAKE) $(MFLAGS) distclean
\r
340 $(MAKE) $(MFLAGS) distclean
\r
341 cd ..\doc\lispintro
\r
342 $(MAKE) $(MFLAGS) distclean
\r
344 $(MAKE) $(MFLAGS) distclean
\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
361 $(MAKE) $(MFLAGS) maintainer-clean
\r
363 $(MAKE) $(MFLAGS) maintainer-clean
\r
365 $(MAKE) $(MFLAGS) maintainer-clean
\r
367 $(MAKE) $(MFLAGS) maintainer-clean
\r
369 $(MAKE) $(MFLAGS) maintainer-clean
\r
371 $(MAKE) $(MFLAGS) maintainer-clean
\r
372 cd ..\doc\lispintro
\r
373 $(MAKE) $(MFLAGS) maintainer-clean
\r
375 $(MAKE) $(MFLAGS) maintainer-clean
\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