* print.c (print_object): Fix last change.
[emacs.git] / lib-src / makefile.w32-in
blob24be44e22f2e1e9ab0a0ba6aa6409f68fcd41a3c
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 dbusbind.o cygw32.o \
127         nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
128         w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
129         w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
130         w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
131         xsettings.o xgselect.o termcap.o \
132         font.o w32font.o w32uniscribe.o w32notify.o \
133         dispnew.o frame.o scroll.o xdisp.o window.o bidi.o \
134         charset.o coding.o category.o ccl.o character.o chartab.o \
135         cm.o term.o terminal.o xfaces.o \
136         emacs.o keyboard.o macros.o keymap.o sysdep.o \
137         buffer.o filelock.o insdel.o marker.o \
138         minibuf.o fileio.o dired.o \
139         cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o \
140         alloc.o data.o doc.o editfns.o callint.o \
141         eval.o floatfns.o fns.o print.o lread.o \
142         syntax.o bytecode.o \
143         process.o callproc.o unexw32.o \
144         region-cache.o sound.o atimer.o \
145         doprnt.o intervals.o textprop.o composite.o \
146         gnutls.o xml.o profiler.o
149 # These are the lisp files that are loaded up in loadup.el
151 lispsource = ../lisp/
153 MOUSE_SUPPORT = \
154         $(lispsource)select.elc \
155         $(lispsource)scroll-bar.elc \
156         $(lispsource)mouse.elc
157 WINNT_SUPPORT = \
158         $(lispsource)ls-lisp.elc \
159         $(lispsource)disp-table.elc \
160         $(lispsource)w32-fns.elc \
161         $(lispsource)dos-w32.elc \
162         $(lispsource)w32-vars.elc \
163         $(lispsource)term/common-win.elc \
164         $(lispsource)term/w32-win.elc
165 TOOLTIP_SUPPORT = $(lispsource)tooltip.elc
166 WINDOW_SUPPORT = \
167         $(lispsource)fringe.elc \
168         $(lispsource)image.elc \
169         $(lispsource)international/fontset.elc \
170         $(lispsource)dnd.elc \
171         $(lispsource)tool-bar.elc \
172         $(lispsource)mwheel.elc
174 # lisp files that are loaded up on other platforms
175 OTHER_PLATFORM_SUPPORT = \
176         $(lispsource)dos-fns.elc \
177         $(lispsource)dos-vars.elc \
178         $(lispsource)term/internal.elc \
179         $(lispsource)term/pc-win.elc \
180         $(lispsource)x-dnd.elc \
181         $(lispsource)term/x-win.elc \
182         $(lispsource)term/ns-win.elc
185 lisp1= \
186         $(lispsource)abbrev.elc \
187         $(lispsource)buff-menu.elc \
188         $(lispsource)button.elc \
189         $(lispsource)emacs-lisp/byte-run.elc \
190         $(lispsource)composite.elc \
191         $(lispsource)cus-face.elc \
192         $(lispsource)cus-start.elc \
193         $(lispsource)custom.elc \
194         $(lispsource)emacs-lisp/backquote.elc \
195         $(lispsource)emacs-lisp/lisp-mode.elc \
196         $(lispsource)emacs-lisp/lisp.elc \
197         $(lispsource)env.elc \
198         $(lispsource)faces.elc \
199         $(lispsource)files.elc \
200         $(lispsource)format.elc \
201         $(lispsource)facemenu.elc \
202         $(MOUSE_SUPPORT) \
203         $(lispsource)emacs-lisp/float-sup.elc \
204         $(lispsource)frame.elc \
205         $(lispsource)help.elc \
206         $(lispsource)indent.elc \
207         $(lispsource)isearch.elc \
208         $(lispsource)rfn-eshadow.elc \
209         $(lispsource)loadup.el \
210         $(lispsource)loaddefs.el \
211         $(lispsource)bindings.elc \
212         $(lispsource)emacs-lisp/map-ynp.elc \
213         $(lispsource)menu-bar.elc \
214         $(lispsource)international/mule.elc \
215         $(lispsource)international/mule-conf.elc \
216         $(lispsource)international/mule-cmds.elc \
217         $(lispsource)international/characters.elc \
218         $(lispsource)international/charprop.el \
219         $(lispsource)case-table.elc
221 lisp2 = \
222         $(lispsource)language/chinese.elc \
223         $(lispsource)language/cyrillic.elc \
224         $(lispsource)language/indian.elc \
225         $(lispsource)language/sinhala.elc \
226         $(lispsource)language/english.elc \
227         $(lispsource)language/ethiopic.elc \
228         $(lispsource)language/european.elc \
229         $(lispsource)language/czech.elc \
230         $(lispsource)language/slovak.elc \
231         $(lispsource)language/romanian.elc \
232         $(lispsource)language/greek.elc \
233         $(lispsource)language/hebrew.elc \
234         $(lispsource)language/japanese.elc \
235         $(lispsource)international/cp51932.el \
236         $(lispsource)international/eucjp-ms.el \
237         $(lispsource)language/korean.elc \
238         $(lispsource)language/lao.elc \
239         $(lispsource)language/cham.elc \
240         $(lispsource)language/tai-viet.elc \
241         $(lispsource)language/thai.elc \
242         $(lispsource)language/tibetan.elc \
243         $(lispsource)language/vietnamese.elc \
244         $(lispsource)language/misc-lang.elc \
245         $(lispsource)language/utf-8-lang.elc \
246         $(lispsource)language/georgian.elc \
247         $(lispsource)language/khmer.elc \
248         $(lispsource)language/burmese.elc \
249         $(lispsource)register.elc \
250         $(lispsource)replace.elc \
251         $(lispsource)simple.elc \
252         $(lispsource)minibuffer.elc \
253         $(lispsource)startup.elc \
254         $(lispsource)subr.elc \
255         $(lispsource)term/tty-colors.elc \
256         $(lispsource)font-core.elc \
257         $(lispsource)emacs-lisp/syntax.elc \
258         $(lispsource)font-lock.elc \
259         $(lispsource)jit-lock.elc \
260         $(lispsource)textmodes/fill.elc \
261         $(lispsource)textmodes/page.elc \
262         $(lispsource)textmodes/paragraphs.elc \
263         $(lispsource)textmodes/text-mode.elc \
264         $(lispsource)emacs-lisp/timer.elc \
265         $(lispsource)jka-cmpr-hook.elc \
266         $(lispsource)vc/vc-hooks.elc \
267         $(lispsource)vc/ediff-hook.elc \
268         $(lispsource)epa-hook.elc \
269         $(TOOLTIP_SUPPORT) \
270         $(WINNT_SUPPORT) \
271         $(WINDOW_SUPPORT) \
272         $(lispsource)widget.elc \
273         $(lispsource)window.elc \
274         $(lispsource)version.elc
276 # This is needed the first time we build the tree, since temacs.exe
277 # does not exist yet, and the DOC rule needs it to rebuild DOC whenever
278 # Emacs is rebuilt.
279 ../src/$(BLD)/temacs.exe:
280         - mkdir "../src/$(OBJDIR)"
281         - mkdir "../src/$(BLD)"
282         @echo temacs > temacs.exe
283         $(CP) temacs.exe ../src/$(BLD)
284         - $(DEL) temacs.exe
286 DOC           = DOC
287 $(DOC):         stamp_BLD $(BLD)/make-docfile.exe ../src/$(BLD)/temacs.exe $(lisp1) $(lisp2) $(OTHER_PLATFORM_SUPPORT)
288                 - $(DEL) $(DOC)
289                 "$(THISDIR)/$(BLD)/make-docfile" -o $(DOC) -d ../src $(obj)
290                 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1)
291                 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2)
292                 "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(OTHER_PLATFORM_SUPPORT)
293                 $(CP) $(DOC) ../etc/DOC-X
294                 - mkdir "../src/$(OBJDIR)"
295                 - mkdir "../src/$(OBJDIR)/etc"
296                 $(CP) $(DOC) ../src/$(OBJDIR)/etc/DOC-X
298 {$(BLD)}.$(O){$(BLD)}.exe:
299                 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $*.$(O) $(LIBS)
302 # Build the executables
304 all:            $(ALL) $(DOC)
307 # Assuming INSTALL_DIR is defined, build and install emacs in it.
309 INSTALL_FILES = $(ALL)
310 install:        $(INSTALL_FILES)
311                 - mkdir "$(INSTALL_DIR)/bin"
312                 $(CP) $(BLD)/etags.exe $(INSTALL_DIR)/bin
313                 $(CP) $(BLD)/ebrowse.exe $(INSTALL_DIR)/bin
314                 $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin
315                 $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin
316                 $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin
317                 $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin
318                 $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin
319                 $(CP) $(BLD)/profile.exe $(INSTALL_DIR)/bin
320                 - mkdir "$(INSTALL_DIR)/etc"
321                 $(CP) $(DOC) $(INSTALL_DIR)/etc
324 # Maintenance
326 # We used to delete *~ here, but that might inadvertently remove
327 # precious files if it happens to match their short 8+3 aliases.
328 clean:
329                 - $(DEL) DOC* $(COMPILER_TEMP_FILES)
330                 - $(DEL) ctags.c
331                 - $(DEL_TREE) $(OBJDIR)
332                 - $(DEL) stamp_BLD
334 distclean: cleanall
335         - $(DEL) TAGS
336         - $(DEL) Makefile
338 maintainer-clean: distclean
340 cleanall:       clean
341                 - $(DEL_TREE) obj
342                 - $(DEL_TREE) obj-spd
343                 - $(DEL_TREE) oo
344                 - $(DEL_TREE) oo-spd
347 # Headers we would preprocess if we could.
349 ../src/config.h:        ../nt/$(CONFIG_H)
350                         $(DEL) $@
351                         echo $(CONFIG_H) has changed.  Re-run configure.bat.
352                         exit -1
354 ### TAGS ###
356 TAGS: $(BLD)/etags.exe *.c *.h
357         $(BLD)/etags.exe *.c *.h
359 ### DEPENDENCIES ###
361 EMACS_ROOT      = ..
362 LIB_SRC         = .
363 SRC             = $(EMACS_ROOT)/src
364 NT_INC          = $(EMACS_ROOT)/nt/inc
365 GNU_LIB         = $(EMACS_ROOT)/lib
367 MS_W32_H       = $(NT_INC)/ms-w32.h \
368                  $(NT_INC)/sys/stat.h
369 CONF_POST_H    = $(SRC)/conf_post.h \
370                  $(MS_W32_H)
371 CONFIG_H       = $(SRC)/config.h \
372                  $(CONF_POST_H)
373 INTTYPES_H     = $(NT_INC)/inttypes.h \
374                  $(NT_INC)/stdint.h
375 NTLIB_H        = $(LIB_SRC)/ntlib.h \
376                  $(NT_INC)/pwd.h
377 SYSTIME_H      = $(SRC)/systime.h \
378                  $(NT_INC)/sys/time.h \
379                  $(GNU_LIB)/timespec.h
380 SYSWAIT_H      = $(SRC)/syswait.h \
381                  $(NT_INC)/stdbool.h \
382                  $(NT_INC)/sys/wait.h
384 $(BLD)/ctags.$(O) : \
385         $(LIB_SRC)/ctags.c \
386         $(SRC)/regex.h \
387         $(NT_INC)/sys/stat.h \
388         $(NT_INC)/unistd.h \
389         $(GNU_LIB)/c-strcase.h \
390         $(GNU_LIB)/getopt.h \
391         $(CONFIG_H)
393 $(BLD)/ebrowse.$(O) : \
394         $(LIB_SRC)/ebrowse.c \
395         $(GNU_LIB)/getopt.h \
396         $(GNU_LIB)/min-max.h \
397         $(CONFIG_H)
399 $(BLD)/emacsclient.$(O) : \
400         $(LIB_SRC)/emacsclient.c \
401         $(NT_INC)/pwd.h \
402         $(NT_INC)/sys/stat.h \
403         $(NT_INC)/unistd.h \
404         $(GNU_LIB)/getopt.h \
405         $(CONFIG_H)
407 $(BLD)/etags.$(O) : \
408         $(LIB_SRC)/etags.c \
409         $(SRC)/regex.h \
410         $(NT_INC)/sys/stat.h \
411         $(NT_INC)/unistd.h \
412         $(GNU_LIB)/c-strcase.h \
413         $(GNU_LIB)/getopt.h \
414         $(CONFIG_H)
416 $(BLD)/hexl.$(O) : \
417         $(LIB_SRC)/hexl.c \
418         $(CONFIG_H)
420 $(BLD)/make-docfile.$(O) : \
421         $(LIB_SRC)/make-docfile.c \
422         $(NT_INC)/unistd.h \
423         $(CONFIG_H)
425 $(BLD)/movemail.$(O) : \
426         $(LIB_SRC)/movemail.c \
427         $(LIB_SRC)/pop.h \
428         $(NT_INC)/pwd.h \
429         $(NT_INC)/sys/file.h \
430         $(NT_INC)/sys/stat.h \
431         $(NT_INC)/unistd.h \
432         $(GNU_LIB)/getopt.h \
433         $(CONFIG_H) \
434         $(NTLIB_H) \
435         $(SYSWAIT_H)
437 $(BLD)/ntlib.$(O) : \
438         $(LIB_SRC)/ntlib.c \
439         $(NT_INC)/sys/stat.h \
440         $(NTLIB_H)
442 $(BLD)/pop.$(O) : \
443         $(LIB_SRC)/pop.c \
444         $(LIB_SRC)/pop.h \
445         $(NT_INC)/netdb.h \
446         $(NT_INC)/pwd.h \
447         $(NT_INC)/unistd.h \
448         $(GNU_LIB)/min-max.h \
449         $(CONFIG_H) \
450         $(NTLIB_H)
452 $(BLD)/profile.$(O) : \
453         $(LIB_SRC)/profile.c \
454         $(GNU_LIB)/intprops.h \
455         $(CONFIG_H) \
456         $(INTTYPES_H) \
457         $(SYSTIME_H)
459 $(BLD)/regex.$(O) : \
460         $(SRC)/regex.c \
461         $(SRC)/regex.h \
462         $(NT_INC)/stdbool.h \
463         $(NT_INC)/unistd.h \
464         $(CONFIG_H)
466 $(BLD)/test-distrib.$(O) : \
467         $(LIB_SRC)/test-distrib.c \
468         $(NT_INC)/unistd.h \
469         $(CONFIG_H)
471 # The following dependencies are for supporting parallel builds, where
472 # we must make sure $(BLD) exists before any compilation starts.
474 $(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O): stamp_BLD
476 $(BLD)/test-distrib.$(O) $(MOVEMAILOBJS): stamp_BLD
478 $(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD
480 $(BLD)/ebrowse.$(O) $(BLD)/ctags.$(O) $(BLD)/profile.$(O): stamp_BLD