]> code.delx.au - gnu-emacs/blobdiff - src/makefile.nt
Add #pragma alloca.
[gnu-emacs] / src / makefile.nt
index f59f32c22dcbe63a64137b1317fd03e8d3dc7565..d452d942a997b4ce044c5f44435dfa67bc7f3f8f 100644 (file)
 #
 !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.
@@ -35,12 +41,20 @@ EMACS           = $(BLD)\emacs.exe
 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
@@ -71,12 +85,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           \
@@ -109,14 +121,27 @@ 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.
@@ -127,17 +152,17 @@ all:            $(BLD) $(EMACS)
 # 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
 
@@ -153,16 +178,19 @@ $(EMACS):       $(PREPARED_HEADERS) $(DOC) $(TEMACS)
 #
 # 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 
@@ -172,6 +200,18 @@ $(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.
@@ -189,7 +229,7 @@ install:        all
 #
 # Maintenance
 # 
-clean:;         - del /q *~
+clean:;         - del *~ *.pdb config.h paths.h
                - $(DEL_TREE) deleted
                - $(DEL_TREE) obj
 
@@ -197,7 +237,9 @@ clean:;         - del /q *~
 # 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 ###
@@ -253,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 \
@@ -558,7 +601,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 \
@@ -789,6 +833,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 \
@@ -809,7 +862,8 @@ $(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 \
@@ -925,6 +979,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 \
@@ -969,3 +1030,77 @@ $(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)\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