1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 # 2005, 2006 Free Software Foundation, Inc.
5 # Top level makefile for building GNU Emacs on Windows NT
7 # This file is part of GNU Emacs.
9 # GNU Emacs is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # GNU Emacs is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Emacs; see the file COPYING. If not, write to
21 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 # Boston, MA 02110-1301, USA.
24 ALL = addpm ddeclient runemacs cmdproxy addsection preprep
28 TRES = $(BLD)/emacs.res
30 addpm: $(BLD) $(BLD)/addpm.exe
31 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)
32 $(LINK) $(LINK_OUT)$@ \
33 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
35 ddeclient: $(BLD) $(BLD)/ddeclient.exe
36 $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)
37 $(LINK) $(LINK_OUT)$@ \
38 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
40 cmdproxy: $(BLD) $(BLD)/cmdproxy.exe
41 $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)
42 $(LINK) $(LINK_OUT)$@ \
43 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
45 addsection: $(BLD) $(BLD)/addsection.exe
46 $(BLD)/addsection.exe: $(BLD)/addsection.$(O)
47 $(LINK) $(LINK_OUT)$@ \
48 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
50 preprep: $(BLD) $(BLD)/preprep.exe
51 $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
52 $(LINK) $(LINK_OUT)$@ \
53 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)
56 # The resource file. NT 3.10 requires the use of cvtres; even though
57 # it is not necessary on later versions, it is still ok to use it.
60 $(RC) $(RC_OUT)$(BLD)/emacs.res $(ALL_DEPS)
62 runemacs: $(BLD) $(BLD)/runemacs.exe
63 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
64 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \
65 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
68 @echo Using $(THE_SHELL) as shell.
73 all: which-sh $(BLD) $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)
87 $(MAKE) $(MFLAGS) -C ../lib-src all
88 $(MAKE) $(MFLAGS) -C ../src all
89 $(MAKE) $(MFLAGS) -C ../lisp all
90 $(MAKE) $(MFLAGS) -C ../leim all
92 recompile: recompile-$(MAKETYPE)
96 $(MAKE) $(MFLAGS) recompile
100 $(MAKE) $(MFLAGS) -C ../lisp recompile
104 ### This is meant for Emacs maintainers only. It first cleans the
105 ### lisp subdirectory, removing all compiled Lisp files. Then a
106 ### special emacs executable is built from Lisp sources, which is then
107 ### used to compile Lisp files. The last step is a "normal" make.
109 maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)
111 # dummy target to force other targets to be evaluated.
114 maybe-bootstrap-CMD: doit
116 @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either
117 @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow
119 @if not EXIST ..\lisp\abbrev.elc exit -1
121 maybe-bootstrap-SH: doit
122 @if [ ! -f ../lisp/abbrev.elc ] ; then \
124 echo "Essential Lisp files seem to be missing. You should either"; \
125 echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \
130 bootstrap: addsection bootstrap-$(MAKETYPE) all
134 $(MAKE) $(MFLAGS) bootstrap-clean
136 $(MAKE) $(MFLAGS) clean
138 $(MAKE) $(MFLAGS) clean
140 $(MAKE) $(MFLAGS) bootstrap
141 $(MAKE) $(MFLAGS) bootstrap-clean
143 $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
145 $(MAKE) $(MFLAGS) DOC
149 $(MAKE) $(MFLAGS) -C ../lisp bootstrap-clean
150 $(MAKE) $(MFLAGS) -C ../src clean
151 $(MAKE) $(MFLAGS) -C ../lib-src clean
152 $(MAKE) $(MFLAGS) -C ../src bootstrap
153 $(MAKE) $(MFLAGS) -C ../src bootstrap-clean
154 $(MAKE) $(MFLAGS) -C ../lisp bootstrap
155 $(MAKE) $(MFLAGS) -C ../lib-src DOC
157 bootstrap-clean: bootstrap-clean-$(MAKETYPE)
159 bootstrap-clean-nmake:
161 $(MAKE) $(MFLAGS) bootstrap-clean
163 $(MAKE) $(MFLAGS) bootstrap-clean
165 bootstrap-clean-gmake:
166 $(MAKE) $(MFLAGS) -C ../src bootstrap-clean
167 $(MAKE) $(MFLAGS) -C ../lisp bootstrap-clean
170 - mkdir "$(INSTALL_DIR)"
172 $(INSTALL_DIR)/bin: $(INSTALL_DIR)
173 - mkdir "$(INSTALL_DIR)/bin"
176 # Build and install emacs in INSTALL_DIR
178 install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
179 - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin
180 - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
181 - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
182 - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
183 - "$(INSTALL_DIR)/bin/addpm" -q
184 - $(DEL) ../same-dir.tst
185 - $(DEL) $(INSTALL_DIR)/same-dir.tst
186 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
187 - mkdir "$(INSTALL_DIR)/etc"
188 - mkdir "$(INSTALL_DIR)/info"
189 - mkdir "$(INSTALL_DIR)/lock"
190 - mkdir "$(INSTALL_DIR)/data"
191 - mkdir "$(INSTALL_DIR)/site-lisp"
192 - mkdir "$(INSTALL_DIR)/etc/icons"
193 $(IFNOTSAMEDIR) $(CP) ../site-lisp/subdirs.el $(INSTALL_DIR)/site-lisp $(ENDIF)
194 $(IFNOTSAMEDIR) $(CP_DIR) ../etc $(INSTALL_DIR) $(ENDIF)
195 - $(CP_DIR) icons $(INSTALL_DIR)/etc
196 $(IFNOTSAMEDIR) $(CP_DIR) ../info $(INSTALL_DIR) $(ENDIF)
197 - $(DEL) ../same-dir.tst
198 - $(DEL) $(INSTALL_DIR)/same-dir.tst
200 install-other-dirs-nmake:
202 $(MAKE) $(MFLAGS) install
204 $(MAKE) $(MFLAGS) install
206 $(MAKE) $(MFLAGS) install
208 $(MAKE) $(MFLAGS) install
211 install-other-dirs-gmake:
212 $(MAKE) $(MFLAGS) -C ../lib-src install
213 $(MAKE) $(MFLAGS) -C ../src install
214 $(MAKE) $(MFLAGS) -C ../lisp install
215 $(MAKE) $(MFLAGS) -C ../leim install
218 # Note that man/makefile knows how to
219 # put the info files in $(infodir),
220 # so we can do ok running make in the build dir.
221 info: force-info info-$(MAKETYPE)
225 $(MAKE) $(MFLAGS) info
227 $(MAKE) $(MFLAGS) info
229 $(MAKE) $(MFLAGS) info
232 $(MAKE) $(MFLAGS) -C ../man info
233 $(MAKE) $(MFLAGS) -C ../lispref info
234 $(MAKE) $(MFLAGS) -C ../lispintro info
238 clean: clean-other-dirs-$(MAKETYPE)
239 - $(DEL) *~ $(COMPILER_TEMP_FILES)
240 - $(DEL_TREE) $(OBJDIR)
241 - $(DEL) ../etc/DOC ../etc/DOC-X
243 clean-other-dirs-nmake:
245 $(MAKE) $(MFLAGS) clean
247 $(MAKE) $(MFLAGS) clean
249 $(MAKE) $(MFLAGS) clean
251 $(MAKE) $(MFLAGS) clean
253 $(MAKE) $(MFLAGS) clean
255 $(MAKE) $(MFLAGS) clean
257 $(MAKE) $(MFLAGS) clean
260 clean-other-dirs-gmake:
261 $(MAKE) $(MFLAGS) -C ../lib-src clean
262 $(MAKE) $(MFLAGS) -C ../src clean
263 $(MAKE) $(MFLAGS) -C ../lisp clean
264 $(MAKE) $(MFLAGS) -C ../leim clean
266 cleanall-other-dirs-nmake:
268 $(MAKE) $(MFLAGS) cleanall
270 $(MAKE) $(MFLAGS) cleanall
273 cleanall-other-dirs-gmake:
274 $(MAKE) $(MFLAGS) -C ../lib-src cleanall
275 $(MAKE) $(MFLAGS) -C ../src cleanall
277 cleanall: clean cleanall-other-dirs-$(MAKETYPE)
279 - $(DEL_TREE) obj-spd