Add Commentary section, minor cleanup of file header.
[emacs.git] / nt / makefile.w32-in
blob1f1acccb6f0667a22660ba2adf4af23deef08910
1 #  Makefile for GNU Emacs on the Microsoft W32 API.\r
2 #  Copyright (c) 2000-2001 Free Software Foundation, Inc.\r
3 #\r
4 #  Top level makefile for building GNU Emacs on Windows NT\r
5 #\r
6 #  This file is part of GNU Emacs.\r
7 #\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
12 #\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
17 #\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
25 .PHONY: $(ALL)\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
54 #\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
57 #\r
58 $(TRES):        emacs.rc\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
66 which-sh:\r
67         @echo Using $(THE_SHELL) as shell.\r
69 #\r
70 # Build emacs\r
71 #\r
72 all:    which-sh $(BLD) $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)\r
74 all-other-dirs-nmake:\r
75         cd ..\lib-src\r
76         $(MAKE) $(MFLAGS) all\r
77         cd ..\src\r
78         $(MAKE) $(MFLAGS) all\r
79         cd ..\lisp\r
80         $(MAKE) $(MFLAGS) all\r
81         cd ..\leim\r
82         $(MAKE) $(MFLAGS) all\r
83         cd ..\nt\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
93 recompile-nmake:\r
94         cd ..\lisp\r
95         $(MAKE) $(MFLAGS) recompile\r
96         cd ..\nt\r
98 recompile-gmake:\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
111 doit:\r
113 maybe-bootstrap-CMD:    doit\r
114         @echo.\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
117         @echo.\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
122           echo; \\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
125           echo; \\r
126           exit -1; \\r
127         fi\r
129 bootstrap:      addsection bootstrap-$(MAKETYPE) all\r
131 bootstrap-nmake:\r
132         cd ..\lisp\r
133         $(MAKE) $(MFLAGS) bootstrap-clean\r
134         cd ..\src\r
135         $(MAKE) $(MFLAGS) clean\r
136         cd ..\lib-src\r
137         $(MAKE) $(MFLAGS) clean\r
138         cd ..\src\r
139         $(MAKE) $(MFLAGS) bootstrap\r
140         $(MAKE) $(MFLAGS) bootstrap-clean\r
141         cd ..\lisp\r
142         $(MAKE) $(MFLAGS) bootstrap\r
143         cd ..\lib-src\r
144         $(MAKE) $(MFLAGS) DOC\r
145         cd ..\nt\r
147 bootstrap-gmake:\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
159         cd ..\src\r
160         $(MAKE) $(MFLAGS) bootstrap-clean\r
161         cd ..\lisp\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
168 $(INSTALL_DIR):\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
201         cd ..\lib-src\r
202         $(MAKE) $(MFLAGS) install\r
203         cd ..\src\r
204         $(MAKE) $(MFLAGS) install\r
205         cd ..\lisp\r
206         $(MAKE) $(MFLAGS) install\r
207         cd ..\leim\r
208         $(MAKE) $(MFLAGS) install\r
209         cd ..\nt\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
217 force-info:\r
218 # Note that man/makefile knows how to\r
219 # put the info files in $(infodir),\r
220 # so we can do ok running make in the build dir.\r
221 info: force-info\r
222         (cd ..\man && $(MAKE) $(MFLAGS) info)\r
223         (cd ..\lispref && $(MAKE) $(MFLAGS) info)\r
224         (cd ..\lispintro && $(MAKE) $(MFLAGS) info)\r
227 # Maintenance\r
229 clean:  clean-other-dirs-$(MAKETYPE)\r
230         - $(DEL) *~ $(COMPILER_TEMP_FILES)\r
231         - $(DEL_TREE) $(OBJDIR)\r
232         - $(DEL) ../etc/DOC ../etc/DOC-X\r
234 clean-other-dirs-nmake:\r
235         cd ..\lib-src\r
236         $(MAKE) $(MFLAGS) clean\r
237         cd ..\src\r
238         $(MAKE) $(MFLAGS) clean\r
239         cd ..\lisp\r
240         $(MAKE) $(MFLAGS) clean\r
241         cd ..\lispintro\r
242         $(MAKE) $(MFLAGS) clean\r
243         cd ..\lispref\r
244         $(MAKE) $(MFLAGS) clean\r
245         cd ..\leim\r
246         $(MAKE) $(MFLAGS) clean\r
247         cd ..\man\r
248         $(MAKE) $(MFLAGS) clean\r
249         cd ..\nt\r
251 clean-other-dirs-gmake:\r
252         $(MAKE) $(MFLAGS) -C ../lib-src clean\r
253         $(MAKE) $(MFLAGS) -C ../src clean\r
254         $(MAKE) $(MFLAGS) -C ../lisp clean\r
255         $(MAKE) $(MFLAGS) -C ../leim clean\r
257 cleanall-other-dirs-nmake:\r
258         cd ..\lib-src\r
259         $(MAKE) $(MFLAGS) cleanall\r
260         cd ..\src\r
261         $(MAKE) $(MFLAGS) cleanall\r
262         cd ..\nt\r
264 cleanall-other-dirs-gmake:\r
265         $(MAKE) $(MFLAGS) -C ../lib-src cleanall\r
266         $(MAKE) $(MFLAGS) -C ../src cleanall\r
268 cleanall: clean cleanall-other-dirs-$(MAKETYPE)\r
269          - $(DEL_TREE) obj\r
270          - $(DEL_TREE) obj-spd\r
271          - $(DEL_TREE) oo\r
272          - $(DEL_TREE) oo-spd\r
274 realclean: cleanall\r
275         - $(DEL_TREE) ../bin\r
277 # arch-tag: 6f5b23a6-774b-4598-9c29-58235b2b4219\r