(message_dolog): Give correct args to
[bpt/emacs.git] / src / makefile.nt
index 27fed2d..f6eebf1 100644 (file)
@@ -1,4 +1,4 @@
-#  Makefile for GNU Emacs on Windows NT
+#  Makefile for GNU Emacs on the Microsoft W32 API.
 #  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
@@ -16,8 +16,9 @@
 #  GNU General Public License for more details.
 #  
 #  You should have received a copy of the GNU General Public License
-#  along with GNU Emacs; see the file COPYING.  If not, write to
-#  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+#  along with GNU Emacs; see the file COPYING.  If not, write to the
+#  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+#  Boston, MA 02111-1307, USA.
 #
 
 # 
@@ -25,6 +26,8 @@
 #
 !include ..\nt\makefile.def
 
+SUBSYSTEM=console
+
 #
 # HAVE_CONFIG_H is required by some generic gnu sources stuck into
 # the emacs source tree.
@@ -33,9 +36,15 @@ LOCAL_FLAGS     = -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I..\nt\inc
 
 EMACS           = $(BLD)\emacs.exe
 TEMACS          = $(BLD)\temacs.exe
+TLIB0           = $(BLD)\temacs0.lib
 TLIB1           = $(BLD)\temacs1.lib
 TLIB2           = $(BLD)\temacs2.lib
-TOBJ            = $(BLD)\emacs.obj
+!IFDEF NTGUI
+TLIBW32         = $(BLD)\temacw32.lib
+!ELSE
+TLIBW32                =
+!ENDIF
+TOBJ            = $(BLD)\firstfile.obj
 !if $(MSVCNT11)
 TRES           = $(BLD)\emacs.res
 !else
@@ -43,12 +52,19 @@ 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 
+# see comments in allocate_heap in w32heap.c before changing any of the
+# -stack, -heap, or -base settings.
+LINK_FLAGS      = $(ARCH_LDFLAGS) -stack:0x00800000 -heap:0x00100000 -base:0x01000000 -debug:full -pdb:$(BLD)\temacs.pdb -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
 # command line space when we link them into a library.
 #
+# Put emacs.obj in a separate lib, since we need to have firstfile.obj
+# as the "main" object file when linking.
+#
+OBJ0 =  $(BLD)\emacs.obj
+
 OBJ1 =  $(BLD)\abbrev.obj       \
        $(BLD)\alloc.obj        \
        $(BLD)\alloca.obj       \
@@ -80,11 +96,11 @@ OBJ1 =  $(BLD)\abbrev.obj       \
        $(BLD)\minibuf.obj      \
        $(BLD)\mocklisp.obj
 
-OBJ2 =  $(BLD)\nt.obj           \
-       $(BLD)\ntheap.obj       \
-       $(BLD)\ntinevt.obj      \
-       $(BLD)\ntproc.obj       \
-       $(BLD)\ntterm.obj       \
+OBJ2 =  $(BLD)\w32.obj           \
+       $(BLD)\w32heap.obj       \
+       $(BLD)\w32inevt.obj      \
+       $(BLD)\w32proc.obj       \
+       $(BLD)\w32console.obj       \
        $(BLD)\print.obj        \
        $(BLD)\process.obj      \
        $(BLD)\regex.obj        \
@@ -96,7 +112,7 @@ OBJ2 =  $(BLD)\nt.obj           \
        $(BLD)\termcap.obj      \
        $(BLD)\tparam.obj       \
        $(BLD)\undo.obj         \
-       $(BLD)\unexnt.obj       \
+       $(BLD)\unexw32.obj       \
        $(BLD)\window.obj       \
        $(BLD)\xdisp.obj        \
        $(BLD)\casetab.obj      \
@@ -108,14 +124,37 @@ OBJ2 =  $(BLD)\nt.obj           \
        $(BLD)\textprop.obj     \
        $(BLD)\vm-limit.obj     \
        $(BLD)\region-cache.obj \
-       $(BLD)\strftime.obj
-
-LIBS =  $(TLIB1)       \
+       $(BLD)\strftime.obj     \
+       $(BLD)\charset.obj      \
+       $(BLD)\coding.obj       \
+       $(BLD)\category.obj     \
+       $(BLD)\ccl.obj          \
+       $(BLD)\fontset.obj
+
+WIN32OBJ = $(BLD)\w32term.obj  \
+          $(BLD)\w32xfns.obj   \
+          $(BLD)\w32fns.obj    \
+          $(BLD)\w32faces.obj  \
+          $(BLD)\w32select.obj \
+          $(BLD)\w32menu.obj   \
+          $(BLD)\w32reg.obj
+
+LIBS =  $(TLIB0)       \
+       $(TLIB1)        \
        $(TLIB2)        \
+!IFDEF NTGUI
+       $(TLIBW32)      \
+!ENDIF
        $(TLASTLIB)     \
+!IFDEF NTGUI
+       gdi32.lib       \
+       comdlg32.lib    \
+!ENDIF
+#      libcmt.lib      \
        $(BASE_LIBS)    \
        $(ADVAPI32)     \
-       user32.lib
+       user32.lib      \
+       mpr.lib
 
 #
 # Build the executable and dump it.
@@ -134,9 +173,9 @@ paths.h:    ..\nt\paths.h
 #
 # Make sure we have the DOC file in the right place.
 #
-DOC            = obj\etc\DOC-X
+DOC            = $(OBJDIR)\etc\DOC-X
 $(DOC):;       cd ..\lib-src 
-               - del /q DOC-X
+               - $(DEL) DOC-X
                $(MAKE) -f makefile.nt all
                cd ..\src
 
@@ -147,13 +186,14 @@ emacs:          $(EMACS)
 $(EMACS):       $(PREPARED_HEADERS) $(DOC) $(TEMACS)
                cd $(BLD)
                temacs.exe -batch -l loadup dump
+               copy temacs.map emacs.map
                cd ..\..
 
 #
 # The undumped executable
 #
 temacs:         $(BLD) $(TEMACS)
-$(TEMACS):      $(TLIB1) $(TLIB2) $(TLASTLIB) $(TOBJ) $(TRES)
+$(TEMACS):      $(TLIB0) $(TLIB1) $(TLIB2) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES)
                $(LINK) -out:$(TEMACS) $(LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS)
 
 #
@@ -170,17 +210,24 @@ $(TRES):  ..\nt\emacs.rc
 # Build the library.  Split up the build into two phases...otherwise we 
 # run out of command line space.
 #
+$(TLIB0):       $(OBJ0)
+               @- $(AR) -out:$@ $**
 $(TLIB1):       $(OBJ1)
                @- $(AR) -out:$@ $**
 $(TLIB2):      $(OBJ2)
                @- $(AR) -out:$@ $**
+!IFDEF NTGUI
+$(TLIBW32):    $(WIN32OBJ)
+               @- $(AR) -out:$@ $**
+!ENDIF
+
 #
-# Place lastfile.obj in it's own library so that it can be loaded after
+# 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.
+# the end of Emacs' data section portably across compilers and systems.
 #
 $(TLASTLIB):   $(BLD)\lastfile.obj
-               @- $(AR) -out:$@ $**
+               @- $(AR) -out:$@ $**
 
 #
 # Object files.
@@ -198,16 +245,16 @@ install:        all
 #
 # Maintenance
 # 
-clean:;         - del /q *~ *.pdb config.h
+clean:;         - $(DEL) *~ *.pdb config.h paths.h
                - $(DEL_TREE) deleted
-               - $(DEL_TREE) obj
+               - $(DEL_TREE) $(OBJDIR)
 
 #
 # 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
+               - $(DEL) callproc.obj data.obj dispnew.obj doc.obj editfns.obj emacs.obj lread.obj process.obj sysdep.obj term.obj w32heap.obj unexw32.obj
                cd ..\..
 
 
@@ -218,7 +265,7 @@ SRC         = .
 
 $(BLD)\abbrev.obj : \
        $(SRC)\abbrev.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -228,7 +275,7 @@ $(BLD)\abbrev.obj : \
 
 $(BLD)\alloc.obj : \
        $(SRC)\alloc.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -243,10 +290,10 @@ $(BLD)\alloc.obj : \
 
 $(BLD)\alloca.obj : \
        $(SRC)\alloca.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
-       $(SRC)\s\windowsnt.h \
+       $(SRC)\s\ms-w32.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h \
        $(SRC)\blockinput.h
@@ -254,7 +301,7 @@ $(BLD)\alloca.obj : \
 $(BLD)\buffer.obj : \
        $(SRC)\buffer.c \
        $(EMACS_ROOT)\nt\inc\sys\param.h \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -269,12 +316,18 @@ $(BLD)\buffer.obj : \
 
 $(BLD)\bytecode.obj : \
        $(SRC)\bytecode.c \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
        $(SRC)\buffer.h \
        $(SRC)\syntax.h
 
 $(BLD)\callint.obj : \
        $(SRC)\callint.c \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
        $(SRC)\buffer.h \
        $(SRC)\commands.h \
@@ -284,7 +337,7 @@ $(BLD)\callint.obj : \
 
 $(BLD)\callproc.obj : \
        $(SRC)\callproc.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\msdos.h \
@@ -300,7 +353,7 @@ $(BLD)\callproc.obj : \
 
 $(BLD)\casefiddle.obj : \
        $(SRC)\casefiddle.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -311,7 +364,7 @@ $(BLD)\casefiddle.obj : \
 
 $(BLD)\casetab.obj : \
        $(SRC)\casetab.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -319,7 +372,7 @@ $(BLD)\casetab.obj : \
 
 $(BLD)\cm.obj : \
        $(SRC)\cm.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\cm.h \
@@ -327,7 +380,7 @@ $(BLD)\cm.obj : \
 
 $(BLD)\cmds.obj : \
        $(SRC)\cmds.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -337,7 +390,7 @@ $(BLD)\cmds.obj : \
 
 $(BLD)\data.obj : \
        $(SRC)\data.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -347,7 +400,7 @@ $(BLD)\data.obj : \
 
 $(BLD)\dired.obj : \
        $(SRC)\dired.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\vmsdir.h \
@@ -359,7 +412,7 @@ $(BLD)\dired.obj : \
 
 $(BLD)\dispnew.obj : \
        $(SRC)\dispnew.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -378,13 +431,14 @@ $(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
 
 $(BLD)\doc.obj : \
        $(SRC)\doc.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(EMACS_ROOT)\nt\inc\sys\file.h \
@@ -394,13 +448,13 @@ $(BLD)\doc.obj : \
 
 $(BLD)\doprnt.obj : \
        $(SRC)\doprnt.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h
 
 $(BLD)\dosfns.obj : \
        $(SRC)\dosfns.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -413,7 +467,7 @@ $(BLD)\dosfns.obj : \
 
 $(BLD)\editfns.obj : \
        $(SRC)\editfns.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\uaf.h \
@@ -429,7 +483,7 @@ $(BLD)\editfns.obj : \
 
 $(BLD)\emacs.obj : \
        $(SRC)\emacs.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -444,7 +498,7 @@ $(BLD)\emacs.obj : \
 
 $(BLD)\eval.obj : \
        $(SRC)\eval.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -454,7 +508,7 @@ $(BLD)\eval.obj : \
 
 $(BLD)\fileio.obj : \
        $(SRC)\fileio.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\uaf.h \
@@ -474,7 +528,7 @@ $(BLD)\fileio.obj : \
 
 $(BLD)\filelock.obj : \
        $(SRC)\filelock.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\uaf.h \
@@ -489,16 +543,22 @@ $(BLD)\filelock.obj : \
 
 $(BLD)\filemode.obj : \
        $(SRC)\filemode.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
-       $(SRC)\s\windowsnt.h \
+       $(SRC)\s\ms-w32.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h
 
+$(BLD)\firstfile.obj : \
+       $(SRC)\firstfile.c \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h
+
 $(BLD)\floatfns.obj : \
        $(SRC)\floatfns.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -506,7 +566,7 @@ $(BLD)\floatfns.obj : \
 
 $(BLD)\fns.obj : \
        $(SRC)\fns.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -518,7 +578,7 @@ $(BLD)\fns.obj : \
 
 $(BLD)\frame.obj : \
        $(SRC)\frame.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -532,17 +592,17 @@ $(BLD)\frame.obj : \
 $(BLD)\getloadavg.obj : \
        $(SRC)\getloadavg.c \
        $(EMACS_ROOT)\nt\inc\sys\param.h \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
-       $(SRC)\s\windowsnt.h \
+       $(SRC)\s\ms-w32.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h \
        $(EMACS_ROOT)\nt\inc\sys\file.h
 
 $(BLD)\gmalloc.obj : \
        $(SRC)\gmalloc.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(EMACS_ROOT)\nt\inc\sys\param.h \
@@ -551,14 +611,14 @@ $(BLD)\gmalloc.obj : \
 
 $(BLD)\hftctl.obj : \
        $(SRC)\hftctl.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(EMACS_ROOT)\nt\inc\sys\ioctl.h
 
 $(BLD)\indent.obj : \
        $(SRC)\indent.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -575,7 +635,7 @@ $(BLD)\indent.obj : \
 
 $(BLD)\insdel.obj : \
        $(SRC)\insdel.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -587,7 +647,7 @@ $(BLD)\insdel.obj : \
 
 $(BLD)\intervals.obj : \
        $(SRC)\intervals.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -599,7 +659,7 @@ $(BLD)\intervals.obj : \
 
 $(BLD)\keyboard.obj : \
        $(SRC)\keyboard.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\termchar.h \
@@ -621,13 +681,14 @@ $(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
 
 $(BLD)\keymap.obj : \
        $(SRC)\keymap.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -638,11 +699,14 @@ $(BLD)\keymap.obj : \
        $(SRC)\blockinput.h
 
 $(BLD)\lastfile.obj : \
-       $(SRC)\lastfile.c
+       $(SRC)\lastfile.c \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h
 
 $(BLD)\lread.obj : \
        $(SRC)\lread.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(EMACS_ROOT)\nt\inc\sys\file.h \
@@ -656,7 +720,7 @@ $(BLD)\lread.obj : \
 
 $(BLD)\macros.obj : \
        $(SRC)\macros.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -667,7 +731,7 @@ $(BLD)\macros.obj : \
 
 $(BLD)\marker.obj : \
        $(SRC)\marker.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -675,7 +739,7 @@ $(BLD)\marker.obj : \
 
 $(BLD)\minibuf.obj : \
        $(SRC)\minibuf.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -688,28 +752,32 @@ $(BLD)\minibuf.obj : \
 
 $(BLD)\mocklisp.obj : \
        $(SRC)\mocklisp.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
        $(SRC)\buffer.h
 
-$(BLD)\nt.obj : \
-       $(SRC)\nt.c \
-       $(SRC)\s\windowsnt.h \
+$(BLD)\w32.obj : \
+       $(SRC)\w32.c \
+       $(SRC)\w32.h \
+       $(SRC)\s\ms-w32.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h \
        $(SRC)\lisp.h \
        $(EMACS_ROOT)\nt\inc\pwd.h \
-       $(SRC)\ntheap.h
+       $(SRC)\w32heap.h
 
-$(BLD)\ntheap.obj : \
-       $(SRC)\ntheap.c \
-       $(SRC)\ntheap.h
+$(BLD)\w32heap.obj : \
+       $(SRC)\w32heap.c \
+       $(SRC)\w32heap.h \
+       $(SRC)\s\ms-w32.h \
+       $(SRC)\m\intel386.h \
+       $(SRC)\config.h
 
-$(BLD)\ntinevt.obj : \
-       $(SRC)\ntinevt.c \
-       $(SRC)\s\windowsnt.h \
+$(BLD)\w32inevt.obj : \
+       $(SRC)\w32inevt.c \
+       $(SRC)\s\ms-w32.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h \
        $(SRC)\lisp.h \
@@ -717,33 +785,34 @@ $(BLD)\ntinevt.obj : \
        $(SRC)\blockinput.h \
        $(SRC)\termhooks.h
 
-$(BLD)\ntproc.obj : \
-       $(SRC)\ntproc.c \
-       $(SRC)\s\windowsnt.h \
+$(BLD)\w32proc.obj : \
+       $(SRC)\w32proc.c \
+       $(SRC)\s\ms-w32.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h \
        $(SRC)\lisp.h \
-       $(SRC)\nt.h \
+       $(SRC)\w32.h \
+       $(SRC)\w32heap.h \
        $(SRC)\vmstime.h \
        $(SRC)\systime.h
 
-$(BLD)\ntterm.obj : \
-       $(SRC)\ntterm.c \
-       $(SRC)\s\windowsnt.h \
+$(BLD)\w32console.obj : \
+       $(SRC)\w32console.c \
+       $(SRC)\s\ms-w32.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h \
        $(SRC)\lisp.h \
        $(SRC)\frame.h \
        $(SRC)\disptab.h \
        $(SRC)\termhooks.h \
-       $(SRC)\ntinevt.h
+       $(SRC)\w32inevt.h
 
 $(BLD)\prefix-args.obj : \
        $(SRC)\prefix-args.c
 
 $(BLD)\print.obj : \
        $(SRC)\print.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -757,7 +826,7 @@ $(BLD)\print.obj : \
 
 $(BLD)\process.obj : \
        $(SRC)\process.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(EMACS_ROOT)\nt\inc\sys\ioctl.h \
@@ -779,11 +848,11 @@ $(BLD)\process.obj : \
 
 $(BLD)\ralloc.obj : \
        $(SRC)\ralloc.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
-       $(SRC)\s\windowsnt.h \
+       $(SRC)\s\ms-w32.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h \
        $(EMACS_ROOT)\nt\inc\sys\param.h \
@@ -791,10 +860,10 @@ $(BLD)\ralloc.obj : \
 
 $(BLD)\regex.obj : \
        $(SRC)\regex.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
-       $(SRC)\s\windowsnt.h \
+       $(SRC)\s\ms-w32.h \
        $(SRC)\m\intel386.h \
        $(SRC)\config.h \
        $(SRC)\lisp.h \
@@ -804,7 +873,7 @@ $(BLD)\regex.obj : \
 
 $(BLD)\region-cache.obj : \
        $(SRC)\region-cache.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -813,7 +882,7 @@ $(BLD)\region-cache.obj : \
 
 $(BLD)\scroll.obj : \
        $(SRC)\scroll.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\termchar.h \
@@ -823,7 +892,7 @@ $(BLD)\scroll.obj : \
 
 $(BLD)\search.obj : \
        $(SRC)\search.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -836,14 +905,13 @@ $(BLD)\search.obj : \
 
 $(BLD)\strftime.obj : \
        $(SRC)\strftime.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.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 \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -853,7 +921,7 @@ $(BLD)\sunfns.obj : \
 
 $(BLD)\syntax.obj : \
        $(SRC)\syntax.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -863,7 +931,7 @@ $(BLD)\syntax.obj : \
 
 $(BLD)\sysdep.obj : \
        $(SRC)\sysdep.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -896,7 +964,7 @@ $(BLD)\sysdep.obj : \
 
 $(BLD)\term.obj : \
        $(SRC)\term.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\termchar.h \
@@ -910,7 +978,7 @@ $(BLD)\term.obj : \
 
 $(BLD)\termcap.obj : \
        $(SRC)\termcap.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(EMACS_ROOT)\nt\inc\sys\file.h
@@ -920,7 +988,7 @@ $(BLD)\terminfo.obj : \
 
 $(BLD)\textprop.obj : \
        $(SRC)\textprop.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -931,33 +999,36 @@ $(BLD)\textprop.obj : \
 
 $(BLD)\tparam.obj : \
        $(SRC)\tparam.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h
 
 $(BLD)\undo.obj : \
        $(SRC)\undo.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
        $(SRC)\buffer.h \
        $(SRC)\commands.h
 
-$(BLD)\unexnt.obj : \
-       $(SRC)\unexnt.c \
-       $(SRC)\ntheap.h
+$(BLD)\unexw32.obj : \
+       $(SRC)\unexw32.c \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32heap.h
 
 $(BLD)\vm-limit.obj : \
        $(SRC)\vm-limit.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.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 \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -969,7 +1040,7 @@ $(BLD)\widget.obj : \
 
 $(BLD)\window.obj : \
        $(SRC)\window.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -984,7 +1055,7 @@ $(BLD)\window.obj : \
 
 $(BLD)\xdisp.obj : \
        $(SRC)\xdisp.c \
-       $(EMACS_ROOT)\src\s\windowsnt.h \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
        $(EMACS_ROOT)\src\m\intel386.h \
        $(EMACS_ROOT)\src\config.h \
        $(SRC)\lisp.h \
@@ -999,3 +1070,105 @@ $(BLD)\xdisp.obj : \
        $(SRC)\termhooks.h \
        $(SRC)\dispextern.h \
        $(SRC)\intervals.h
+
+$(BLD)\w32faces.obj: \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32faces.c \
+       $(SRC)\lisp.h \
+       $(SRC)\w32term.h \
+       $(SRC)\w32gui.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\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32fns.c \
+       $(SRC)\lisp.h \
+       $(SRC)\w32term.h \
+       $(SRC)\w32gui.h \
+       $(SRC)\frame.h \
+       $(SRC)\window.h \
+       $(SRC)\buffer.h \
+       $(SRC)\dispextern.h \
+       $(SRC)\keyboard.h \
+       $(SRC)\blockinput.h \
+       $(SRC)\paths.h \
+       $(SRC)\w32heap.h \
+       $(SRC)\termhooks.h
+
+$(BLD)\w32menu.obj: \
+       $(EMACS_ROOT)\src\s\ms-w32.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\ms-w32.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)\w32gui.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\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32select.c \
+       $(SRC)\lisp.h \
+       $(SRC)\w32term.h \
+       $(SRC)\w32gui.h \
+       $(SRC)\dispextern.h \
+       $(SRC)\frame.h \
+       $(SRC)\blockinput.h
+
+$(BLD)\w32reg.obj: \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32reg.c \
+       $(SRC)\lisp.h \
+       $(SRC)\w32term.h \
+       $(SRC)\w32gui.h \
+       $(SRC)\blockinput.h
+
+$(BLD)\w32xfns.obj: \
+       $(EMACS_ROOT)\src\s\ms-w32.h \
+       $(EMACS_ROOT)\src\m\intel386.h \
+       $(EMACS_ROOT)\src\config.h \
+       $(SRC)\w32xfns.c \
+       $(SRC)\lisp.h \
+       $(SRC)\w32term.h \
+       $(SRC)\w32.h \
+       $(SRC)\frame.h \
+       $(SRC)\blockinput.h