#
!include ..\nt\makefile.def
+!IFDEF NTGUI
+SUBSYSTEM=windows
+!ELSE
+SUBSYSTEM=console
+!ENDIF
+
#
# HAVE_CONFIG_H is required by some generic gnu sources stuck into
# the emacs source tree.
TEMACS = $(BLD)\temacs.exe
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
+LINK_FLAGS = $(ARCH_LDFLAGS) -stack:0x1000000 -base:0xD00000 -debug:full -debugtype:cv -machine:$(ARCH) -subsystem:$(SUBSYSTEM) -entry:_start -map:$(BLD)\temacs.map -map
#
# Split up the objects into two sets so that we don't run out of
$(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 \
$(BLD)\region-cache.obj \
$(BLD)\strftime.obj
-LIBS = $(TLIB1) \
- $(TLIB2) \
- $(SYS_LIB_DIR)\setargv.obj \
- $(SYS_LIB_DIR)\kernel32.lib \
- $(SYS_LIB_DIR)\advapi32.lib \
- $(SYS_LIB_DIR)\user32.lib \
- $(SYS_LIB_DIR)\libc.lib \
- $(COMPAT_LIB)
+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
+ $(BASE_LIBS) \
+ $(ADVAPI32) \
+ user32.lib
#
# Build the executable and dump it.
# Headers we would preprocess if we could.
#
PREPARED_HEADERS = config.h paths.h
-config.h: ..\nt\config.h
- cp ..\nt\config.h config.h
+config.h: ..\nt\$(CONFIG_H)
+ $(CP) $** $@
paths.h: ..\nt\paths.h
- cp ..\nt\paths.h paths.h
+ $(CP) $** $@
#
# Make sure we have the DOC file in the right place.
#
DOC = obj\etc\DOC-X
$(DOC):; cd ..\lib-src
- - del /q DOC-X
+ - del DOC-X
$(MAKE) -f makefile.nt all
cd ..\src
#
# The undumped executable
#
-temacs: $(TEMACS)
-$(TEMACS): $(BLD) $(TLIB1) $(TLIB2) $(TOBJ) $(TRES)
+temacs: $(BLD) $(TEMACS)
+$(TEMACS): $(TLIB1) $(TLIB2) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES)
$(LINK) -out:$(TEMACS) $(LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS)
#
-# The resource file.
+# 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
@- $(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.
#
# Maintenance
#
-clean:; - del /q *~
+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 ###
$(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 \
$(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 \
$(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 \
$(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 \
$(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 \
$(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)\dispextern.h \
+ $(SRC)\frame.h \
+ $(SRC)\w32term.h \
+ $(SRC)\win32.h \
+ $(SRC)\buffer.h \
+ $(SRC)\blockinput.h \
+ $(SRC)\window.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)\dispextern.h \
+ $(SRC)\frame.h \
+ $(SRC)\w32term.h \
+ $(SRC)\win32.h \
+ $(SRC)\buffer.h \
+ $(SRC)\blockinput.h \
+ $(SRC)\window.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)\dispextern.h \
+ $(SRC)\frame.h \
+ $(SRC)\w32term.h \
+ $(SRC)\win32.h \
+ $(SRC)\buffer.h \
+ $(SRC)\blockinput.h \
+ $(SRC)\window.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)\dispextern.h \
+ $(SRC)\frame.h \
+ $(SRC)\w32term.h \
+ $(SRC)\win32.h \
+ $(SRC)\buffer.h \
+ $(SRC)\blockinput.h \
+ $(SRC)\window.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)\dispextern.h \
+ $(SRC)\frame.h \
+ $(SRC)\w32term.h \
+ $(SRC)\win32.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)\dispextern.h \
+ $(SRC)\frame.h \
+ $(SRC)\w32term.h \
+ $(SRC)\win32.h \
+ $(SRC)\blockinput.h