]> code.delx.au - gnu-emacs/blobdiff - nt/makefile.def
Add "-*- makefile -*-" mode tag.
[gnu-emacs] / nt / makefile.def
index a7de40fd2099b71d399af2a60dc9c4361f7b067e..e5ca430cc39f857958f6bb5739a908dc95ffc099 100644 (file)
@@ -1,16 +1,16 @@
+#  -*- Makefile -*- definition file for building GNU Emacs on Windows NT
+#  Copyright (c) 1994-2001 Free Software Foundation, Inc.
 #
-#  Makefile definition file for building GNU Emacs on Windows NT
-#  
 #  GNU Emacs is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2, or (at your option)
 #  any later version.
-#  
+#
 #  GNU Emacs is distributed in the hope that it will be useful,
 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #  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, Inc., 59 Temple Place - Suite 330,
@@ -34,12 +34,24 @@ INSTALL_DIR     = C:\emacs
 
 # Define MSVCNT11 to be nonzero if you are using the MSVCNT 1.1 environment.
 # MSVCNT11     = 1
+!ifndef MSVCNT11
 MSVCNT11        = 0
+!endif
 
 #
 # END CONFIGURATION
 #
 
+#
+# Allow detection of builds with MSVC 5 or later
+#
+_NMAKE_VER_5=162
+_NMAKE_VER_4=0
+
+!IFNDEF _NMAKE_VER
+_NMAKE_VER=$(_NMAKE_VER_4)
+!ENDIF
+
 # Check that the INCLUDE and LIB environment variables are set.
 #
 !ifndef INCLUDE
@@ -50,7 +62,7 @@ MSVCNT11        = 0
 !endif
 
 # Determine the architecture we're running on.
-# Define ARCH for our purposes; 
+# Define ARCH for our purposes;
 # Define CPU for use by ntwin32.mak;
 # Define CONFIG_H to the appropriate config.h for the system;
 #
@@ -58,7 +70,7 @@ MSVCNT11        = 0
 # We're on Windows NT
 CPU            = $(PROCESSOR_ARCHITECTURE)
 CONFIG_H       = config.nt
-OS_TYPE                = winnt
+OS_TYPE                = windowsnt
 ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
 ARCH           = i386
 CPU            = i386
@@ -81,14 +93,14 @@ ARCH                = ppc
 # We're on Windows 95
 ARCH           = i386
 CPU            = i386
-CONFIG_H       = config.w95
-OS_TYPE                = win95
+CONFIG_H       = config.nt
+OS_TYPE                = windows95
 !endif
 
 # Include ntwin32.mak.  So far, this file seems to be supported by every
-# Microsoft compiler on NT and Win95 and properly defines the executable
-# names and libraries necessary to build Emacs.  I do not have access 
-# to any other vendor compilers, so I do not know if they supply this 
+# Microsoft compiler on NT and Windows 95 and properly defines the executable
+# names and libraries necessary to build Emacs.  I do not have access
+# to any other vendor compilers, so I do not know if they supply this
 # file, too.  For now I'll assume that they do.
 #
 !include <ntwin32.mak>
@@ -119,47 +131,62 @@ libc              = libc.lib
 !if $(MSVCNT11)
 BASE_LIBS      = $(libc) $(baselibs) oldnames.lib
 !else
-BASE_LIBS      = $(libc) $(baselibs)
+BASE_LIBS      = $(libc) $(baselibs) -nodefaultlib:oldnames.lib
 !endif
 
 # We want any debugging info in the executable.
 !if "$(LINK)" == "link32"
-SYS_LDFLAGS    = 
+SYS_LDFLAGS    = -nologo
 !else
-SYS_LDFLAGS    = -pdb:none -release -incremental:no
+SYS_LDFLAGS    = -nologo -release -incremental:no -version:3.10
 !endif
 
+# Tag the executables to run out of the swapfile when execute off CD or network shares
+SYS_LDFLAGS = $(SYS_LDFLAGS) -swaprun:cd -swaprun:net
+
 INC             = -I.
-CFLAGS_COMMON  = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH)
+!if "$(BUILD_TYPE)" == "spd"
+CFLAGS_COMMON  = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb
+!else
+CFLAGS_COMMON  = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb -DEMACSDEBUG
+!endif
 !if $(MSVCNT11)
 CFLAGS          = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl
 !else
-CFLAGS          = $(CFLAGS_COMMON) 
-!endif
-!ifdef NTGUI
-CFLAGS          = $(CFLAGS) -DHAVE_NTGUI=1
+CFLAGS          = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl
 !endif
 
+!ifdef BUILD_TYPE
+OBJDIR          = obj-$(BUILD_TYPE)
+!else
 OBJDIR          = obj
+!endif
 $(OBJDIR):;    -mkdir $(OBJDIR)
 BLD             = $(OBJDIR)\$(ARCH)
 $(BLD):         $(OBJDIR)
                -mkdir $(BLD)
 
 CP             = copy
-CP_DIR         = xcopy /f/r/i/e/d
-
-# This is completely braindamaged, but it's the only routine known to be there
-DEL_TREE       = echo y | rmdir /s
+CP_DIR         = xcopy /f/r/i/e/d/k
 
-# The location of the icon file
-EMACS_ICON_PATH = ..\nt\emacs.ico
+!if "$(OS_TYPE)" == "windows95"
+DEL            = deltree /y
+DEL_TREE       = deltree /y
+!else
+DEL            = del
+# NT better way of killing a deltree
+DEL_TREE       = rd /s/q
+!endif
 
 # Lets us add icons to the GNU Emacs folder
 ADDPM          = ..\nt\$(BLD)\addpm.exe
 
 !if "$(ARCH)" == "i386"
-ARCH_CFLAGS     = -nologo -D_X86_=1 -c -Zel -W2 -H63 -G3d -Zi -Od
+!if "$(BUILD_TYPE)" == "spd"
+ARCH_CFLAGS     = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -G6dF -Zi -Zp8
+!else
+ARCH_CFLAGS     = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Od -G3d -Zi -Zp8
+!endif
 ARCH_LDFLAGS   = -align:0x1000 $(SYS_LDFLAGS)
 
 !else
@@ -169,7 +196,11 @@ ARCH_LDFLAGS       = -align:0x1000 $(SYS_LDFLAGS)
 
 !else
 !if "$(ARCH)" == "alpha"
-ARCH_CFLAGS     = -D_ALPHA_=1 -c -Ze -Zi -W2 -D__stdcall= -D__cdecl=
+!if "$(BUILD_TYPE)" == "spd"
+ARCH_CFLAGS     = -D_ALPHA_=1 -c -Ze -Zi -W2 -Od -D__stdcall= -D__cdecl=
+!else
+ARCH_CFLAGS     = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl=
+!endif
 ARCH_LDFLAGS   = -align:0x2000 $(SYS_LDFLAGS)
 
 !else
@@ -184,3 +215,17 @@ ARCH_LDFLAGS       = -align:0x1000 $(SYS_LDFLAGS)
 !endif
 !endif
 !endif
+
+#
+# If the compiler supports compiling multiple .c files to .o files at
+# one time, use this feature.
+#
+!IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)")
+.c{$(BLD)}.obj:
+               $(CC) $(CFLAGS) -Fo$(BLD)\ $<
+!ELSE
+.c{$(BLD)}.obj::
+               $(CC) $(CFLAGS) -Fo$(BLD)\ $<
+!ENDIF
+
+# arch-tag: a8aa26d5-5f28-4263-b42a-6f91acb7d824