Commit | Line | Data |
---|---|---|
efdeeb2b GV |
1 | # |
2 | # Top level makefile for building GNU Emacs on Windows NT | |
3 | # | |
4 | # This file is part of GNU Emacs. | |
5 | # | |
6 | # GNU Emacs is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2, or (at your option) | |
9 | # any later version. | |
10 | # | |
11 | # GNU Emacs is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with GNU Emacs; see the file COPYING. If not, write to | |
bf2b146b EN |
18 | # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | # Boston, MA 02111-1307, USA. | |
efdeeb2b GV |
20 | # |
21 | # Geoff Voelker (voelker@cs.washington.edu) 11-20-93 | |
22 | # 9-6-94 | |
23 | !include makefile.def | |
24 | ||
32c0fe80 | 25 | ALL = addpm ddeclient runemacs cmdproxy addsection |
b1dd4ab3 GV |
26 | !if $(MSVCNT11) |
27 | TRES = $(BLD)\emacs.res | |
28 | !else | |
29 | TRES = $(BLD)\emacs.rbj | |
30 | !endif | |
ac11713e | 31 | |
9c148db6 | 32 | !IF ($(_NMAKE_VER) == $(_NMAKE_VER_4)) |
191f57e9 | 33 | .c{$(BLD)}.obj: |
c654fd9e GV |
34 | $(CC) $(CFLAGS) -Fo$(OBJDIR)\i386\ $< |
35 | !ELSE | |
36 | .c{$(BLD)}.obj:: | |
37 | $(CC) $(CFLAGS) -Fo$(OBJDIR)\i386\ $< | |
38 | !ENDIF | |
191f57e9 | 39 | |
ac11713e | 40 | addpm: $(BLD) $(BLD)\addpm.exe |
ac11713e | 41 | $(BLD)\addpm.obj: addpm.c |
191f57e9 | 42 | $(BLD)\addpm.exe: $(BLD)\addpm.obj |
9478941d | 43 | $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \ |
bcfb775c | 44 | $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib |
ac11713e | 45 | |
89e840e5 GV |
46 | ddeclient: $(BLD) $(BLD)\ddeclient.exe |
47 | $(BLD)\ddeclient.obj: ddeclient.c | |
48 | $(BLD)\ddeclient.exe: $(BLD)\ddeclient.obj | |
49 | $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \ | |
50 | $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib | |
51 | ||
c781a8e8 GV |
52 | cmdproxy: $(BLD) $(BLD)\cmdproxy.exe |
53 | $(BLD)\cmdproxy.obj: cmdproxy.c | |
54 | $(BLD)\cmdproxy.exe: $(BLD)\cmdproxy.obj | |
55 | $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \ | |
56 | $(SYS_LDFLAGS) $** $(BASE_LIBS) user32.lib | |
57 | ||
32c0fe80 AI |
58 | addsection: $(BLD) $(BLD)\addsection.exe |
59 | $(BLD)\addsection.obj: addsection.c | |
60 | $(BLD)\addsection.exe: $(BLD)\addsection.obj | |
61 | $(LINK) -debug:full -out:$@ -subsystem:console -entry:mainCRTStartup \ | |
62 | $(SYS_LDFLAGS) $** $(BASE_LIBS) user32.lib | |
63 | ||
b1dd4ab3 GV |
64 | # |
65 | # The resource file. NT 3.10 requires the use of cvtres; even though | |
66 | # it is not necessary on later versions, it is still ok to use it. | |
67 | # | |
68 | $(TRES): emacs.rc | |
69 | $(RC) -Fo$(BLD)\emacs.res $** | |
70 | !if !$(MSVCNT11) | |
71 | $(CVTRES) -r -$(ARCH) -o $@ $(BLD)\emacs.res | |
72 | !endif | |
73 | ||
74 | runemacs: $(BLD) $(BLD)\runemacs.exe | |
75 | $(BLD)\runemacs.obj: runemacs.c | |
76 | $(BLD)\runemacs.exe: $(BLD)\runemacs.obj $(TRES) | |
77 | $(LINK) -out:$@ -subsystem:windows -entry:WinMainCRTStartup \ | |
78 | $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib | |
79 | ||
9097b6b2 GV |
80 | # Since Windows 95 does not support multiple commands on one command line |
81 | # (e.g., in for loops), we cannot use for loops any more. | |
82 | # SUBDIRS = lib-src src lisp | |
efdeeb2b GV |
83 | |
84 | # | |
85 | # Build emacs | |
86 | # | |
9097b6b2 | 87 | BUILD_CMD = $(MAKE) -f makefile.nt all |
ac11713e GV |
88 | all: $(BLD) $(ALL) |
89 | cd ..\lib-src | |
9097b6b2 GV |
90 | $(BUILD_CMD) |
91 | cd ..\src | |
92 | $(BUILD_CMD) | |
93 | cd ..\lisp | |
94 | $(BUILD_CMD) | |
95 | cd ..\nt | |
96 | ||
05102411 GV |
97 | $(INSTALL_DIR)\bin: |
98 | - mkdir $(INSTALL_DIR)\bin | |
efdeeb2b | 99 | |
ea444b40 GV |
100 | $(INSTALL_DIR)\bin\emacs.bat: emacs.bat.in |
101 | echo @echo off > $@ | |
ac11713e | 102 | echo REM !!! Warning: This file automatically generated !!! >> emacs.bat |
ea444b40 GV |
103 | echo set emacs_dir=$(INSTALL_DIR)>> $@ |
104 | type emacs.bat.in >> $@ | |
ac11713e | 105 | |
ea444b40 GV |
106 | $(INSTALL_DIR)\bin\debug.bat: debug.bat.in |
107 | echo @echo off > $@ | |
07b0b264 | 108 | echo REM !!! Warning: This file automatically generated !!! >> debug.bat |
ea444b40 GV |
109 | echo set emacs_dir=$(INSTALL_DIR)>> $@ |
110 | type debug.bat.in >> $@ | |
111 | ||
05102411 GV |
112 | batch_files: $(INSTALL_DIR)\bin \ |
113 | $(INSTALL_DIR)\bin\emacs.bat \ | |
114 | $(INSTALL_DIR)\bin\debug.bat | |
07b0b264 | 115 | |
efdeeb2b GV |
116 | # |
117 | # Build and install emacs in INSTALL_DIR | |
118 | # | |
9097b6b2 | 119 | INSTALL_CMD = $(MAKE) -f makefile.nt install |
ea444b40 | 120 | install: all batch_files |
efdeeb2b | 121 | - mkdir $(INSTALL_DIR) |
9097b6b2 GV |
122 | cd ..\lib-src |
123 | $(INSTALL_CMD) | |
124 | cd ..\src | |
125 | $(INSTALL_CMD) | |
126 | cd ..\lisp | |
127 | $(INSTALL_CMD) | |
128 | cd ..\nt | |
b1dd4ab3 | 129 | - $(CP) $(BLD)\addpm.exe $(INSTALL_DIR)\bin |
89e840e5 | 130 | - $(CP) $(BLD)\ddeclient.exe $(INSTALL_DIR)\bin |
c781a8e8 | 131 | - $(CP) $(BLD)\cmdproxy.exe $(INSTALL_DIR)\bin |
b1dd4ab3 | 132 | - $(CP) $(BLD)\runemacs.exe $(INSTALL_DIR)\bin |
32c0fe80 | 133 | - $(CP) ..\lib-src\fns-*.el $(INSTALL_DIR)\bin |
bcfb775c | 134 | - $(ADDPM) $(INSTALL_DIR) |
2e17c871 GV |
135 | - $(DEL) ..\same-dir.tst |
136 | - $(DEL) $(INSTALL_DIR)\same-dir.tst | |
bcfb775c GV |
137 | echo SameDirTest > $(INSTALL_DIR)\same-dir.tst |
138 | if not exist ..\same-dir.tst $(MAKE) -f makefile.nt real_install | |
2e17c871 GV |
139 | - $(DEL) ..\same-dir.tst |
140 | - $(DEL) $(INSTALL_DIR)\same-dir.tst | |
efdeeb2b GV |
141 | |
142 | # | |
143 | # This installs executables from ..\bin into the installation directory | |
144 | # without building anything. | |
145 | # | |
ea444b40 | 146 | fast_install: batch_files |
efdeeb2b GV |
147 | - mkdir $(INSTALL_DIR)\data |
148 | $(CP) ..\lib-src\DOC $(INSTALL_DIR)\etc | |
149 | - mkdir $(INSTALL_DIR)\bin | |
b1dd4ab3 GV |
150 | - $(CP) $(BLD)\addpm.exe $(INSTALL_DIR)\bin |
151 | - $(CP) $(BLD)\runemacs.exe $(INSTALL_DIR)\bin | |
2e17c871 GV |
152 | - $(DEL) ..\same-dir.tst |
153 | - $(DEL) $(INSTALL_DIR)\same-dir.tst | |
bcfb775c GV |
154 | echo SameDirTest > $(INSTALL_DIR)\same-dir.tst |
155 | if not exist ..\same-dir.tst $(CP) ..\bin\emacs.exe $(INSTALL_DIR)\bin | |
156 | if not exist ..\same-dir.tst $(CP) ..\bin\etags.exe $(INSTALL_DIR)\bin | |
157 | if not exist ..\same-dir.tst $(CP) ..\bin\ctags.exe $(INSTALL_DIR)\bin | |
158 | if not exist ..\same-dir.tst nmake -f $(MAKE) real_install | |
2e17c871 GV |
159 | - $(DEL) ..\same-dir.tst |
160 | - $(DEL) $(INSTALL_DIR)\same-dir.tst | |
efdeeb2b GV |
161 | |
162 | real_install: | |
2e17c871 GV |
163 | - $(DEL) ..\same-dir.tst |
164 | - $(DEL) $(INSTALL_DIR)\same-dir.tst | |
bcfb775c | 165 | echo SameDirTest > $(INSTALL_DIR)\same-dir.tst |
efdeeb2b GV |
166 | - mkdir $(INSTALL_DIR)\etc |
167 | - mkdir $(INSTALL_DIR)\info | |
168 | - mkdir $(INSTALL_DIR)\lock | |
169 | - mkdir $(INSTALL_DIR)\data | |
7d122d47 | 170 | - mkdir $(INSTALL_DIR)\site-lisp |
bcfb775c GV |
171 | if not exist ..\same-dir.tst $(CP_DIR) ..\etc $(INSTALL_DIR)\etc |
172 | if not exist ..\same-dir.tst $(CP_DIR) ..\info $(INSTALL_DIR)\info | |
2e17c871 GV |
173 | - $(DEL) ..\same-dir.tst |
174 | - $(DEL) $(INSTALL_DIR)\same-dir.tst | |
efdeeb2b GV |
175 | |
176 | # | |
177 | # Maintenance | |
178 | # | |
9097b6b2 | 179 | CLEAN_CMD = $(MAKE) -f makefile.nt clean |
2e17c871 | 180 | clean:; - $(DEL) *~ *.pdb |
22270f17 GV |
181 | - $(DEL) *.orig |
182 | - $(DEL) *.rej | |
183 | - $(DEL) *.crlf | |
efdeeb2b | 184 | - $(DEL_TREE) deleted |
22270f17 GV |
185 | - $(DEL_TREE) obj |
186 | - $(DEL_TREE) obj-spd | |
efdeeb2b | 187 | - $(DEL_TREE) ..\bin |
2e17c871 GV |
188 | - $(DEL) ..\etc\DOC ..\etc\DOC-X |
189 | - $(DEL) emacs.bat | |
07b0b264 | 190 | - $(DEL) debug.bat |
9097b6b2 GV |
191 | cd ..\lib-src |
192 | $(CLEAN_CMD) | |
193 | cd ..\src | |
194 | $(CLEAN_CMD) | |
195 | cd ..\lisp | |
196 | $(CLEAN_CMD) | |
197 | cd ..\nt |