#
!include ..\nt\makefile.def
+SUBSYSTEM=console
+
#
# 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
+# 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
$(BLD)\insdel.obj \
$(BLD)\keyboard.obj \
$(BLD)\keymap.obj \
- $(BLD)\lastfile.obj \
$(BLD)\lread.obj \
$(BLD)\macros.obj \
$(BLD)\marker.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
+ user32.lib \
+ mpr.lib
#
# Build the executable and dump it.
#
DOC = obj\etc\DOC-X
$(DOC):; cd ..\lib-src
- - del /q DOC-X
+ - $(DEL) DOC-X
$(MAKE) -f makefile.nt all
cd ..\src
#
emacs: $(EMACS)
$(EMACS): $(PREPARED_HEADERS) $(DOC) $(TEMACS)
-!if "$(OS_TYPE)" == "win95"
- move $(BLD)\temacs.exe $(BLD)\emacs.exe
-!else
cd $(BLD)
temacs.exe -batch -l loadup dump
cd ..\..
-!endif
#
# The undumped executable
#
temacs: $(BLD) $(TEMACS)
-$(TEMACS): $(TLIB1) $(TLIB2) $(TOBJ) $(TRES)
+$(TEMACS): $(TLIB1) $(TLIB2) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES)
$(LINK) -out:$(TEMACS) $(LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS)
#
#
$(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 *~ *.pdb config.h
+clean:; - $(DEL) *~ *.pdb config.h paths.h
- $(DEL_TREE) deleted
- $(DEL_TREE) obj
# 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 ntheap.obj unexnt.obj
cd ..\..
$(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
$(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)\nt.obj : \
$(SRC)\nt.c \
+ $(SRC)\nt.h \
$(SRC)\s\windowsnt.h \
$(SRC)\m\intel386.h \
$(SRC)\config.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)\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