]> code.delx.au - gnu-emacs/blobdiff - src/makefile.nt
(x_connection_closed): Add newline when printing error message on stderr.
[gnu-emacs] / src / makefile.nt
index d0ad9fa3debafc852e39a2ddcd20fd0ff9007da1..9feca95df0ce131a9e8530da985cacfea65794b7 100644 (file)
@@ -1,7 +1,7 @@
 #  Makefile for GNU Emacs on Windows NT
-#  Copyright (c) 1992, 1993, 1994 Free Software Foundation, Inc.
-#   Tim Fleehart (apollo@online.com)
-#   Geoff Voelker (voelker@cs.washington.edu)
+#  Copyright (c) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+#   Tim Fleehart (apollo@online.com)            17-Apr-92
+#   Geoff Voelker (voelker@cs.washington.edu)   11-20-93
 #
 #  This file is part of GNU Emacs.
 #  
 #
 !include ..\nt\makefile.def
 
+SUBSYSTEM=console
+
 #
 # HAVE_CONFIG_H is required by some generic gnu sources stuck into
 # the emacs source tree.
 #
-LOCAL_FLAGS     = -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I..\nt\inc -Zi
+LOCAL_FLAGS     = -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I..\nt\inc
 
 EMACS           = $(BLD)\emacs.exe
 TEMACS          = $(BLD)\temacs.exe
-TLIB            = $(BLD)\temacs.lib
+TLIB1           = $(BLD)\temacs1.lib
+TLIB2           = $(BLD)\temacs2.lib
+!IFDEF NTGUI
+TLIBW32         = $(BLD)\temacw32.lib
+!ELSE
+TLIBW32                =
+!ENDIF
 TOBJ            = $(BLD)\emacs.obj
+!if $(MSVCNT11)
+TRES           = $(BLD)\emacs.res
+!else
+TRES           = $(BLD)\emacs.rbj
+!endif
+TLASTLIB       = $(BLD)\lastfile.lib
 
-LINK_FLAGS      = $(ARCH_LDFLAGS) -stack:0x1000000 -base:0xD00000 -debug:full -debugtype:cv -machine:$(ARCH) -subsystem:console -entry:_start 
-
-# -debug:PARTIAL -debugtype:COFF
+# see comments in allocate_heap in ntheap.c before changing any of the
+# -stack, -heap, or -base settings.
+LINK_FLAGS      = $(ARCH_LDFLAGS) -stack:0x00800000 -heap:0x00100000 -base:0x01000000 -debug:full -debugtype:cv -machine:$(ARCH) -subsystem:$(SUBSYSTEM) -entry:_start -map:$(BLD)\temacs.map
 
 #
 # Split up the objects into two sets so that we don't run out of
@@ -69,12 +83,10 @@ OBJ1 =  $(BLD)\abbrev.obj       \
        $(BLD)\insdel.obj       \
        $(BLD)\keyboard.obj     \
        $(BLD)\keymap.obj       \
-       $(BLD)\lastfile.obj     \
        $(BLD)\lread.obj        \
        $(BLD)\macros.obj       \
        $(BLD)\marker.obj       \
        $(BLD)\minibuf.obj      \
-       $(BLD)\xfaces.obj       \
        $(BLD)\mocklisp.obj
 
 OBJ2 =  $(BLD)\nt.obj           \
@@ -103,13 +115,33 @@ OBJ2 =  $(BLD)\nt.obj           \
        $(BLD)\intervals.obj    \
        $(BLD)\ralloc.obj       \
        $(BLD)\textprop.obj     \
-       $(BLD)\vm-limit.obj
-
-LIBS =  $(TLIB)                         \
-       $(SYS_LIB_DIR)\setargv.obj      \
-       $(SYS_LIB_DIR)\kernel32.lib     \
-       $(SYS_LIB_DIR)\advapi32.lib     \
-       $(SYS_LIB_DIR)\libc.lib
+       $(BLD)\vm-limit.obj     \
+       $(BLD)\region-cache.obj \
+       $(BLD)\strftime.obj
+
+WIN32OBJ = $(BLD)\w32term.obj  \
+          $(BLD)\w32xfns.obj   \
+          $(BLD)\w32fns.obj    \
+          $(BLD)\w32faces.obj  \
+          $(BLD)\w32select.obj \
+          $(BLD)\w32menu.obj   \
+          $(BLD)\w32reg.obj
+
+LIBS =  $(TLIB1)       \
+       $(TLIB2)        \
+!IFDEF NTGUI
+       $(TLIBW32)      \
+!ENDIF
+       $(TLASTLIB)     \
+!IFDEF NTGUI
+       gdi32.lib       \
+       comdlg32.lib    \
+!ENDIF
+#      libcmt.lib      \
+       $(BASE_LIBS)    \
+       $(ADVAPI32)     \
+       user32.lib      \
+       mpr.lib
 
 #
 # Build the executable and dump it.
@@ -120,16 +152,25 @@ all:            $(BLD) $(EMACS)
 # Headers we would preprocess if we could.
 #
 PREPARED_HEADERS = config.h paths.h
-config.h:      ..\nt\src\config.h
-               cp ..\nt\src\config.h config.h
-paths.h:       ..\nt\src\paths.h
-               cp ..\nt\src\paths.h paths.h
+config.h:      ..\nt\$(CONFIG_H)
+               $(CP) $** $@
+paths.h:       ..\nt\paths.h
+               $(CP) $** $@
+
+#
+# Make sure we have the DOC file in the right place.
+#
+DOC            = obj\etc\DOC-X
+$(DOC):;       cd ..\lib-src 
+               - $(DEL) DOC-X
+               $(MAKE) -f makefile.nt all
+               cd ..\src
 
 #
 # The dumped executable
 #
 emacs:          $(EMACS)
-$(EMACS):       $(PREPARED_HEADERS) $(TEMACS)
+$(EMACS):       $(PREPARED_HEADERS) $(DOC) $(TEMACS)
                cd $(BLD)
                temacs.exe -batch -l loadup dump
                cd ..\..
@@ -138,16 +179,39 @@ $(EMACS):       $(PREPARED_HEADERS) $(TEMACS)
 # The undumped executable
 #
 temacs:         $(BLD) $(TEMACS)
-$(TEMACS):      $(LIBS) $(TOBJ)
-               $(LINK) -out:$(TEMACS) $(LINK_FLAGS) $(TOBJ) $(LIBS)
+$(TEMACS):      $(TLIB1) $(TLIB2) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES)
+               $(LINK) -out:$(TEMACS) $(LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS)
+
+#
+# The resource file.  NT 3.10 requires the use of cvtres; even though
+# it is not necessary on later versions, it is still ok to use it.
+#
+$(TRES):       ..\nt\emacs.rc
+               $(RC) -i..\nt -Fo$(BLD)\emacs.res $**
+!if !$(MSVCNT11)
+               $(CVTRES) -r -$(ARCH) -o $@ $(BLD)\emacs.res
+!endif
 
 #
 # Build the library.  Split up the build into two phases...otherwise we 
 # run out of command line space.
 #
-$(TLIB):        $(OBJ1) $(OBJ2)
-               @- $(AR) -out:$(TLIB) $(OBJ1)
-               @- $(AR) -out:$(TLIB) $(TLIB) $(OBJ2)
+$(TLIB1):       $(OBJ1)
+               @- $(AR) -out:$@ $**
+$(TLIB2):      $(OBJ2)
+               @- $(AR) -out:$@ $**
+!IFDEF NTGUI
+$(TLIBW32):    $(WIN32OBJ)
+               @- $(AR) -out:$@ $**
+!ENDIF
+
+#
+# Place lastfile.obj in its own library so that it can be loaded after
+# the source libraries but before any system libraries.  Doing so defines
+# the end of Emacs' data section portably across compilers and systems.
+#
+$(TLASTLIB):   $(BLD)\lastfile.obj
+               @- $(AR) -out:$@ $**
 
 #
 # Object files.
@@ -165,15 +229,17 @@ install:        all
 #
 # Maintenance
 # 
-clean:;         - del /q *~
-               - delnode /q deleted
-               - delnode /q obj
+clean:;         - $(DEL) *~ *.pdb config.h paths.h
+               - $(DEL_TREE) deleted
+               - $(DEL_TREE) obj
 
 #
 # These files are the ones that compile conditionally on CANNOT_DUMP...
 # this target is mostly used for debugging.
 #
-cleandump:;     cd $(BLD) && - del callproc.obj data.obj dispnew.obj doc.obj editfns.obj emacs.obj lread.obj process.obj sysdep.obj term.obj ntheap.obj unexnt.obj
+cleandump:;     cd $(BLD)
+               - $(DEL) callproc.obj data.obj dispnew.obj doc.obj editfns.obj emacs.obj lread.obj process.obj sysdep.obj term.obj ntheap.obj unexnt.obj
+               cd ..\..
 
 
 ### DEPENDENCIES ###
@@ -229,7 +295,8 @@ $(BLD)\buffer.obj : \
        $(SRC)\commands.h \
        $(SRC)\buffer.h \
        $(SRC)\indent.h \
-       $(SRC)\blockinput.h
+       $(SRC)\blockinput.h \
+       $(SRC)\region-cache.h
 
 $(BLD)\bytecode.obj : \
        $(SRC)\bytecode.c \
@@ -342,6 +409,7 @@ $(BLD)\dispnew.obj : \
        $(EMACS_ROOT)\nt\inc\sys\ioctl.h \
        $(EMACS_ROOT)\nt\inc\sys\file.h \
        $(SRC)\systty.h \
+       $(SRC)\w32term.h \
        $(SRC)\xterm.h \
        $(SRC)\vmstime.h \
        $(SRC)\systime.h
@@ -534,7 +602,8 @@ $(BLD)\indent.obj : \
        $(SRC)\termopts.h \
        $(SRC)\disptab.h \
        $(SRC)\dispextern.h \
-       $(SRC)\intervals.h
+       $(SRC)\intervals.h \
+       $(SRC)\region-cache.h
 
 $(BLD)\insdel.obj : \
        $(SRC)\insdel.c \
@@ -584,6 +653,7 @@ $(BLD)\keyboard.obj : \
        $(EMACS_ROOT)\nt\inc\sys\ioctl.h \
        $(EMACS_ROOT)\nt\inc\sys\file.h \
        $(SRC)\systty.h \
+       $(SRC)\w32term.h \
        $(SRC)\xterm.h \
        $(SRC)\vmstime.h \
        $(SRC)\systime.h
@@ -659,6 +729,7 @@ $(BLD)\mocklisp.obj : \
 
 $(BLD)\nt.obj : \
        $(SRC)\nt.c \
+       $(SRC)\nt.h \
        $(SRC)\s\windowsnt.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h \
@@ -765,6 +836,15 @@ $(BLD)\regex.obj : \
        $(SRC)\syntax.h \
        $(SRC)\regex.h
 
+$(BLD)\region-cache.obj : \
+       $(SRC)\region-cache.c \
+       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\lisp.h \
+       $(SRC)\buffer.h \
+       $(SRC)\region-cache.h
+
 $(BLD)\scroll.obj : \
        $(SRC)\scroll.c \
        $(EMACS_ROOT)\src\s\windowsnt.h \
@@ -785,7 +865,15 @@ $(BLD)\search.obj : \
        $(SRC)\buffer.h \
        $(SRC)\commands.h \
        $(SRC)\blockinput.h \
-       $(SRC)\regex.h
+       $(SRC)\regex.h \
+       $(SRC)\region-cache.h
+
+$(BLD)\strftime.obj : \
+       $(SRC)\strftime.c \
+       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h
+       $(CC) $(CFLAGS) -Dstrftime=emacs_strftime -Fo$@ strftime.c
 
 $(BLD)\sunfns.obj : \
        $(SRC)\sunfns.c \
@@ -894,6 +982,13 @@ $(BLD)\unexnt.obj : \
        $(SRC)\unexnt.c \
        $(SRC)\ntheap.h
 
+$(BLD)\vm-limit.obj : \
+       $(SRC)\vm-limit.c \
+       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\mem-limits.h     
+
 $(BLD)\widget.obj : \
        $(SRC)\widget.c \
        $(EMACS_ROOT)\src\s\windowsnt.h \
@@ -938,3 +1033,94 @@ $(BLD)\xdisp.obj : \
        $(SRC)\termhooks.h \
        $(SRC)\dispextern.h \
        $(SRC)\intervals.h
+
+$(BLD)\w32faces.obj: \
+       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32faces.c \
+       $(SRC)\lisp.h \
+       $(SRC)\w32term.h \
+       $(SRC)\win32.h \
+       $(SRC)\buffer.h \
+       $(SRC)\dispextern.h \
+       $(SRC)\frame.h \
+       $(SRC)\blockinput.h \
+       $(SRC)\window.h \
+       $(SRC)\intervals.h
+
+$(BLD)\w32fns.obj: \
+       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32fns.c \
+       $(SRC)\lisp.h \
+       $(SRC)\w32term.h \
+       $(SRC)\win32.h \
+       $(SRC)\frame.h \
+       $(SRC)\window.h \
+       $(SRC)\buffer.h \
+       $(SRC)\dispextern.h \
+       $(SRC)\keyboard.h \
+       $(SRC)\blockinput.h \
+       $(SRC)\paths.h \
+       $(SRC)\ntheap.h \
+       $(SRC)\termhooks.h
+
+$(BLD)\w32menu.obj: \
+       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32menu.c \
+       $(SRC)\lisp.h \
+       $(SRC)\termhooks.h \
+       $(SRC)\frame.h \
+       $(SRC)\window.h \
+       $(SRC)\keyboard.h \
+       $(SRC)\blockinput.h \
+       $(SRC)\buffer.h
+
+$(BLD)\w32term.obj: \
+       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32term.c \
+       $(SRC)\lisp.h \
+       $(SRC)\blockinput.h \
+       $(SRC)\w32term.h \
+       $(SRC)\win32.h \
+       $(SRC)\systty.h \
+       $(SRC)\systime.h \
+       $(SRC)\frame.h \
+       $(SRC)\dispextern.h \
+       $(SRC)\termhooks.h \
+       $(SRC)\termopts.h \
+       $(SRC)\termchar.h \
+       $(SRC)\gnu.h \
+       $(SRC)\disptab.h \
+       $(SRC)\buffer.h \
+       $(SRC)\window.h \
+       $(SRC)\keyboard.h \
+       $(SRC)\intervals.h
+
+$(BLD)\w32select.obj: \
+       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32select.c \
+       $(SRC)\lisp.h \
+       $(SRC)\w32term.h \
+       $(SRC)\win32.h \
+       $(SRC)\dispextern.h \
+       $(SRC)\frame.h \
+       $(SRC)\blockinput.h
+
+$(BLD)\w32reg.obj: \
+       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32reg.c \
+       $(SRC)\lisp.h \
+       $(SRC)\w32term.h \
+       $(SRC)\win32.h \
+       $(SRC)\blockinput.h