(VALID_LEADING_CODE_P): New macro.
[bpt/emacs.git] / lib-src / makefile.w32-in
CommitLineData
53b67fa0
AI
1# Makefile for GNU Emacs on the Microsoft W32 API.
2# Copyright (c) 2000-2001 Free Software Foundation, Inc.
7bbaaedd
AI
3#
4# This file is part of GNU Emacs.
52402e4f 5#
7bbaaedd
AI
6# GNU Emacs is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
52402e4f 10#
7bbaaedd
AI
11# GNU Emacs is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
52402e4f 15#
7bbaaedd
AI
16# You should have received a copy of the GNU General Public License
17# along with GNU Emacs; see the file COPYING. If not, write to the
18# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, USA.
20#
21
57854d7a 22ALL = make-docfile hexl ctags etags movemail ebrowse
7bbaaedd
AI
23
24.PHONY: $(ALL)
25
26LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \
d19249e7 27 -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I../nt/inc \
e260c47a 28 -I../src
7bbaaedd
AI
29
30# don't know what (if) to do with these yet...
31#
32# $(BLD)/sorted-doc.exe \
33# $(BLD)/env.exe \
34# $(BLD)/server.exe \
35# $(BLD)/emacstool.exe \
36# $(BLD)/leditcfns.exe \
37# $(BLD)/emacsclient.exe \
38# $(BLD)/cvtmail.exe \
39# $(BLD)/digest-doc.exe \
40# $(BLD)/test-distrib.exe \
41
7bbaaedd
AI
42LIBS = $(BASE_LIBS) $(ADVAPI32)
43
44$(BLD)/make-docfile.exe: $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O)
45 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O) $(LIBS)
46$(BLD)/hexl.exe: $(BLD)/hexl.$(O)
47 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/hexl.$(O) $(LIBS)
48$(BLD)/fakemail.exe: $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O)
49 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) $(LIBS)
50
51make-docfile: $(BLD) $(BLD)/make-docfile.exe
52ctags: $(BLD) $(BLD)/ctags.exe
53etags: $(BLD) $(BLD)/etags.exe
d19249e7 54ebrowse: $(BLD) $(BLD)/ebrowse.exe
7bbaaedd
AI
55hexl: $(BLD) $(BLD)/hexl.exe
56movemail: $(BLD) $(BLD)/movemail.exe
57fakemail: $(BLD) $(BLD)/fakemail.exe
58
59GETOPTOBJS = $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O)
60GETOPTDEPS = $(GETOPTOBJS) getopt.h
61MOVEMAILOBJS = $(BLD)/movemail.$(O) \
62 $(BLD)/pop.$(O) \
63 $(BLD)/ntlib.$(O) \
64 $(GETOPTOBJS)
65
66$(BLD)/movemail.exe: $(MOVEMAILOBJS) getopt.h
67# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
68 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(MOVEMAILOBJS) $(WSOCK32) $(LIBS)
69
70ETAGSOBJ = $(BLD)/etags.$(O) \
71 $(BLD)/getopt.$(O) \
72 $(BLD)/getopt1.$(O) \
73 $(BLD)/ntlib.$(O) \
74 $(BLD)/regex.$(O)
75
76$(BLD)/etags.exe: $(ETAGSOBJ)
77 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ETAGSOBJ) $(LIBS)
78
79
d19249e7
JR
80EBROWSEOBJ = $(BLD)/ebrowse.$(O) \
81 $(BLD)/getopt.$(O) \
82 $(BLD)/getopt1.$(O) \
83 $(BLD)/ntlib.$(O)
84
85$(BLD)/ebrowse.exe: $(EBROWSEOBJ)
88257bc8 86 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(EBROWSEOBJ) $(LIBS)
d19249e7 87
7bbaaedd
AI
88$(BLD)/regex.$(O): ../src/regex.c ../src/regex.h ../src/config.h
89 $(CC) $(CFLAGS) -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
90 ../src/regex.c $(CC_OUT)$@
91
92ETAGS_CFLAGS = -DHAVE_GETCWD
93$(BLD)/etags.$(O): etags.c
94 $(CC) $(CFLAGS) $(ETAGS_CFLAGS) $(CC_OUT)$@ etags.c
95
96CTAGSOBJ = $(BLD)/ctags.$(O) \
97 $(BLD)/getopt.$(O) \
98 $(BLD)/getopt1.$(O) \
99 $(BLD)/ntlib.$(O) \
100 $(BLD)/regex.$(O)
101
102$(BLD)/ctags.exe: $(CTAGSOBJ)
103 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(CTAGSOBJ) $(LIBS)
104
105ctags.c: etags.c
106 - $(DEL) ctags.c
107 $(CP) etags.c ctags.c
108
109CTAGS_CFLAGS = -DCTAGS $(ETAGS_CFLAGS)
110$(BLD)/ctags.$(O): ctags.c
111 $(CC) $(CFLAGS) $(CTAGS_CFLAGS) $(CC_OUT)$@ ctags.c
112
113#
114# don't know what to do with these yet...
115#
116# $(BLD)/sorted-doc.exe: $(BLD)/sorted-doc.$(O)
117# $(BLD)/yow.exe: $(BLD)/yow.$(O)
118# $(BLD)/emacstool.exe: $(BLD)/emacstool.$(O)
119# $(BLD)/leditcfns.exe: $(BLD)/leditcfns.$(O)
120# $(BLD)/server.exe: $(BLD)/server.$(O)
121# $(BLD)/cvtmail.exe: $(BLD)/cvtmail.$(O)
122# $(BLD)/digest-doc.exe: $(BLD)/digest-doc.$(O)
123# $(BLD)/emacsclient.exe: $(BLD)/emacsclient.$(O)
124# $(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O)
125
126#
127# From ..\src\makefile.nt.
128#
29f538e6 129obj = abbrev.c alloc.c alloca.c buffer.c bytecode.c callint.c callproc.c casefiddle.c casetab.c category.c ccl.c charset.c cm.c cmds.c coding.c data.c dired.c dispnew.c doc.c doprnt.c editfns.c emacs.c eval.c fileio.c filelock.c filemode.c floatfns.c fns.c fontset.c frame.c gmalloc.c indent.c insdel.c intervals.c keyboard.c keymap.c lastfile.c lread.c macros.c marker.c minibuf.c print.c process.c ralloc.c regex.c region-cache.c scroll.c search.c sound.c strftime.c syntax.c sysdep.c term.c termcap.c textprop.c tparam.c undo.c unexw32.c vm-limit.c w32.c w32console.c w32fns.c w32heap.c w32inevt.c w32menu.c w32proc.c w32reg.c w32select.c w32term.c w32xfns.c window.c xdisp.c xfaces.c xfaces.c
7bbaaedd
AI
130#
131# These are the lisp files that are loaded up in loadup.el
132#
133lispsource = ../lisp/
134
7f379e5b
JR
135MOUSE_SUPPORT = $(lispsource)select.elc $(lispsource)scroll-bar.elc $(lispsource)mouse.elc
136WINNT_SUPPORT = $(lispsource)ls-lisp.elc $(lispsource)disp-table.elc $(lispsource)w32-fns.elc $(lispsource)dos-w32.elc $(lispsource)w32-vars.elc
137
138# lisp files that are loaded up on other platforms
139MSDOS_SUPPORT = $(lispsource)dos-fns.elc $(lispsource)dos-vars.elc $(lispsource)international/ccl.elc $(lispsource)international/codepage.elc
140VMS_SUPPORT = $(lispsource)vmsproc.elc $(lispsource)vms-patch.elc
7bbaaedd
AI
141
142lisp= \
7f379e5b
JR
143 $(lispsource)abbrev.elc \
144 $(lispsource)buff-menu.elc \
e63e8d3e 145 $(lispsource)button.elc \
7f379e5b
JR
146 $(lispsource)byte-run.elc \
147 $(lispsource)cus-start.elc \
148 $(lispsource)custom.elc \
dd87b4cc 149 $(lispsource)emacs-lisp/backquote.elc \
7f379e5b
JR
150 $(lispsource)emacs-lisp/lisp-mode.elc \
151 $(lispsource)emacs-lisp/lisp.elc \
152 $(lispsource)env.elc \
153 $(lispsource)faces.elc \
154 $(lispsource)files.elc \
155 $(lispsource)format.elc \
156 $(lispsource)facemenu.elc \
7bbaaedd 157 $(MOUSE_SUPPORT) \
7f379e5b
JR
158 $(lispsource)float-sup.elc \
159 $(lispsource)frame.elc\
160 $(lispsource)help.elc \
161 $(lispsource)indent.elc \
162 $(lispsource)isearch.elc \
7bbaaedd
AI
163 $(lispsource)loadup.el \
164 $(lispsource)loaddefs.el \
7f379e5b
JR
165 $(lispsource)bindings.elc \
166 $(lispsource)map-ynp.elc \
167 $(lispsource)menu-bar.elc \
168 $(lispsource)international/mule.elc \
7bbaaedd 169 $(lispsource)international/mule-conf.el \
7f379e5b
JR
170 $(lispsource)international/mule-cmds.elc \
171 $(lispsource)international/characters.elc \
7a8940da 172 $(lispsource)international/ucs-tables.elc \
7f379e5b
JR
173 $(lispsource)international/utf-8.elc \
174 $(lispsource)international/latin-1.el \
175 $(lispsource)international/latin-2.el \
176 $(lispsource)international/latin-3.el \
177 $(lispsource)international/latin-4.el \
178 $(lispsource)international/latin-5.el \
179 $(lispsource)international/latin-8.el \
180 $(lispsource)international/latin-9.el \
181 $(lispsource)case-table.elc \
182 $(lispsource)language/chinese.elc \
183 $(lispsource)language/cyrillic.elc \
184 $(lispsource)language/indian.elc \
52402e4f 185 $(lispsource)language/devanagari.el \
0a0dc511
JB
186 $(lispsource)language/malayalam.el \
187 $(lispsource)language/tamil.el \
76054cc8 188 $(lispsource)language/english.el \
7f379e5b
JR
189 $(lispsource)language/ethiopic.elc \
190 $(lispsource)language/european.elc \
76054cc8
AI
191 $(lispsource)language/czech.el \
192 $(lispsource)language/slovak.el \
193 $(lispsource)language/romanian.el \
194 $(lispsource)language/greek.el \
195 $(lispsource)language/hebrew.el \
76054cc8
AI
196 $(lispsource)language/japanese.el \
197 $(lispsource)language/korean.el \
198 $(lispsource)language/lao.el \
199 $(lispsource)language/thai.el \
7f379e5b
JR
200 $(lispsource)language/tibetan.elc \
201 $(lispsource)language/vietnamese.elc \
76054cc8 202 $(lispsource)language/misc-lang.el \
7f379e5b
JR
203 $(lispsource)language/utf-8-lang.el \
204 $(lispsource)language/georgian.el \
7bbaaedd 205 $(lispsource)paths.el \
7f379e5b
JR
206 $(lispsource)register.elc \
207 $(lispsource)replace.elc \
208 $(lispsource)simple.elc \
209 $(lispsource)startup.elc \
210 $(lispsource)subr.elc \
211 $(lispsource)term/tty-colors.elc \
7a8940da 212 $(lispsource)font-core.elc \
7f379e5b
JR
213 $(lispsource)textmodes/fill.elc \
214 $(lispsource)textmodes/page.elc \
215 $(lispsource)textmodes/paragraphs.elc \
216 $(lispsource)textmodes/text-mode.elc \
217 $(lispsource)vc-hooks.elc \
218 $(lispsource)ediff-hook.elc \
7bbaaedd
AI
219 $(VMS_SUPPORT) \
220 $(MSDOS_SUPPORT) \
221 $(WINNT_SUPPORT) \
7f379e5b
JR
222 $(lispsource)widget.elc \
223 $(lispsource)window.elc \
7bbaaedd
AI
224 $(lispsource)version.el
225
226
52402e4f 227DOC = DOC
76054cc8 228$(DOC): make-docfile
7bbaaedd 229 - $(DEL) $(DOC)
cf6d30d7
AI
230 "$(THISDIR)/$(BLD)/make-docfile" -o $(DOC) -d ../src $(obj)
231 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp)
7bbaaedd
AI
232 $(CP) $(DOC) ../etc/DOC-X
233 - mkdir "../src/$(OBJDIR)"
234 - mkdir "../src/$(OBJDIR)/etc"
235 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC-X
236
237{$(BLD)}.$(O){$(BLD)}.exe:
238 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
239
240#
241# Build the executables
242#
243all: $(BLD) $(ALL) $(DOC)
244
245#
246# Assuming INSTALL_DIR is defined, build and install emacs in it.
247#
248INSTALL_FILES = $(ALL)
249install: $(INSTALL_FILES)
250 - mkdir "$(INSTALL_DIR)/bin"
251 $(CP) $(BLD)/etags.exe $(INSTALL_DIR)/bin
88257bc8 252 $(CP) $(BLD)/ebrowse.exe $(INSTALL_DIR)/bin
7bbaaedd
AI
253 $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin
254 $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin
255 $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin
7bbaaedd
AI
256 - mkdir "$(INSTALL_DIR)/etc"
257 $(CP) $(DOC) $(INSTALL_DIR)/etc
258
259#
260# Maintenance
52402e4f 261#
7bbaaedd 262clean:
5cdd7eef 263 - $(DEL) *~ DOC* $(COMPILER_TEMP_FILES)
7bbaaedd
AI
264 - $(DEL) ctags.c
265 - $(DEL_TREE) $(OBJDIR)
266
267cleanall: clean
268 - $(DEL_TREE) obj
269 - $(DEL_TREE) obj-spd
270 - $(DEL_TREE) oo
271 - $(DEL_TREE) oo-spd
272
273#
274# Headers we would preprocess if we could.
275#
276../src/config.h: ../nt/$(CONFIG_H)
277 $(CP) $(ALL_DEPS) $@
278../src/paths.h: ../nt/paths.h
279 $(CP) $(ALL_DEPS) $@
280
281### DEPENDENCIES ###
282
283EMACS_ROOT = ..
284SRC = .
285
286$(BLD)/alloca.$(O) : \
287 $(SRC)/alloca.c \
288 $(EMACS_ROOT)/src/s/ms-w32.h \
289 $(EMACS_ROOT)/src/m/intel386.h \
290 $(EMACS_ROOT)/src/config.h \
291 $(EMACS_ROOT)/src/blockinput.h
292
293$(BLD)/b2m.$(O) : \
294 $(SRC)/b2m.c \
295 $(EMACS_ROOT)/src/s/ms-w32.h \
296 $(EMACS_ROOT)/src/m/intel386.h \
297 $(EMACS_ROOT)/lib-src/../src/config.h
298
299$(BLD)/ctags.$(O) : \
300 $(SRC)/ctags.c \
301 $(EMACS_ROOT)/nt/inc/sys/param.h \
302 $(EMACS_ROOT)/src/s/ms-w32.h \
303 $(EMACS_ROOT)/src/m/intel386.h \
304 $(EMACS_ROOT)/lib-src/../src/config.h \
305 $(SRC)/ntlib.h \
306 $(SRC)/getopt.h
307
308$(BLD)/cvtmail.$(O) : \
309 $(SRC)/cvtmail.c
310
311$(BLD)/digest-doc.$(O) : \
312 $(SRC)/digest-doc.c
313
314$(BLD)/emacsclient.$(O) : \
315 $(SRC)/emacsclient.c \
316 $(EMACS_ROOT)/src/s/ms-w32.h \
317 $(EMACS_ROOT)/src/m/intel386.h \
318 $(EMACS_ROOT)/lib-src/../src/config.h
319
7bbaaedd
AI
320$(BLD)/emacstool.$(O) : \
321 $(SRC)/emacstool.c \
322 $(EMACS_ROOT)/nt/inc/sys/file.h
323
324$(BLD)/etags.$(O) : \
325 $(SRC)/etags.c \
326 $(EMACS_ROOT)/nt/inc/sys/param.h \
327 $(EMACS_ROOT)/src/s/ms-w32.h \
328 $(EMACS_ROOT)/src/m/intel386.h \
329 $(EMACS_ROOT)/lib-src/../src/config.h \
330 $(SRC)/ntlib.h \
331 $(SRC)/getopt.h
332
333$(BLD)/fakemail.$(O) : \
334 $(SRC)/fakemail.c \
335 $(SRC)/ntlib.h \
336 $(EMACS_ROOT)/src/s/ms-w32.h \
337 $(EMACS_ROOT)/src/m/intel386.h \
338 $(EMACS_ROOT)/lib-src/../src/config.h \
339 $(EMACS_ROOT)/nt/inc/pwd.h
340
341$(BLD)/getdate.$(O) : \
342 $(SRC)/getdate.c \
343 $(EMACS_ROOT)/src/s/ms-w32.h \
344 $(EMACS_ROOT)/src/m/intel386.h \
345 $(EMACS_ROOT)/src/config.h \
346 $(MSTOOLS_SYS)/types.h
347
348$(BLD)/getopt.$(O) : \
349 $(SRC)/getopt.c \
350 $(EMACS_ROOT)/src/s/ms-w32.h \
351 $(EMACS_ROOT)/src/m/intel386.h \
352 $(EMACS_ROOT)/src/config.h \
353 $(SRC)/ntlib.h \
354 $(SRC)/getopt.h
355
356$(BLD)/getopt1.$(O) : \
357 $(SRC)/getopt1.c \
358 $(EMACS_ROOT)/src/s/ms-w32.h \
359 $(EMACS_ROOT)/src/m/intel386.h \
360 $(EMACS_ROOT)/src/config.h \
361 $(SRC)/getopt.h
362
363$(BLD)/hexl.$(O) : \
364 $(SRC)/hexl.c
365
366$(BLD)/leditcfns.$(O) : \
367 $(SRC)/leditcfns.c
368
369$(BLD)/make-docfile.$(O) : \
370 $(SRC)/make-docfile.c \
371 $(EMACS_ROOT)/src/config.h
372
373$(BLD)/make-path.$(O) : \
374 $(SRC)/make-path.c
375
376$(BLD)/movemail.$(O) : \
377 $(SRC)/movemail.c \
378 $(EMACS_ROOT)/src/s/ms-w32.h \
379 $(EMACS_ROOT)/src/m/intel386.h \
380 $(EMACS_ROOT)/lib-src/../src/config.h \
381 $(EMACS_ROOT)/nt/inc/sys/file.h \
7bbaaedd
AI
382 $(EMACS_ROOT)/lib-src/../src/syswait.h \
383 $(EMACS_ROOT)/nt/inc/pwd.h \
384 $(SRC)/ntlib.h
385 $(CC) $(CFLAGS) -DUSG $(CC_OUT)$@ movemail.c
386
387$(BLD)/ntlib.$(O) : \
388 $(SRC)/ntlib.c \
389 $(SRC)/ntlib.h \
390 $(EMACS_ROOT)/nt/inc/pwd.h
391
392$(BLD)/pop.$(O) : \
393 $(SRC)/pop.c \
394 $(SRC)/pop.h \
395 $(SRC)/ntlib.h
396
397$(BLD)/profile.$(O) : \
398 $(SRC)/profile.c \
399 $(EMACS_ROOT)/src/s/ms-w32.h \
400 $(EMACS_ROOT)/src/m/intel386.h \
401 $(EMACS_ROOT)/lib-src/../src/config.h \
7bbaaedd
AI
402 $(EMACS_ROOT)/lib-src/../src/systime.h
403
404$(BLD)/qsort.$(O) : \
405 $(SRC)/qsort.c
406
407$(BLD)/sorted-doc.$(O) : \
408 $(SRC)/sorted-doc.c
409
410$(BLD)/tcp.$(O) : \
411 $(SRC)/tcp.c
412
413$(BLD)/test-distrib.$(O) : \
414 $(SRC)/test-distrib.c
415
416$(BLD)/timer.$(O) : \
417 $(SRC)/timer.c \
418 $(EMACS_ROOT)/src/s/ms-w32.h \
419 $(EMACS_ROOT)/src/m/intel386.h \
420 $(EMACS_ROOT)/lib-src/../src/config.h
421
422$(BLD)/yow.$(O) : \
423 $(SRC)/yow.c \
424 $(EMACS_ROOT)/lib-src/../src/paths.h