1 # Makefile for GNU Emacs on the Microsoft W32 API.
2 # Copyright (c) 2000-2001 Free Software Foundation, Inc.
4 # Top level makefile for building GNU Emacs on Windows NT
6 # This file is part of GNU Emacs.
8 # GNU Emacs is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # GNU Emacs is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Emacs; see the file COPYING. If not, write to
20 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 # Boston, MA 02111-1307, USA.
23 ALL = addpm ddeclient runemacs cmdproxy addsection preprep
27 TRES = $(BLD)/emacs.res
29 addpm: $(BLD) $(BLD)/addpm.exe
30 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)
31 $(LINK) $(LINK_OUT)$@ \
32 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
34 ddeclient: $(BLD) $(BLD)/ddeclient.exe
35 $(BLD)/ddeclient.exe: $(BLD)/ddeclient.$(O)
36 $(LINK) $(LINK_OUT)$@ \
37 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
39 cmdproxy: $(BLD) $(BLD)/cmdproxy.exe
40 $(BLD)/cmdproxy.exe: $(BLD)/cmdproxy.$(O)
41 $(LINK) $(LINK_OUT)$@ \
42 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
44 addsection: $(BLD) $(BLD)/addsection.exe
45 $(BLD)/addsection.exe: $(BLD)/addsection.$(O)
46 $(LINK) $(LINK_OUT)$@ \
47 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(USER32)
49 preprep: $(BLD) $(BLD)/preprep.exe
50 $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
51 $(LINK) $(LINK_OUT)$@ \
52 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS)
55 # The resource file. NT 3.10 requires the use of cvtres; even though
56 # it is not necessary on later versions, it is still ok to use it.
59 $(RC) $(RC_OUT)$(BLD)/emacs.res $(ALL_DEPS)
61 runemacs: $(BLD) $(BLD)/runemacs.exe
62 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
63 $(LINK) $(LINK_OUT)$@ $(SUBSYSTEM_WINDOWS) \
64 $(LINK_FLAGS) $(ALL_DEPS) $(BASE_LIBS) $(ADVAPI32) $(USER32)
67 @echo Using $(THE_SHELL) as shell.
72 all: which-sh $(BLD) $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)
86 $(MAKE) $(MFLAGS) -C ../lib-src all
87 $(MAKE) $(MFLAGS) -C ../src all
88 $(MAKE) $(MFLAGS) -C ../lisp all
89 $(MAKE) $(MFLAGS) -C ../leim all
91 recompile: recompile-$(MAKETYPE)
95 $(MAKE) $(MFLAGS) recompile
99 $(MAKE) $(MFLAGS) -C ../lisp recompile
103 ### This is meant for Emacs maintainers only. It first cleans the
104 ### lisp subdirectory, removing all compiled Lisp files. Then a
105 ### special emacs executable is built from Lisp sources, which is then
106 ### used to compile Lisp files. The last step is a "normal" make.
108 maybe-bootstrap: maybe-bootstrap-$(SHELLTYPE)
110 # dummy target to force other targets to be evaluated.
113 maybe-bootstrap-CMD: doit
115 @if not EXIST ..\lisp\abbrev.elc echo Essential Lisp files seem to be missing. You should either
116 @if not EXIST ..\lisp\abbrev.elc echo do 'make bootstrap' or create 'lisp/abbrev.elc' somehow
118 @if not EXIST ..\lisp\abbrev.elc exit -1
120 maybe-bootstrap-SH: doit
121 @if [ ! -f ../lisp/abbrev.elc ] ; then \
123 echo "Essential Lisp files seem to be missing. You should either"; \
124 echo "do \`make bootstrap' or create \`lisp/abbrev.elc' somehow."; \
129 bootstrap: addsection bootstrap-$(MAKETYPE) all
133 $(MAKE) $(MFLAGS) bootstrap-clean
135 $(MAKE) $(MFLAGS) clean
137 $(MAKE) $(MFLAGS) clean
139 $(MAKE) $(MFLAGS) bootstrap
140 $(MAKE) $(MFLAGS) bootstrap-clean
142 $(MAKE) $(MFLAGS) bootstrap
144 $(MAKE) $(MFLAGS) DOC
148 $(MAKE) $(MFLAGS) -C ../lisp bootstrap-clean
149 $(MAKE) $(MFLAGS) -C ../src clean
150 $(MAKE) $(MFLAGS) -C ../lib-src clean
151 $(MAKE) $(MFLAGS) -C ../src bootstrap
152 $(MAKE) $(MFLAGS) -C ../src bootstrap-clean
153 $(MAKE) $(MFLAGS) -C ../lisp bootstrap
154 $(MAKE) $(MFLAGS) -C ../lib-src DOC
156 bootstrap-clean: bootstrap-clean-$(MAKETYPE)
158 bootstrap-clean-nmake:
160 $(MAKE) $(MFLAGS) bootstrap-clean
162 $(MAKE) $(MFLAGS) bootstrap-clean
164 bootstrap-clean-gmake:
165 $(MAKE) $(MFLAGS) -C ../src bootstrap-clean
166 $(MAKE) $(MFLAGS) -C ../lisp bootstrap-clean
169 - mkdir "$(INSTALL_DIR)"
171 $(INSTALL_DIR)/bin: $(INSTALL_DIR)
172 - mkdir "$(INSTALL_DIR)/bin"
175 # Build and install emacs in INSTALL_DIR
177 install: all $(INSTALL_DIR)/bin install-other-dirs-$(MAKETYPE)
178 - $(CP) $(BLD)/addpm.exe $(INSTALL_DIR)/bin
179 - $(CP) $(BLD)/ddeclient.exe $(INSTALL_DIR)/bin
180 - $(CP) $(BLD)/cmdproxy.exe $(INSTALL_DIR)/bin
181 - $(CP) $(BLD)/runemacs.exe $(INSTALL_DIR)/bin
182 - $(CP) ../lib-src/fns-*.el $(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
220 clean: clean-other-dirs-$(MAKETYPE)
221 - $(DEL) *~ $(COMPILER_TEMP_FILES)
222 - $(DEL_TREE) $(OBJDIR)
223 - $(DEL) ../etc/DOC ../etc/DOC-X
225 clean-other-dirs-nmake:
227 $(MAKE) $(MFLAGS) clean
229 $(MAKE) $(MFLAGS) clean
231 $(MAKE) $(MFLAGS) clean
233 $(MAKE) $(MFLAGS) clean
236 clean-other-dirs-gmake:
237 $(MAKE) $(MFLAGS) -C ../lib-src clean
238 $(MAKE) $(MFLAGS) -C ../src clean
239 $(MAKE) $(MFLAGS) -C ../lisp clean
240 $(MAKE) $(MFLAGS) -C ../leim clean
242 cleanall-other-dirs-nmake:
244 $(MAKE) $(MFLAGS) cleanall
246 $(MAKE) $(MFLAGS) cleanall
249 cleanall-other-dirs-gmake:
250 $(MAKE) $(MFLAGS) -C ../lib-src cleanall
251 $(MAKE) $(MFLAGS) -C ../src cleanall
253 cleanall: clean cleanall-other-dirs-$(MAKETYPE)
255 - $(DEL_TREE) obj-spd