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 ALL = addpm ddeclient runemacs cmdproxy addsection preprep
\r
31 TRES = $(BLD)/emacs.res
\r
35 addpm: stamp_BLD $(BLD)/addpm.exe
\r
36 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)
\r
37 $(LINK) $(LINK_OUT)$@ \
\r
38 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
40 ddeclient: stamp_BLD $(BLD)/ddeclient.exe
\r
41 $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)
\r
42 $(LINK) $(LINK_OUT)$@ \
\r
43 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
45 cmdproxy: stamp_BLD $(BLD)/cmdproxy.exe
\r
46 $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)
\r
47 $(LINK) $(LINK_OUT)$@ \
\r
48 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
50 addsection: stamp_BLD $(BLD)/addsection.exe
\r
51 $(BLD)/addsection.exe: $(BLD)/addsection.$(O)
\r
52 $(LINK) $(LINK_OUT)$@ \
\r
53 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
\r
55 preprep: stamp_BLD $(BLD)/preprep.exe
\r
56 $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
\r
57 $(LINK) $(LINK_OUT)$@ \
\r
58 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)
\r
61 # The resource file. NT 3.10 requires the use of cvtres; even though
\r
62 # it is not necessary on later versions, it is still ok to use it.
\r
64 $(TRES): emacs.rc stamp_BLD
\r
65 $(RC) $(RC_OUT)$(BLD)/emacs.res emacs.rc
\r
67 runemacs: stamp_BLD $(BLD)/runemacs.exe
\r
68 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
\r
69 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \
\r
70 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
\r
73 @echo Using $(THE_SHELL) as shell.
\r
75 # These depend on stamp_BLD to make sure the $(BLD) directory is created
\r
76 # before the compilation begins, even if Make runs several commands
\r
77 # in parallel under "make -j".
\r
79 $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O) $(BLD)/addsection.$(O) $(BLD)/preprep.$(O): stamp_BLD
\r
84 all: which-sh stamp_BLD $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)
\r
86 all-other-dirs-nmake: addsection
\r
88 $(MAKE) $(MFLAGS) all
\r
90 $(MAKE) $(MFLAGS) all
\r
92 $(MAKE) $(MFLAGS) all
\r
94 $(MAKE) $(MFLAGS) all
\r
97 all-other-dirs-gmake: addsection
\r
98 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src all
\r
99 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src all
\r
100 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp all
\r
101 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim all
\r
103 recompile: recompile-$(MAKETYPE)
\r
107 $(MAKE) $(MFLAGS) recompile
\r
111 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp recompile
\r
113 #### Bootstrapping.
\r
115 ### This is meant for Emacs maintainers only. It first cleans the
\r
116 ### lisp subdirectory, removing all compiled Lisp files. Then a
\r
117 ### special emacs executable is built from Lisp sources, which is then
\r
118 ### used to compile Lisp files. The last step is a "normal" make.
\r
120 maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)
\r
122 # dummy target to force other targets to be evaluated.
\r
125 maybe-bootstrap-CMD: doit
\r
127 @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either
\r
128 @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow
\r
130 @if not EXIST ..\lisp\abbrev.elc exit -1
\r
132 maybe-bootstrap-SH: doit
\r
133 @if [ ! -f ../lisp/abbrev.elc ] ; then \
\r
135 echo "Essential Lisp files seem to be missing. You should either"; \
\r
136 echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \
\r
141 # Bootstrap depends on cmdproxy because some Lisp functions
\r
142 # loaded during bootstrap may need to run shell commands.
\r
143 bootstrap: addsection cmdproxy bootstrap-$(MAKETYPE)
\r
144 $(MAKE) $(MFLAGS) $(XMFLAGS) all
\r
147 cd ..\admin\unidata
\r
151 unidatagen-clean-nmake:
\r
152 cd ..\admin\unidata
\r
153 $(MAKE) $(MFLAGS) clean
\r
157 if exist ..\admin\unidata\UnicodeData.txt \
\r
158 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../admin/unidata
\r
160 unidatagen-clean-CMD:
\r
161 if exist ..\admin\unidata\UnicodeData.txt \
\r
162 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../admin/unidata clean
\r
165 - test -f ../admin/unidata/UnicodeData.txt && \
\r
166 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../admin/unidata
\r
168 unidatagen-clean-SH:
\r
169 - test -f ../admin/unidata/UnicodeData.txt && \
\r
170 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../admin/unidata clean
\r
172 bootstrap-nmake: addsection cmdproxy
\r
174 $(MAKE) $(MFLAGS) bootstrap-clean
\r
176 $(MAKE) $(MFLAGS) clean
\r
177 if exist ..\admin $(MAKE) unidatagen-clean-nmake
\r
179 $(MAKE) $(MFLAGS) clean
\r
181 $(MAKE) $(MFLAGS) bootstrap
\r
182 if exist ..\admin $(MAKE) unidatagen-nmake
\r
183 $(MAKE) $(MFLAGS) bootstrap-clean
\r
185 $(CP) $(BLD)/cmdproxy.exe ../bin
\r
187 $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
\r
189 $(MAKE) $(MFLAGS) DOC
\r
192 bootstrap-gmake: addsection cmdproxy
\r
193 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
\r
194 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
\r
195 $(MAKE) $(MFLAGS) $(XMFLAGS) unidatagen-clean-$(SHELLTYPE)
\r
196 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
\r
197 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap
\r
198 $(MAKE) $(MFLAGS) $(XMFLAGS) unidatagen-$(SHELLTYPE)
\r
199 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
\r
200 $(CP) $(BLD)/cmdproxy.exe ../bin
\r
201 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap
\r
202 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src DOC
\r
204 bootstrap-clean: bootstrap-clean-$(MAKETYPE)
\r
206 bootstrap-clean-nmake:
\r
208 $(MAKE) $(MFLAGS) bootstrap-clean
\r
210 $(MAKE) $(MFLAGS) bootstrap-clean
\r
212 bootstrap-clean-gmake:
\r
213 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src bootstrap-clean
\r
214 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp bootstrap-clean
\r
217 - mkdir "$(INSTALL_DIR)"
\r
219 $(INSTALL_DIR)/bin: $(INSTALL_DIR)
\r
220 - mkdir "$(INSTALL_DIR)/bin"
\r
223 # Build and install emacs in INSTALL_DIR
\r
225 install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
\r
226 - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin
\r
227 - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
\r
228 - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
\r
229 - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
\r
230 - "$(INSTALL_DIR)/bin/addpm" -q
\r
231 - $(DEL) ../same-dir.tst
\r
232 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
233 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
\r
234 - mkdir "$(INSTALL_DIR)/etc"
\r
235 - mkdir "$(INSTALL_DIR)/info"
\r
236 - mkdir "$(INSTALL_DIR)/lock"
\r
237 - mkdir "$(INSTALL_DIR)/data"
\r
238 - mkdir "$(INSTALL_DIR)/site-lisp"
\r
239 - mkdir "$(INSTALL_DIR)/etc/icons"
\r
240 $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF)
\r
241 $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)
\r
242 - $(CP_DIR) icons $(INSTALL_DIR)/etc
\r
243 $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)
\r
244 $(IFNOTSAMEDIR) $(CP) ../COPYING $(INSTALL_DIR) $(ENDIF)
\r
245 - $(CP) ../COPYING $(INSTALL_DIR)/bin
\r
246 - $(DEL) ../same-dir.tst
\r
247 - $(DEL) $(INSTALL_DIR)/same-dir.tst
\r
249 install-other-dirs-nmake:
\r
251 $(MAKE) $(MFLAGS) install
\r
253 $(MAKE) $(MFLAGS) install
\r
255 $(MAKE) $(MFLAGS) install
\r
257 $(MAKE) $(MFLAGS) install
\r
260 install-other-dirs-gmake:
\r
261 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src install
\r
262 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src install
\r
263 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp install
\r
264 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim install
\r
267 # Note that doc/emacs/makefile knows how to
\r
268 # put the info files in $(infodir),
\r
269 # so we can do ok running make in the build dir.
\r
270 info: force-info info-$(MAKETYPE)
\r
274 $(MAKE) $(MFLAGS) info
\r
276 $(MAKE) $(MFLAGS) info
\r
278 $(MAKE) $(MFLAGS) info
\r
280 $(MAKE) $(MFLAGS) info
\r
284 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/emacs info
\r
285 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/misc info
\r
286 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispref info
\r
287 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../doc/lispintro info
\r
291 clean: clean-other-dirs-$(MAKETYPE)
\r
292 - $(DEL) $(COMPILER_TEMP_FILES)
\r
293 - $(DEL_TREE) $(OBJDIR)
\r
295 - $(DEL) ../etc/DOC ../etc/DOC-X
\r
297 clean-other-dirs-nmake:
\r
299 $(MAKE) $(MFLAGS) clean
\r
301 $(MAKE) $(MFLAGS) clean
\r
303 $(MAKE) $(MFLAGS) clean
\r
304 cd ..\doc\lispintro
\r
305 $(MAKE) $(MFLAGS) clean
\r
307 $(MAKE) $(MFLAGS) clean
\r
309 $(MAKE) $(MFLAGS) clean
\r
311 $(MAKE) $(MFLAGS) clean
\r
313 $(MAKE) $(MFLAGS) clean
\r
316 clean-other-dirs-gmake:
\r
317 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src clean
\r
318 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src clean
\r
319 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lisp clean
\r
320 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../leim clean
\r
322 cleanall-other-dirs-nmake:
\r
324 $(MAKE) $(MFLAGS) cleanall
\r
326 $(MAKE) $(MFLAGS) cleanall
\r
329 cleanall-other-dirs-gmake:
\r
330 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../lib-src cleanall
\r
331 $(MAKE) $(MFLAGS) $(XMFLAGS) -C ../src cleanall
\r
333 # We used to delete *~ here, but that might inadvertently remove
\r
334 # precious files if it happens to match their short 8+3 aliases.
\r
335 cleanall: clean cleanall-other-dirs-$(MAKETYPE)
\r
337 - $(DEL_TREE) obj-spd
\r
339 - $(DEL_TREE) oo-spd
\r
341 realclean: cleanall
\r
342 - $(DEL_TREE) ../bin
\r