1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
\r
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004,
\r
3 # 2005, 2006, 2007, 2008 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, or (at your option)
\r
12 # 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; see the file COPYING. If not, write to
\r
21 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
\r
22 # Boston, MA 02110-1301, USA.
\r
24 # FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out
\r
25 # (and remove or replace this comment).
\r
27 TRES = $(BLD)/emacs.res
\r
28 CLIENTRES = $(BLD)/emacsclient.res
\r
32 ALL = addpm ddeclient runemacs cmdproxy addsection preprep
\r
37 addpm: stamp_BLD $(BLD)/addpm.exe
\r
38 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)
\r
39 $(LINK) $(LINK_OUT)$@ \
\r
40 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
42 ddeclient: stamp_BLD $(BLD)/ddeclient.exe
\r
43 $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)
\r
44 $(LINK) $(LINK_OUT)$@ \
\r
45 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
47 cmdproxy: stamp_BLD $(BLD)/cmdproxy.exe
\r
48 $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)
\r
49 $(LINK) $(LINK_OUT)$@ \
\r
50 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
52 addsection: stamp_BLD $(BLD)/addsection.exe
\r
53 $(BLD)/addsection.exe: $(BLD)/addsection.$(O)
\r
54 $(LINK) $(LINK_OUT)$@ \
\r
55 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
57 preprep: stamp_BLD $(BLD)/preprep.exe
\r
58 $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
\r
59 $(LINK) $(LINK_OUT)$@ \
\r
60 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)
\r
63 # The resource file. NT 3.10 requires the use of cvtres; even though
\r
64 # it is not necessary on later versions, it is still ok to use it.
\r
66 $(TRES): emacs.rc icons/emacs.ico emacs.manifest stamp_BLD
\r
67 $(RC) $(RC_OUT)$(TRES) emacs.rc
\r
69 $(CLIENTRES): emacsclient.rc stamp_BLD
\r
70 $(RC) $(RC_OUT)$(CLIENTRES) emacsclient.rc
\r
72 runemacs: stamp_BLD $(BLD)/runemacs.exe
\r
73 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
\r
74 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \
\r
75 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
78 @echo Using $(THE_SHELL) as shell.
\r
80 # These depend on stamp_BLD to make sure the $(BLD) directory is created
\r
81 # before the compilation begins, even if Make runs several commands
\r
82 # in parallel under "make -j".
\r
84 $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O) $(BLD)/addsection.$(O) $(BLD)/preprep.$(O): stamp_BLD
\r
89 all: which-sh stamp_BLD $(ALL) $(CLIENTRES) maybe-bootstrap all-other-dirs-$(MAKETYPE)
\r
91 all-other-dirs-nmake: addsection
\r
93 $(MAKE) $(MFLAGS) all
\r
95 $(MAKE) $(MFLAGS) all
\r
97 $(MAKE) $(MFLAGS) all
\r
99 $(MAKE) $(MFLAGS) all
\r
102 all-other-dirs-gmake: addsection
\r
103 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src all
\r
104 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src all
\r
105 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp all
\r
106 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim all
\r
108 recompile: recompile-$(MAKETYPE)
\r
112 $(MAKE) $(MFLAGS) recompile
\r
116 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp recompile
\r
118 #### Bootstrapping.
\r
120 ### This is meant for Emacs maintainers only. It first cleans the
\r
121 ### lisp subdirectory, removing all compiled Lisp files. Then a
\r
122 ### special emacs executable is built from Lisp sources, which is then
\r
123 ### used to compile Lisp files. The last step is a "normal" make.
\r
125 maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)
\r
127 # dummy target to force other targets to be evaluated.
\r
130 maybe-bootstrap-CMD: doit
\r
132 @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either
\r
133 @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow
\r
135 @if not EXIST ..\lisp\abbrev.elc exit -1
\r
137 maybe-bootstrap-SH: doit
\r
138 @if [ ! -f ../lisp/abbrev.elc ] ; then \
\r
140 echo "Essential Lisp files seem to be missing. You should either"; \
\r
141 echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \
\r
146 # Bootstrap depends on cmdproxy because some Lisp functions
\r
147 # loaded during bootstrap may need to run shell commands.
\r
148 bootstrap: addsection cmdproxy bootstrap-$(MAKETYPE)
\r
149 $(MAKE) $(MFLAGS) $(XMFLAGS) all
\r
151 bootstrap-nmake: addsection cmdproxy
\r
153 $(MAKE) $(MFLAGS) bootstrap-clean
\r
155 $(MAKE) $(MFLAGS) clean
\r
157 $(MAKE) $(MFLAGS) clean
\r
159 $(MAKE) $(MFLAGS) bootstrap
\r
160 $(MAKE) $(MFLAGS) bootstrap-clean
\r
162 $(CP) $(BLD)/cmdproxy.exe ../bin
\r
164 $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
\r
166 $(MAKE) $(MFLAGS) DOC
\r
169 bootstrap-gmake: addsection cmdproxy
\r
170 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
\r
171 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
\r
172 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
\r
173 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap
\r
174 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
\r
175 $(CP) $(BLD)/cmdproxy.exe ../bin
\r
176 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap
\r
177 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src DOC
\r
179 bootstrap-clean: bootstrap-clean-$(MAKETYPE)
\r
181 bootstrap-clean-nmake:
\r
183 $(MAKE) $(MFLAGS) bootstrap-clean
\r
185 $(MAKE) $(MFLAGS) bootstrap-clean
\r
187 bootstrap-clean-gmake:
\r
188 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
\r
189 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
\r
192 - mkdir "$(INSTALL_DIR)"
\r
194 $(INSTALL_DIR)/bin: $(INSTALL_DIR)
\r
195 - mkdir "$(INSTALL_DIR)/bin"
\r
198 # Build and install emacs in INSTALL_DIR
\r
200 install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
\r
201 - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin
\r
202 - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
\r
203 - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
\r
204 - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
\r
205 - "$(INSTALL_DIR)/bin/addpm" -q
\r
206 - $(DEL) ../same-dir.tst
\r
207 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
208 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
\r
209 - mkdir "$(INSTALL_DIR)/etc"
\r
210 - mkdir "$(INSTALL_DIR)/info"
\r
211 - mkdir "$(INSTALL_DIR)/lock"
\r
212 - mkdir "$(INSTALL_DIR)/data"
\r
213 - mkdir "$(INSTALL_DIR)/site-lisp"
\r
214 - mkdir "$(INSTALL_DIR)/etc/icons"
\r
215 $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF)
\r
216 $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)
\r
217 - $(CP_DIR) icons $(INSTALL_DIR)/etc
\r
218 $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)
\r
219 $(IFNOTSAMEDIR) $(CP) ../COPYING $(INSTALL_DIR) $(ENDIF)
\r
220 - $(CP) ../COPYING $(INSTALL_DIR)/bin
\r
221 - $(DEL) ../same-dir.tst
\r
222 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
224 install-other-dirs-nmake:
\r
226 $(MAKE) $(MFLAGS) install
\r
228 $(MAKE) $(MFLAGS) install
\r
230 $(MAKE) $(MFLAGS) install
\r
232 $(MAKE) $(MFLAGS) install
\r
235 install-other-dirs-gmake:
\r
236 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src install
\r
237 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src install
\r
238 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp install
\r
239 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install
\r
242 # Note that doc/emacs/makefile knows how to
\r
243 # put the info files in $(infodir),
\r
244 # so we can do ok running make in the build dir.
\r
245 info: force-info info-$(MAKETYPE)
\r
249 $(MAKE) $(MFLAGS) info
\r
251 $(MAKE) $(MFLAGS) info
\r
253 $(MAKE) $(MFLAGS) info
\r
255 $(MAKE) $(MFLAGS) info
\r
259 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs info
\r
260 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc info
\r
261 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref info
\r
262 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro info
\r
266 clean: clean-other-dirs-$(MAKETYPE)
\r
267 - $(DEL) $(COMPILER_TEMP_FILES)
\r
268 - $(DEL_TREE) $(OBJDIR)
\r
270 - $(DEL) ../etc/DOC ../etc/DOC-X
\r
272 clean-other-dirs-nmake:
\r
274 $(MAKE) $(MFLAGS) clean
\r
276 $(MAKE) $(MFLAGS) clean
\r
277 cd ..\doc\lispintro
\r
278 $(MAKE) $(MFLAGS) clean
\r
280 $(MAKE) $(MFLAGS) clean
\r
282 $(MAKE) $(MFLAGS) clean
\r
284 $(MAKE) $(MFLAGS) clean
\r
286 $(MAKE) $(MFLAGS) clean
\r
289 clean-other-dirs-gmake:
\r
290 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
\r
291 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
\r
292 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim clean
\r
293 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs clean
\r
294 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc clean
\r
295 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro clean
\r
296 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref clean
\r
298 cleanall-other-dirs-nmake:
\r
300 $(MAKE) $(MFLAGS) cleanall
\r
302 $(MAKE) $(MFLAGS) cleanall
\r
305 cleanall-other-dirs-gmake:
\r
306 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src cleanall
\r
307 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src cleanall
\r
309 # We used to delete *~ here, but that might inadvertently remove
\r
310 # precious files if it happens to match their short 8+3 aliases.
\r
311 cleanall: clean cleanall-other-dirs-$(MAKETYPE)
\r
313 - $(DEL_TREE) obj-spd
\r
315 - $(DEL_TREE) oo-spd
\r
318 - $(DEL) $(COMPILER_TEMP_FILES)
\r
320 - $(DEL_TREE) obj-spd
\r
322 - $(DEL_TREE) oo-spd
\r
324 - $(DEL) ../etc/DOC ../etc/DOC-X
\r
325 - $(DEL) config.log Makefile
\r
327 distclean: distclean-other-dirs-$(MAKETYPE) top-distclean
\r
329 distclean-other-dirs-nmake:
\r
331 $(MAKE) $(MFLAGS) distclean
\r
333 $(MAKE) $(MFLAGS) distclean
\r
335 $(MAKE) $(MFLAGS) distclean
\r
337 $(MAKE) $(MFLAGS) distclean
\r
339 $(MAKE) $(MFLAGS) distclean
\r
341 $(MAKE) $(MFLAGS) distclean
\r
342 cd ..\doc\lispintro
\r
343 $(MAKE) $(MFLAGS) distclean
\r
345 $(MAKE) $(MFLAGS) distclean
\r
348 distclean-other-dirs-gmake:
\r
349 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src distclean
\r
350 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src distclean
\r
351 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp distclean
\r
352 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim distclean
\r
353 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs distclean
\r
354 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc distclean
\r
355 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro distclean
\r
356 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref distclean
\r
358 maintainer-clean: maintainer-clean-other-dirs-$(MAKETYPE) top-distclean
\r
360 maintainer-clean-other-dirs-nmake:
\r
362 $(MAKE) $(MFLAGS) maintainer-clean
\r
364 $(MAKE) $(MFLAGS) maintainer-clean
\r
366 $(MAKE) $(MFLAGS) maintainer-clean
\r
368 $(MAKE) $(MFLAGS) maintainer-clean
\r
370 $(MAKE) $(MFLAGS) maintainer-clean
\r
372 $(MAKE) $(MFLAGS) maintainer-clean
\r
373 cd ..\doc\lispintro
\r
374 $(MAKE) $(MFLAGS) maintainer-clean
\r
376 $(MAKE) $(MFLAGS) maintainer-clean
\r
379 maintainer-clean-other-dirs-gmake:
\r
380 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src maintainer-clean
\r
381 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src maintainer-clean
\r
382 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp maintainer-clean
\r
383 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim maintainer-clean
\r
384 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs maintainer-clean
\r
385 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc maintainer-clean
\r
386 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro maintainer-clean
\r
387 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref maintainer-clean
\r
389 realclean: cleanall
\r
390 - $(DEL_TREE) ../bin
\r