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