Warn if try to set coding in dir-locals (bug#7169)
[emacs.git] / lib-src / makefile.w32-in
blobcbd29f32cfe14bdf77d1fe7ca69fd5791dc929e0
1 #  -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
2 # Copyright (C) 2000-2012 Free Software Foundation, Inc.
4 # This file is part of GNU Emacs.
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 3 of the License, or
9 # (at your option) any later version.
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.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
20 ALL = $(BLD)/test-distrib.exe $(BLD)/make-docfile.exe $(BLD)/hexl.exe\
21  $(BLD)/ctags.exe $(BLD)/etags.exe $(BLD)/movemail.exe $(BLD)/ebrowse.exe\
22  $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe $(BLD)/profile.exe
24 .PHONY: make-docfile
26 LOCAL_FLAGS     = -DNO_LDAV=1 -DNO_ARCHIVES=1 -I../lib \
27                   -I../nt/inc -I../src $(EMACS_EXTRA_C_FLAGS)
29 LIBS            = $(BASE_LIBS) $(ADVAPI32)
31 # The following target is used by makefile.w32-in files in other directories.
32 make-docfile:   $(BLD)/make-docfile.exe
34 $(BLD)/make-docfile.exe:        $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O)
35                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/make-docfile.$(O) $(BLD)/ntlib.$(O) $(LIBS)
36 $(BLD)/hexl.exe:                $(BLD)/hexl.$(O)
37                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/hexl.$(O) $(LIBS)
38 $(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O)
39                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/test-distrib.$(O) $(LIBS)
40                 "$(BLD)/test-distrib.exe" "$(LIB_SRC)/testfile"
42 MOVEMAILOBJS =  $(BLD)/movemail.$(O) \
43                 $(BLD)/pop.$(O) \
44                 ../lib/$(BLD)/libgnu.$(A) \
45                 $(BLD)/ntlib.$(O)
47 $(BLD)/movemail.exe:    $(MOVEMAILOBJS) ../lib/getopt.h
48 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
49                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(MOVEMAILOBJS) $(WSOCK32) $(LIBS)
51 ECLIENT_CFLAGS = -DHAVE_GETCWD -DHAVE_STRERROR
52 ECLIENTOBJS =   $(BLD)/emacsclient.$(O) \
53                 $(BLD)/ntlib.$(O) \
54                 ../lib/$(BLD)/libgnu.$(A)
55 CLIENTRES =     ../nt/$(BLD)/emacsclient.res
57 $(CLIENTRES):   ../nt/emacsclient.rc
58         @echo Emacsclient resource file must be built from nt directory
59         @exit -1
61 $(BLD)/emacsclient.exe:         $(ECLIENTOBJS)
62 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
63                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
65 $(BLD)/emacsclientw.exe:        $(ECLIENTOBJS) $(CLIENTRES)
66 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
67                 $(LINK) $(LINK_OUT)$@ $(CLIENTRES) $(MWINDOWS) $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
69 $(BLD)/emacsclient.$(O):        emacsclient.c
70                 $(CC) $(CFLAGS) $(ECLIENT_CFLAGS) $(CC_OUT)$@ emacsclient.c
72 ETAGSOBJ      = $(BLD)/etags.$(O) \
73                 ../lib/$(BLD)/libgnu.$(A) \
74                 $(BLD)/ntlib.$(O) \
75                 $(BLD)/regex.$(O)
77 $(BLD)/etags.exe:       $(ETAGSOBJ)
78                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ETAGSOBJ) $(LIBS)
81 EBROWSEOBJ    = $(BLD)/ebrowse.$(O) \
82                 ../lib/$(BLD)/libgnu.$(A) \
83                 $(BLD)/ntlib.$(O)
85 $(BLD)/ebrowse.exe:     $(EBROWSEOBJ)
86                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(EBROWSEOBJ) $(LIBS)
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)$@
92 ETAGS_CFLAGS  = -DHAVE_GETCWD -DEMACS_NAME="\"GNU Emacs\""
93 $(BLD)/etags.$(O): etags.c
94                 $(CC) $(CFLAGS) $(ETAGS_CFLAGS) $(CC_OUT)$@ etags.c
96 CTAGSOBJ      = $(BLD)/ctags.$(O) \
97                 ../lib/$(BLD)/libgnu.$(A) \
98                 $(BLD)/ntlib.$(O) \
99                 $(BLD)/regex.$(O)
101 $(BLD)/ctags.exe:  $(CTAGSOBJ)
102                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(CTAGSOBJ) $(LIBS)
104 ctags.c:        etags.c
105                 - $(DEL) ctags.c
106                 $(CP) etags.c ctags.c
108 CTAGS_CFLAGS  = -DCTAGS $(ETAGS_CFLAGS)
109 $(BLD)/ctags.$(O): ctags.c
110                 $(CC) $(CFLAGS) $(CTAGS_CFLAGS) $(CC_OUT)$@ ctags.c
112 PROFILEOBJS     = $(BLD)/profile.$(O) \
113                   ../lib/$(BLD)/libgnu.$(A) \
114                   $(BLD)/ntlib.$(O)
115 $(BLD)/profile.exe:     $(PROFILEOBJS)
116                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(PROFILEOBJS) $(LIBS)
119 # From ..\src\Makefile.in
120 # It doesn't matter if the real name is *.obj for the files in this list,
121 # make-docfile blindly replaces .o with .c anyway.  Keep .o in this list
122 # as it is required by code in doc.c.
124 obj =   dosfns.o msdos.o \
125         xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
126         fontset.o menu.o \
127         w32.o w32console.o w32fns.o w32heap.o w32inevt.o cygw32.o \
128         w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
129         font.o w32font.o w32uniscribe.o \
130         dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \
131         charset.o coding.o category.o ccl.o character.o chartab.o \
132         cm.o term.o terminal.o xfaces.o \
133         emacs.o keyboard.o macros.o keymap.o sysdep.o \
134         buffer.o filelock.o insdel.o marker.o \
135         minibuf.o fileio.o dired.o \
136         cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
137         alloc.o data.o doc.o editfns.o callint.o \
138         eval.o floatfns.o fns.o print.o lread.o \
139         syntax.o bytecode.o \
140         process.o callproc.o unexw32.o \
141         region-cache.o sound.o atimer.o \
142         doprnt.o intervals.o textprop.o composite.o \
143         gnutls.o xml.o profiler.o
146 # These are the lisp files that are loaded up in loadup.el
148 lispsource = ../lisp/
150 MOUSE_SUPPORT = \
151         $(lispsource)select.elc \
152         $(lispsource)scroll-bar.elc \
153         $(lispsource)mouse.elc
154 WINNT_SUPPORT = \
155         $(lispsource)ls-lisp.elc \
156         $(lispsource)disp-table.elc \
157         $(lispsource)w32-fns.elc \
158         $(lispsource)dos-w32.elc \
159         $(lispsource)w32-vars.elc \
160         $(lispsource)term/common-win.elc \
161         $(lispsource)term/w32-win.elc
162 TOOLTIP_SUPPORT = $(lispsource)tooltip.elc
163 WINDOW_SUPPORT = \
164         $(lispsource)fringe.elc \
165         $(lispsource)image.elc \
166         $(lispsource)international/fontset.elc \
167         $(lispsource)dnd.elc \
168         $(lispsource)tool-bar.elc \
169         $(lispsource)mwheel.elc
171 # lisp files that are loaded up on other platforms
172 OTHER_PLATFORM_SUPPORT = \
173         $(lispsource)dos-fns.elc \
174         $(lispsource)dos-vars.elc \
175         $(lispsource)term/internal.elc \
176         $(lispsource)term/pc-win.elc \
177         $(lispsource)x-dnd.elc \
178         $(lispsource)term/x-win.elc \
179         $(lispsource)term/ns-win.elc
182 lisp1= \
183         $(lispsource)abbrev.elc \
184         $(lispsource)buff-menu.elc \
185         $(lispsource)button.elc \
186         $(lispsource)emacs-lisp/byte-run.elc \
187         $(lispsource)composite.elc \
188         $(lispsource)cus-face.elc \
189         $(lispsource)cus-start.elc \
190         $(lispsource)custom.elc \
191         $(lispsource)emacs-lisp/backquote.elc \
192         $(lispsource)emacs-lisp/lisp-mode.elc \
193         $(lispsource)emacs-lisp/lisp.elc \
194         $(lispsource)env.elc \
195         $(lispsource)faces.elc \
196         $(lispsource)files.elc \
197         $(lispsource)format.elc \
198         $(lispsource)facemenu.elc \
199         $(MOUSE_SUPPORT) \
200         $(lispsource)emacs-lisp/float-sup.elc \
201         $(lispsource)frame.elc \
202         $(lispsource)help.elc \
203         $(lispsource)indent.elc \
204         $(lispsource)isearch.elc \
205         $(lispsource)rfn-eshadow.elc \
206         $(lispsource)loadup.el \
207         $(lispsource)loaddefs.el \
208         $(lispsource)bindings.elc \
209         $(lispsource)emacs-lisp/map-ynp.elc \
210         $(lispsource)menu-bar.elc \
211         $(lispsource)international/mule.elc \
212         $(lispsource)international/mule-conf.elc \
213         $(lispsource)international/mule-cmds.elc \
214         $(lispsource)international/characters.elc \
215         $(lispsource)international/charprop.el \
216         $(lispsource)case-table.elc
218 lisp2 = \
219         $(lispsource)language/chinese.elc \
220         $(lispsource)language/cyrillic.elc \
221         $(lispsource)language/indian.elc \
222         $(lispsource)language/sinhala.elc \
223         $(lispsource)language/english.elc \
224         $(lispsource)language/ethiopic.elc \
225         $(lispsource)language/european.elc \
226         $(lispsource)language/czech.elc \
227         $(lispsource)language/slovak.elc \
228         $(lispsource)language/romanian.elc \
229         $(lispsource)language/greek.elc \
230         $(lispsource)language/hebrew.elc \
231         $(lispsource)language/japanese.elc \
232         $(lispsource)international/cp51932.el \
233         $(lispsource)international/eucjp-ms.el \
234         $(lispsource)language/korean.elc \
235         $(lispsource)language/lao.elc \
236         $(lispsource)language/cham.elc \
237         $(lispsource)language/tai-viet.elc \
238         $(lispsource)language/thai.elc \
239         $(lispsource)language/tibetan.elc \
240         $(lispsource)language/vietnamese.elc \
241         $(lispsource)language/misc-lang.elc \
242         $(lispsource)language/utf-8-lang.elc \
243         $(lispsource)language/georgian.elc \
244         $(lispsource)language/khmer.elc \
245         $(lispsource)language/burmese.elc \
246         $(lispsource)register.elc \
247         $(lispsource)replace.elc \
248         $(lispsource)simple.elc \
249         $(lispsource)minibuffer.elc \
250         $(lispsource)startup.elc \
251         $(lispsource)subr.elc \
252         $(lispsource)term/tty-colors.elc \
253         $(lispsource)font-core.elc \
254         $(lispsource)emacs-lisp/syntax.elc \
255         $(lispsource)font-lock.elc \
256         $(lispsource)jit-lock.elc \
257         $(lispsource)textmodes/fill.elc \
258         $(lispsource)textmodes/page.elc \
259         $(lispsource)textmodes/paragraphs.elc \
260         $(lispsource)textmodes/text-mode.elc \
261         $(lispsource)emacs-lisp/timer.elc \
262         $(lispsource)jka-cmpr-hook.elc \
263         $(lispsource)vc/vc-hooks.elc \
264         $(lispsource)vc/ediff-hook.elc \
265         $(lispsource)epa-hook.elc \
266         $(TOOLTIP_SUPPORT) \
267         $(WINNT_SUPPORT) \
268         $(WINDOW_SUPPORT) \
269         $(lispsource)widget.elc \
270         $(lispsource)window.elc \
271         $(lispsource)version.elc
273 # This is needed the first time we build the tree, since temacs.exe
274 # does not exist yet, and the DOC rule needs it to rebuild DOC whenever
275 # Emacs is rebuilt.
276 ../src/$(BLD)/temacs.exe:
277         - mkdir "../src/$(OBJDIR)"
278         - mkdir "../src/$(BLD)"
279         @echo temacs > temacs.exe
280         $(CP) temacs.exe ../src/$(BLD)
281         - $(DEL) temacs.exe
283 DOC           = DOC
284 $(DOC):         stamp_BLD $(BLD)/make-docfile.exe ../src/$(BLD)/temacs.exe $(lisp1) $(lisp2) $(OTHER_PLATFORM_SUPPORT)
285                 - $(DEL) $(DOC)
286                 "$(THISDIR)/$(BLD)/make-docfile" -o $(DOC) -d ../src $(obj)
287                 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1)
288                 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2)
289                 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(OTHER_PLATFORM_SUPPORT)
290                 $(CP) $(DOC) ../etc/DOC-X
291                 - mkdir "../src/$(OBJDIR)"
292                 - mkdir "../src/$(OBJDIR)/etc"
293                 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC-X
295 {$(BLD)}.$(O){$(BLD)}.exe:
296                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
299 # Build the executables
301 all:            $(ALL) $(DOC)
304 # Assuming INSTALL_DIR is defined, build and install emacs in it.
306 INSTALL_FILES = $(ALL)
307 install:        $(INSTALL_FILES)
308                 - mkdir "$(INSTALL_DIR)/bin"
309                 $(CP) $(BLD)/etags.exe $(INSTALL_DIR)/bin
310                 $(CP) $(BLD)/ebrowse.exe $(INSTALL_DIR)/bin
311                 $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin
312                 $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin
313                 $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin
314                 $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin
315                 $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin
316                 $(CP) $(BLD)/profile.exe $(INSTALL_DIR)/bin
317                 - mkdir "$(INSTALL_DIR)/etc"
318                 $(CP) $(DOC) $(INSTALL_DIR)/etc
321 # Maintenance
323 # We used to delete *~ here, but that might inadvertently remove
324 # precious files if it happens to match their short 8+3 aliases.
325 clean:
326                 - $(DEL) DOC* $(COMPILER_TEMP_FILES)
327                 - $(DEL) ctags.c
328                 - $(DEL_TREE) $(OBJDIR)
329                 - $(DEL) stamp_BLD
331 distclean: cleanall
332         - $(DEL) TAGS
333         - $(DEL) Makefile
335 maintainer-clean: distclean
337 cleanall:       clean
338                 - $(DEL_TREE) obj
339                 - $(DEL_TREE) obj-spd
340                 - $(DEL_TREE) oo
341                 - $(DEL_TREE) oo-spd
344 # Headers we would preprocess if we could.
346 ../src/config.h:        ../nt/$(CONFIG_H)
347                         $(DEL) $@
348                         echo $(CONFIG_H) has changed.  Re-run configure.bat.
349                         exit -1
351 ### TAGS ###
353 TAGS: $(BLD)/etags.exe *.c *.h
354         $(BLD)/etags.exe *.c *.h
356 ### DEPENDENCIES ###
358 EMACS_ROOT      = ..
359 LIB_SRC         = .
360 SRC             = $(EMACS_ROOT)/src
361 NT_INC          = $(EMACS_ROOT)/nt/inc
362 GNU_LIB         = $(EMACS_ROOT)/lib
364 MS_W32_H       = $(NT_INC)/ms-w32.h \
365                  $(NT_INC)/sys/stat.h
366 CONF_POST_H    = $(SRC)/conf_post.h \
367                  $(MS_W32_H)
368 CONFIG_H       = $(SRC)/config.h \
369                  $(CONF_POST_H)
370 INTTYPES_H     = $(NT_INC)/inttypes.h \
371                  $(NT_INC)/stdint.h
372 NTLIB_H        = $(LIB_SRC)/ntlib.h \
373                  $(NT_INC)/pwd.h
374 SYSTIME_H      = $(SRC)/systime.h \
375                  $(NT_INC)/sys/time.h \
376                  $(GNU_LIB)/timespec.h
377 SYSWAIT_H      = $(SRC)/syswait.h \
378                  $(NT_INC)/sys/wait.h
380 $(BLD)/ctags.$(O) : \
381         $(LIB_SRC)/ctags.c \
382         $(SRC)/regex.h \
383         $(NT_INC)/sys/stat.h \
384         $(NT_INC)/unistd.h \
385         $(GNU_LIB)/c-strcase.h \
386         $(GNU_LIB)/getopt.h \
387         $(CONFIG_H)
389 $(BLD)/ebrowse.$(O) : \
390         $(LIB_SRC)/ebrowse.c \
391         $(GNU_LIB)/getopt.h \
392         $(GNU_LIB)/min-max.h \
393         $(CONFIG_H)
395 $(BLD)/emacsclient.$(O) : \
396         $(LIB_SRC)/emacsclient.c \
397         $(NT_INC)/pwd.h \
398         $(NT_INC)/sys/stat.h \
399         $(NT_INC)/unistd.h \
400         $(GNU_LIB)/getopt.h \
401         $(CONFIG_H)
403 $(BLD)/etags.$(O) : \
404         $(LIB_SRC)/etags.c \
405         $(SRC)/regex.h \
406         $(NT_INC)/sys/stat.h \
407         $(NT_INC)/unistd.h \
408         $(GNU_LIB)/c-strcase.h \
409         $(GNU_LIB)/getopt.h \
410         $(CONFIG_H)
412 $(BLD)/hexl.$(O) : \
413         $(LIB_SRC)/hexl.c \
414         $(CONFIG_H)
416 $(BLD)/make-docfile.$(O) : \
417         $(LIB_SRC)/make-docfile.c \
418         $(NT_INC)/unistd.h \
419         $(CONFIG_H)
421 $(BLD)/movemail.$(O) : \
422         $(LIB_SRC)/movemail.c \
423         $(LIB_SRC)/pop.h \
424         $(NT_INC)/pwd.h \
425         $(NT_INC)/sys/file.h \
426         $(NT_INC)/sys/stat.h \
427         $(NT_INC)/unistd.h \
428         $(GNU_LIB)/getopt.h \
429         $(CONFIG_H) \
430         $(NTLIB_H) \
431         $(SYSWAIT_H)
433 $(BLD)/ntlib.$(O) : \
434         $(LIB_SRC)/ntlib.c \
435         $(NT_INC)/sys/stat.h \
436         $(NTLIB_H)
438 $(BLD)/pop.$(O) : \
439         $(LIB_SRC)/pop.c \
440         $(LIB_SRC)/pop.h \
441         $(NT_INC)/netdb.h \
442         $(NT_INC)/pwd.h \
443         $(NT_INC)/unistd.h \
444         $(GNU_LIB)/min-max.h \
445         $(CONFIG_H) \
446         $(NTLIB_H)
448 $(BLD)/profile.$(O) : \
449         $(LIB_SRC)/profile.c \
450         $(GNU_LIB)/intprops.h \
451         $(CONFIG_H) \
452         $(INTTYPES_H) \
453         $(SYSTIME_H)
455 $(BLD)/regex.$(O) : \
456         $(SRC)/regex.c \
457         $(SRC)/regex.h \
458         $(NT_INC)/stdbool.h \
459         $(NT_INC)/unistd.h \
460         $(CONFIG_H)
462 $(BLD)/test-distrib.$(O) : \
463         $(LIB_SRC)/test-distrib.c \
464         $(NT_INC)/unistd.h \
465         $(CONFIG_H)
467 # The following dependencies are for supporting parallel builds, where
468 # we must make sure $(BLD) exists before any compilation starts.
470 $(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O): stamp_BLD
472 $(BLD)/test-distrib.$(O) $(MOVEMAILOBJS): stamp_BLD
474 $(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD
476 $(BLD)/ebrowse.$(O) $(BLD)/ctags.$(O) $(BLD)/profile.$(O): stamp_BLD