Commit | Line | Data |
---|---|---|
efdeeb2b GV |
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 | ||
43648015 | 24 | # Set INSTALL_DIR to be the directory into which you want emacs installed. |
efdeeb2b | 25 | # |
43648015 GV |
26 | !ifndef INSTALL_DIR |
27 | INSTALL_DIR = C:\emacs | |
28 | !endif | |
efdeeb2b | 29 | |
d51bca10 RS |
30 | # Define MSVCNT11 to be nonzero if you are using the MSVCNT 1.1 environment. |
31 | # MSVCNT11 = 1 | |
32 | MSVCNT11 = 0 | |
33 | ||
efdeeb2b GV |
34 | # |
35 | # END CONFIGURATION | |
36 | # | |
43648015 GV |
37 | |
38 | # Check that the INCLUDE and LIB environment variables are set. | |
39 | # | |
40 | !ifndef INCLUDE | |
41 | !error The INCLUDE environment variable needs to be set. | |
42 | !endif | |
43 | !ifndef LIB | |
44 | !error The LIB environment variable needs to be set. | |
45 | !endif | |
46 | ||
47 | # Determine the architecture we're running on. | |
48 | # Define ARCH for our purposes; | |
49 | # Define CPU for use by ntwin32.mak; | |
50 | # Define CONFIG_H to the appropriate config.h for the system; | |
efdeeb2b | 51 | # |
43648015 GV |
52 | !ifdef PROCESSOR_ARCHITECTURE |
53 | # We're on Windows NT | |
54 | CPU = $(PROCESSOR_ARCHITECTURE) | |
55 | CONFIG_H = config.nt | |
56 | OS_TYPE = winnt | |
57 | ! if "$(PROCESSOR_ARCHITECTURE)" == "x86" | |
58 | ARCH = i386 | |
59 | CPU = i386 | |
60 | ! else | |
61 | ! if "$(PROCESSOR_ARCHITECTURE)" == "MIPS" | |
62 | ARCH = mips | |
63 | ! else | |
64 | ! if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" | |
65 | ARCH = alpha | |
66 | ! else | |
67 | ! if "$(PROCESSOR_ARCHITECTURE)" == "PPC" | |
68 | ARCH = ppc | |
69 | ! else | |
70 | !error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)" | |
71 | ! endif | |
72 | ! endif | |
73 | ! endif | |
74 | ! endif | |
75 | !else | |
76 | # We're on Windows 95 | |
77 | ARCH = i386 | |
78 | CPU = i386 | |
79 | CONFIG_H = config.w95 | |
80 | OS_TYPE = win95 | |
81 | !endif | |
82 | ||
83 | # Include ntwin32.mak. So far, this file seems to be supported by every | |
84 | # Microsoft compiler on NT and Win95 and properly defines the executable | |
85 | # names and libraries necessary to build Emacs. I do not have access | |
86 | # to any other vendor compilers, so I do not know if they supply this | |
87 | # file, too. For now I'll assume that they do. | |
88 | # | |
89 | !include <ntwin32.mak> | |
efdeeb2b | 90 | |
43648015 GV |
91 | # Using cvtres is necessary on NT 3.10 and doesn't hurt on later platforms. |
92 | CVTRES = cvtres.exe | |
93 | AR = $(implib) | |
94 | # The assignment $(CC) = $(cc) fails even though variables are case sensitive. | |
95 | LINK_TMP = $(link) | |
96 | LINK = $(LINK_TMP) | |
97 | CC_TMP = $(cc) | |
98 | CC = $(CC_TMP) | |
99 | ||
100 | # advapi32.lib is left off of $(baselibs) on NT 3.10 | |
101 | !if "$(baselibs)" == "kernel32.lib " | |
102 | ADVAPI32 = advapi32.lib | |
103 | !else | |
104 | ADVAPI32 = | |
105 | !endif | |
106 | ||
107 | # Older ntwin32.mak files do not define libc; do it for them. | |
108 | !ifndef libc | |
109 | libc = libc.lib | |
110 | !endif | |
111 | ||
112 | # The base libraries for compiling Emacs on NT. With MSVC, this should | |
113 | # include oldnames.lib. | |
d51bca10 RS |
114 | !if $(MSVCNT11) |
115 | BASE_LIBS = $(libc) $(baselibs) oldnames.lib | |
116 | !else | |
43648015 | 117 | BASE_LIBS = $(libc) $(baselibs) |
d51bca10 | 118 | !endif |
43648015 GV |
119 | |
120 | # We want any debugging info in the executable. | |
121 | !if "$(LINK)" == "link32" | |
122 | SYS_LDFLAGS = | |
123 | !else | |
124 | SYS_LDFLAGS = -pdb:none -release -incremental:no | |
125 | !endif | |
126 | ||
127 | INC = -I. | |
d51bca10 RS |
128 | CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) |
129 | !if $(MSVCNT11) | |
130 | CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl | |
131 | !else | |
132 | CFLAGS = $(CFLAGS_COMMON) | |
133 | !endif | |
efdeeb2b GV |
134 | |
135 | OBJDIR = obj | |
43648015 | 136 | $(OBJDIR):; -mkdir $(OBJDIR) |
efdeeb2b GV |
137 | BLD = $(OBJDIR)\$(ARCH) |
138 | $(BLD): $(OBJDIR) | |
139 | -mkdir $(BLD) | |
140 | ||
141 | CP = copy | |
142 | CP_DIR = xcopy /fried | |
143 | ||
144 | # This is completely braindamaged, but it's the only routine known to be there | |
145 | DEL_TREE = echo y | rmdir /s | |
146 | ||
01b96d5c GV |
147 | # The location of the icon file |
148 | EMACS_ICON_PATH = ..\nt\emacs.ico | |
149 | ||
150 | # Lets us add icons to the GNU Emacs folder | |
151 | ADDPM = ..\nt\$(BLD)\addpm.exe | |
152 | ||
43648015 | 153 | !if "$(ARCH)" == "i386" |
efdeeb2b | 154 | ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -G3d -Zi -Od |
43648015 | 155 | ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) |
efdeeb2b | 156 | |
43648015 GV |
157 | !else |
158 | !if "$(ARCH)" == "mips" | |
159 | ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0 | |
160 | ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) | |
efdeeb2b | 161 | |
43648015 GV |
162 | !else |
163 | !if "$(ARCH)" == "alpha" | |
efdeeb2b | 164 | ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -D__stdcall= -D__cdecl= |
43648015 GV |
165 | ARCH_LDFLAGS = -align:0x2000 $(SYS_LDFLAGS) |
166 | ||
167 | !else | |
168 | !if "$(ARCH)" == "ppc" | |
169 | # These flags are a guess...if they don't work, please send me mail. | |
170 | ARCH_CFLAGS = -D_PPC_=1 -c -Ze -Zi -W2 -Od | |
171 | ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) | |
172 | ||
173 | !else | |
174 | !ERROR Unknown architecture type "$(ARCH)". | |
175 | !endif | |
176 | !endif | |
177 | !endif | |
178 | !endif |