]> code.delx.au - gnu-emacs/blob - nt/makefile.def
(compilation-handle-exit): New function, broken out of compilation-sentinel.
[gnu-emacs] / nt / makefile.def
1 #
2 # Makefile definition file for building GNU Emacs on Windows NT
3 #
4 # GNU Emacs is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8 #
9 # GNU Emacs is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Emacs; see the file COPYING. If not, write to
16 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
17 #
18 # Geoff Voelker (voelker@cs.washington.edu) 9-6-94
19
20 #
21 # BEGIN CONFIGURATION
22 #
23
24 # Define the following to build the GUI version
25 #
26 NTGUI=1
27
28 # Set INSTALL_DIR to be the directory into which you want emacs installed.
29 #
30 !ifndef INSTALL_DIR
31 INSTALL_DIR = C:\emacs
32 !endif
33
34 # Define MSVCNT11 to be nonzero if you are using the MSVCNT 1.1 environment.
35 # MSVCNT11 = 1
36 MSVCNT11 = 0
37
38 #
39 # END CONFIGURATION
40 #
41
42 # Check that the INCLUDE and LIB environment variables are set.
43 #
44 !ifndef INCLUDE
45 !error The INCLUDE environment variable needs to be set.
46 !endif
47 !ifndef LIB
48 !error The LIB environment variable needs to be set.
49 !endif
50
51 # Determine the architecture we're running on.
52 # Define ARCH for our purposes;
53 # Define CPU for use by ntwin32.mak;
54 # Define CONFIG_H to the appropriate config.h for the system;
55 #
56 !ifdef PROCESSOR_ARCHITECTURE
57 # We're on Windows NT
58 CPU = $(PROCESSOR_ARCHITECTURE)
59 CONFIG_H = config.nt
60 OS_TYPE = winnt
61 ! if "$(PROCESSOR_ARCHITECTURE)" == "x86"
62 ARCH = i386
63 CPU = i386
64 ! else
65 ! if "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
66 ARCH = mips
67 ! else
68 ! if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
69 ARCH = alpha
70 ! else
71 ! if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
72 ARCH = ppc
73 ! else
74 !error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)"
75 ! endif
76 ! endif
77 ! endif
78 ! endif
79 !else
80 # We're on Windows 95
81 ARCH = i386
82 CPU = i386
83 CONFIG_H = config.w95
84 OS_TYPE = win95
85 !endif
86
87 # Include ntwin32.mak. So far, this file seems to be supported by every
88 # Microsoft compiler on NT and Win95 and properly defines the executable
89 # names and libraries necessary to build Emacs. I do not have access
90 # to any other vendor compilers, so I do not know if they supply this
91 # file, too. For now I'll assume that they do.
92 #
93 !include <ntwin32.mak>
94
95 # Using cvtres is necessary on NT 3.10 and doesn't hurt on later platforms.
96 CVTRES = cvtres.exe
97 AR = $(implib)
98 # The assignment $(CC) = $(cc) fails even though variables are case sensitive.
99 LINK_TMP = $(link)
100 LINK = $(LINK_TMP)
101 CC_TMP = $(cc)
102 CC = $(CC_TMP)
103
104 # advapi32.lib is left off of $(baselibs) on NT 3.10
105 !if "$(baselibs)" == "kernel32.lib "
106 ADVAPI32 = advapi32.lib
107 !else
108 ADVAPI32 =
109 !endif
110
111 # Older ntwin32.mak files do not define libc; do it for them.
112 !ifndef libc
113 libc = libc.lib
114 !endif
115
116 # The base libraries for compiling Emacs on NT. With MSVC, this should
117 # include oldnames.lib.
118 !if $(MSVCNT11)
119 BASE_LIBS = $(libc) $(baselibs) oldnames.lib
120 !else
121 BASE_LIBS = $(libc) $(baselibs)
122 !endif
123
124 # We want any debugging info in the executable.
125 !if "$(LINK)" == "link32"
126 SYS_LDFLAGS =
127 !else
128 SYS_LDFLAGS = -pdb:none -release -incremental:no
129 !endif
130
131 INC = -I.
132 CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH)
133 !if $(MSVCNT11)
134 CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl
135 !else
136 CFLAGS = $(CFLAGS_COMMON)
137 !endif
138 !ifdef NTGUI
139 CFLAGS = $(CFLAGS) -DHAVE_NTGUI=1
140 !endif
141
142 OBJDIR = obj
143 $(OBJDIR):; -mkdir $(OBJDIR)
144 BLD = $(OBJDIR)\$(ARCH)
145 $(BLD): $(OBJDIR)
146 -mkdir $(BLD)
147
148 CP = copy
149 CP_DIR = xcopy /f/r/i/e/d
150
151 # This is completely braindamaged, but it's the only routine known to be there
152 DEL_TREE = echo y | rmdir /s
153
154 # The location of the icon file
155 EMACS_ICON_PATH = ..\nt\emacs.ico
156
157 # Lets us add icons to the GNU Emacs folder
158 ADDPM = ..\nt\$(BLD)\addpm.exe
159
160 !if "$(ARCH)" == "i386"
161 ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -G3d -Zi -Od
162 ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
163
164 !else
165 !if "$(ARCH)" == "mips"
166 ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0
167 ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
168
169 !else
170 !if "$(ARCH)" == "alpha"
171 ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -D__stdcall= -D__cdecl=
172 ARCH_LDFLAGS = -align:0x2000 $(SYS_LDFLAGS)
173
174 !else
175 !if "$(ARCH)" == "ppc"
176 # These flags are a guess...if they don't work, please send me mail.
177 ARCH_CFLAGS = -D_PPC_=1 -c -Ze -Zi -W2 -Od
178 ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS)
179
180 !else
181 !ERROR Unknown architecture type "$(ARCH)".
182 !endif
183 !endif
184 !endif
185 !endif