Commit | Line | Data |
68dc0745 |
1 | # |
2 | # Makefile to build perl on Windowns NT using Microsoft NMAKE. |
3 | # |
4 | # |
5 | # This is set up to build a perl.exe that runs off a shared library |
6 | # (perl.dll). Also makes individual DLLs for the XS extensions. |
7 | # |
8 | # There's no support for building an all-static perl yet. |
9 | # Doesn't build any of the stuff in ..\utils yet. |
10 | # No support for installing documentation, uh, yet. |
11 | # |
0a753a76 |
12 | |
68dc0745 |
13 | |
14 | # |
15 | # Set this to wherever you want "nmake install" to put your |
16 | # newly built perl. If you change this, you better change |
17 | # all occurrences of this prefix in $(INST_TOP)\lib\Config.pm |
18 | # as well. |
19 | |
20 | INST_TOP=C:\perl |
21 | |
22 | #################### do not edit below this line ######################## |
23 | # |
24 | INST_BIN=$(INST_TOP)\bin |
25 | INST_LIB=$(INST_TOP)\lib |
26 | INST_POD=$(INST_TOP)\pod |
27 | INST_HTML=$(INST_POD)\html |
28 | LIBDIR=..\lib |
0a753a76 |
29 | EXTDIR=..\ext |
68dc0745 |
30 | PODDIR=..\pod |
0a753a76 |
31 | EXTUTILSDIR=$(LIBDIR)\extutils |
68dc0745 |
32 | |
33 | # |
34 | # various targets |
35 | PERLLIB=..\libperl.lib |
54310121 |
36 | PERLIMPLIB=..\perl.lib |
68dc0745 |
37 | MINIPERL=..\miniperl.exe |
38 | PERLDLL=..\perl.dll |
39 | PERLEXE=..\perl.exe |
40 | GLOBEXE=..\perlglob.exe |
41 | |
42 | PL2BAT=bin\PL2BAT.BAT |
43 | MAKE=nmake /nologo |
3fe9a6f1 |
44 | XCOPY=xcopy /i /d /f /r |
68dc0745 |
45 | NULL= |
46 | |
47 | # |
48 | # filenames given to xsubpp must have forward slashes (since it puts |
49 | # full pathnames in #line strings) |
50 | XSUBPP=..\$(MINIPERL) ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes |
51 | |
52 | CORE_C= \ |
53 | ..\av.c \ |
54 | ..\deb.c \ |
55 | ..\doio.c \ |
56 | ..\doop.c \ |
57 | ..\dump.c \ |
58 | ..\globals.c \ |
59 | ..\gv.c \ |
60 | ..\hv.c \ |
61 | ..\mg.c \ |
62 | ..\op.c \ |
63 | ..\perl.c \ |
64 | ..\perlio.c \ |
65 | ..\perly.c \ |
66 | ..\pp.c \ |
67 | ..\pp_ctl.c \ |
68 | ..\pp_hot.c \ |
69 | ..\pp_sys.c \ |
70 | ..\regcomp.c \ |
71 | ..\regexec.c \ |
72 | ..\run.c \ |
73 | ..\scope.c \ |
74 | ..\sv.c \ |
75 | ..\taint.c \ |
76 | ..\toke.c \ |
77 | ..\universal.c \ |
78 | ..\util.c |
0a753a76 |
79 | |
80 | EXTENSIONS=DynaLoader Socket IO Fcntl Opcode SDBM_File |
0a753a76 |
81 | |
68dc0745 |
82 | DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader |
83 | SOCKET=$(EXTDIR)\Socket\Socket |
84 | FCNTL=$(EXTDIR)\Fcntl\Fcntl |
85 | OPCODE=$(EXTDIR)\Opcode\Opcode |
86 | SDBM_FILE=$(EXTDIR)\SDBM_File\SDBM_File |
87 | IO=$(EXTDIR)\IO\IO |
88 | |
89 | SOCKET_DLL=..\lib\auto\Socket\Socket.dll |
90 | FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll |
91 | OPCODE_DLL=..\lib\auto\Opcode\Opcode.dll |
92 | SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll |
93 | IO_DLL=..\lib\auto\IO\IO.dll |
94 | |
95 | STATICLINKMODULES=DynaLoader |
96 | DYNALOADMODULES= \ |
97 | $(SOCKET_DLL) \ |
98 | $(FCNTL_DLL) \ |
99 | $(OPCODE_DLL) \ |
100 | $(SDBM_FILE_DLL)\ |
101 | $(IO_DLL) |
102 | |
103 | POD2HTML=$(PODDIR)\pod2html |
104 | POD2MAN=$(PODDIR)\pod2man |
105 | POD2LATEX=$(PODDIR)\pod2latex |
106 | POD2TEXT=$(PODDIR)\pod2text |
107 | |
108 | ALL: $(PERLEXE) $(GLOBEXE) $(DYNALOADMODULES) |
0a753a76 |
109 | |
110 | !IF "$(CFG)" =="" |
111 | CFG=Release |
112 | !ENDIF |
113 | |
68dc0745 |
114 | modules.lib : $(DYNALOADER).c |
115 | $(MAKE) -A -f modules.mak CFG="modules - Win32 $(CFG)" |
0a753a76 |
116 | |
68dc0745 |
117 | $(GLOBEXE): |
118 | $(MAKE) -f perlglob.mak CFG="perlglob - Win32 Release" |
0a753a76 |
119 | |
68dc0745 |
120 | $(PERLLIB): $(CORE_C) |
68dc0745 |
121 | $(MAKE) -f libperl.mak CFG="libperl - Win32 $(CFG)" |
0a753a76 |
122 | |
68dc0745 |
123 | $(MINIPERL): $(PERLLIB) |
124 | $(MAKE) -A -f miniperl.mak CFG="miniperl - Win32 $(CFG)" |
0a753a76 |
125 | copy config.w32 ..\config.sh |
126 | cd .. |
127 | miniperl configpm |
128 | cd win32 |
68dc0745 |
129 | if exist lib\* $(XCOPY) /e lib\*.* ..\lib\$(NULL) |
0a753a76 |
130 | copy bin\test.bat ..\t |
131 | |
68dc0745 |
132 | $(PERLDLL): $(MINIPERL) $(PERLLIB) |
133 | $(MINIPERL) -w makedef.pl > perldll.def |
134 | $(MAKE) -A -f perldll.mak CFG="perldll - Win32 $(CFG)" |
0a753a76 |
135 | |
68dc0745 |
136 | $(PERLEXE): $(MINIPERL) modules.lib $(PERLDLL) |
68dc0745 |
137 | # $(MINIPERL) makemain.pl $(STATICLINKMODUES) > perlmain.c |
138 | # $(MINIPERL) makeperldef.pl $(STATICLINKMODUES) > perl.def |
139 | $(MINIPERL) makeperldef.pl $(NULL) > perl.def |
0a753a76 |
140 | copy runperl.c perlmain.c |
68dc0745 |
141 | $(MAKE) -A -f perl.mak CFG="perl - Win32 $(CFG)" |
142 | copy ..\_perl.exe $(PERLEXE) |
0a753a76 |
143 | del ..\_perl.exe |
144 | del ..\*.exp |
145 | copy splittree.pl .. |
68dc0745 |
146 | $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto" |
0a753a76 |
147 | attrib -r ..\t\*.* |
148 | copy test ..\t |
68dc0745 |
149 | $(XCOPY) ..\*.h ..\lib\CORE\*.* |
54310121 |
150 | $(XCOPY) $(PERLIMPLIB) ..\lib\CORE |
68dc0745 |
151 | $(XCOPY) $(PERLLIB) ..\lib\CORE |
152 | $(XCOPY) *.h ..\lib\CORE |
153 | $(XCOPY) /S include ..\lib\CORE |
0a753a76 |
154 | |
68dc0745 |
155 | $(DYNALOADER).c: $(EXTDIR)\DynaLoader\dl_win32.xs |
156 | if not exist ..\lib\auto md ..\lib\auto |
157 | $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) |
158 | cd $(EXTDIR)\$(*B) |
159 | $(XSUBPP) dl_win32.xs > $(*B).c |
0a753a76 |
160 | cd ..\..\win32 |
161 | |
68dc0745 |
162 | $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs |
163 | copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs |
0a753a76 |
164 | |
68dc0745 |
165 | $(SOCKET).c: $(SOCKET).xs |
166 | if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) |
167 | $(MINIPERL) genxsdef.pl $(*B) > $(*B).def |
168 | $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) |
169 | cd $(EXTDIR)\$(*B) |
170 | $(XSUBPP) $(*B).xs > $(*B).c |
0a753a76 |
171 | cd ..\..\win32 |
172 | |
68dc0745 |
173 | $(IO).c: $(IO).xs |
174 | if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) |
175 | $(MINIPERL) genxsdef.pl $(*B) > $(*B).def |
176 | $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) |
177 | $(XCOPY) /s $(EXTDIR)\$(*B)\lib\*.* $(LIBDIR) |
178 | cd $(EXTDIR)\$(*B) |
179 | $(XSUBPP) $(*B).xs > $(*B).c |
180 | cd ..\..\win32 |
0a753a76 |
181 | |
68dc0745 |
182 | $(SDBM_FILE).c: $(SDBM_FILE).xs |
183 | if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) |
184 | $(MINIPERL) genxsdef.pl $(*B) > $(*B).def |
185 | $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) |
186 | cd $(EXTDIR)\$(*B) |
187 | $(XSUBPP) -typemap ./typemap $(*B).xs > $(*B).c |
0a753a76 |
188 | cd ..\..\win32 |
189 | |
68dc0745 |
190 | $(FCNTL).c: $(FCNTL).xs |
191 | if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) |
192 | $(MINIPERL) genxsdef.pl $(*B) > $(*B).def |
193 | $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) |
194 | cd $(EXTDIR)\$(*B) |
195 | $(XSUBPP) $(*B).xs > $(*B).c |
196 | cd ..\..\win32 |
0a753a76 |
197 | |
68dc0745 |
198 | $(OPCODE).c: $(OPCODE).xs |
199 | if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B) |
200 | $(MINIPERL) genxsdef.pl $(*B) > $(*B).def |
201 | $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) |
202 | $(XCOPY) $(EXTDIR)\$(*B)\*.pm $(LIBDIR)\$(NULL) |
203 | cd $(EXTDIR)\$(*B) |
204 | $(XSUBPP) $(*B).xs > $(*B).c |
0a753a76 |
205 | cd ..\..\win32 |
206 | |
68dc0745 |
207 | $(SOCKET_DLL): $(SOCKET).c $(PERLDLL) |
208 | $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" |
0a753a76 |
209 | |
68dc0745 |
210 | $(IO_DLL): $(IO).c $(PERLDLL) |
211 | $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" |
212 | |
213 | $(SDBM_FILE_DLL): $(SDBM_FILE).c $(PERLDLL) |
214 | $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" |
0a753a76 |
215 | |
68dc0745 |
216 | $(FCNTL_DLL): $(FCNTL).c $(PERLDLL) |
217 | $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" |
0a753a76 |
218 | |
68dc0745 |
219 | $(OPCODE_DLL): $(OPCODE).c $(PERLDLL) |
220 | $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)" |
221 | |
222 | doc: $(PERLEXE) |
68dc0745 |
223 | cd $(PODDIR) |
5aabfad6 |
224 | nmake -f ../win32/pod.mak |
68dc0745 |
225 | cd ..\win32 |
226 | |
3fe9a6f1 |
227 | utils: $(PERLEXE) |
228 | cd ..\utils |
229 | nmake PERL=$(MINIPERL) |
230 | $(PERLEXE) ..\win32\$(PL2BAT) h2ph splain perlbug pl2pm c2ph \ |
231 | h2xs perldoc pstruct |
232 | $(XCOPY) *.bat ..\win32\bin\*.* |
233 | cd ..\win32 |
234 | |
68dc0745 |
235 | distclean: |
54310121 |
236 | -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) $(PERLLIB) \ |
237 | $(PERLIMPLIB) ..\miniperl.lib modules.lib |
68dc0745 |
238 | -del /f *.def |
54310121 |
239 | -del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) $(FCNTL_DLL) \ |
240 | $(OPCODE_DLL) |
241 | -del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c $(OPCODE).c \ |
242 | $(DYNALOADER).c |
68dc0745 |
243 | -del /f $(PODDIR)\*.html |
244 | -del /f $(PODDIR)\*.bat |
54310121 |
245 | -rmdir /s /q ..\lib\auto |
246 | -rmdir /s /q ..\lib\CORE |
68dc0745 |
247 | -rmdir /s /q release |
248 | -rmdir /s /q debug |
249 | |
3fe9a6f1 |
250 | install : ALL doc utils |
68dc0745 |
251 | if not exist $(INST_TOP) mkdir $(INST_TOP) |
252 | echo I $(INST_TOP) L $(LIBDIR) |
253 | $(XCOPY) $(PERLEXE) $(INST_BIN)\*.* |
254 | $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.* |
255 | $(XCOPY) $(PERLDLL) $(INST_BIN)\*.* |
3fe9a6f1 |
256 | $(XCOPY) bin\*.* $(INST_BIN)\*.* |
68dc0745 |
257 | $(XCOPY) /e ..\lib $(INST_LIB)\*.* |
258 | $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.* |
259 | $(XCOPY) ..\pod\*.pod $(INST_POD)\*.* |
260 | $(XCOPY) ..\pod\*.html $(INST_HTML)\*.* |
261 | |
262 | inst_lib : |
263 | copy splittree.pl .. |
264 | $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto" |
265 | $(XCOPY) /e ..\lib $(INST_LIB)\*.* |
0a753a76 |
266 | |
68dc0745 |
267 | test : all |
268 | $(XCOPY) $(PERLEXE) ..\t\$(NULL) |
269 | $(XCOPY) $(PERLDLL) ..\t\$(NULL) |
270 | $(XCOPY) $(GLOBEXE) ..\t\$(NULL) |
271 | cd ..\t |
272 | $(PERLEXE) test |
273 | cd ..\win32 |