2 # Makefile to build perl on Windowns NT using Microsoft NMAKE.
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.
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.
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
22 #################### do not edit below this line ########################
24 INST_BIN=$(INST_TOP)\bin
25 INST_LIB=$(INST_TOP)\lib
26 INST_POD=$(INST_TOP)\pod
27 INST_HTML=$(INST_POD)\html
31 EXTUTILSDIR=$(LIBDIR)\extutils
35 PERLLIB=..\libperl.lib
36 MINIPERL=..\miniperl.exe
39 GLOBEXE=..\perlglob.exe
43 XCOPY=xcopy /i /d /f /r
47 # filenames given to xsubpp must have forward slashes (since it puts
48 # full pathnames in #line strings)
49 XSUBPP=..\$(MINIPERL) ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes
79 EXTENSIONS=DynaLoader Socket IO Fcntl Opcode SDBM_File
81 DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader
82 SOCKET=$(EXTDIR)\Socket\Socket
83 FCNTL=$(EXTDIR)\Fcntl\Fcntl
84 OPCODE=$(EXTDIR)\Opcode\Opcode
85 SDBM_FILE=$(EXTDIR)\SDBM_File\SDBM_File
88 SOCKET_DLL=..\lib\auto\Socket\Socket.dll
89 FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll
90 OPCODE_DLL=..\lib\auto\Opcode\Opcode.dll
91 SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll
92 IO_DLL=..\lib\auto\IO\IO.dll
94 STATICLINKMODULES=DynaLoader
102 POD2HTML=$(PODDIR)\pod2html
103 POD2MAN=$(PODDIR)\pod2man
104 POD2LATEX=$(PODDIR)\pod2latex
105 POD2TEXT=$(PODDIR)\pod2text
107 ALL: $(PERLEXE) $(GLOBEXE) $(DYNALOADMODULES)
113 modules.lib : $(DYNALOADER).c
114 $(MAKE) -A -f modules.mak CFG="modules - Win32 $(CFG)"
117 $(MAKE) -f perlglob.mak CFG="perlglob - Win32 Release"
119 $(PERLLIB): $(CORE_C)
120 $(MAKE) -f libperl.mak CFG="libperl - Win32 $(CFG)"
122 $(MINIPERL): $(PERLLIB)
123 $(MAKE) -A -f miniperl.mak CFG="miniperl - Win32 $(CFG)"
124 copy config.w32 ..\config.sh
128 if exist lib\* $(XCOPY) /e lib\*.* ..\lib\$(NULL)
129 copy bin\test.bat ..\t
131 $(PERLDLL): $(MINIPERL) $(PERLLIB)
132 $(MINIPERL) -w makedef.pl > perldll.def
133 $(MAKE) -A -f perldll.mak CFG="perldll - Win32 $(CFG)"
135 $(PERLEXE): $(MINIPERL) modules.lib $(PERLDLL)
136 # $(MINIPERL) makemain.pl $(STATICLINKMODUES) > perlmain.c
137 # $(MINIPERL) makeperldef.pl $(STATICLINKMODUES) > perl.def
138 $(MINIPERL) makeperldef.pl $(NULL) > perl.def
139 copy runperl.c perlmain.c
140 $(MAKE) -A -f perl.mak CFG="perl - Win32 $(CFG)"
141 copy ..\_perl.exe $(PERLEXE)
145 $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto"
148 $(XCOPY) ..\*.h ..\lib\CORE\*.*
149 $(XCOPY) ..\perl.lib ..\lib\CORE
150 $(XCOPY) $(PERLLIB) ..\lib\CORE
151 $(XCOPY) *.h ..\lib\CORE
152 $(XCOPY) /S include ..\lib\CORE
154 $(DYNALOADER).c: $(EXTDIR)\DynaLoader\dl_win32.xs
155 if not exist ..\lib\auto md ..\lib\auto
156 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
158 $(XSUBPP) dl_win32.xs > $(*B).c
161 $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
162 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
164 $(SOCKET).c: $(SOCKET).xs
165 if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
166 $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
167 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
169 $(XSUBPP) $(*B).xs > $(*B).c
173 if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
174 $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
175 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
176 $(XCOPY) /s $(EXTDIR)\$(*B)\lib\*.* $(LIBDIR)
178 $(XSUBPP) $(*B).xs > $(*B).c
181 $(SDBM_FILE).c: $(SDBM_FILE).xs
182 if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
183 $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
184 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
186 $(XSUBPP) -typemap ./typemap $(*B).xs > $(*B).c
189 $(FCNTL).c: $(FCNTL).xs
190 if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
191 $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
192 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
194 $(XSUBPP) $(*B).xs > $(*B).c
197 $(OPCODE).c: $(OPCODE).xs
198 if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
199 $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
200 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
201 $(XCOPY) $(EXTDIR)\$(*B)\*.pm $(LIBDIR)\$(NULL)
203 $(XSUBPP) $(*B).xs > $(*B).c
206 $(SOCKET_DLL): $(SOCKET).c $(PERLDLL)
207 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
209 $(IO_DLL): $(IO).c $(PERLDLL)
210 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
212 $(SDBM_FILE_DLL): $(SDBM_FILE).c $(PERLDLL)
213 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
215 $(FCNTL_DLL): $(FCNTL).c $(PERLDLL)
216 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
218 $(OPCODE_DLL): $(OPCODE).c $(PERLDLL)
219 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
222 $(PERLEXE) $(POD2HTML).PL
223 $(PERLEXE) $(POD2MAN).PL
224 $(PERLEXE) $(POD2LATEX).PL
225 $(PERLEXE) $(POD2TEXT).PL
226 $(PERLEXE) $(PL2BAT) $(POD2HTML)
227 $(PERLEXE) $(PL2BAT) $(POD2MAN)
228 $(PERLEXE) $(PL2BAT) $(POD2LATEX)
229 $(PERLEXE) $(PL2BAT) $(POD2TEXT)
231 $(PERLEXE) pod2html.bat *.pod
236 nmake PERL=$(MINIPERL)
237 $(PERLEXE) ..\win32\$(PL2BAT) h2ph splain perlbug pl2pm c2ph \
239 $(XCOPY) *.bat ..\win32\bin\*.*
243 -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
244 $(PERLLIB) modules.lib
246 -del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) \
247 $(FCNTL_DLL) $(OPCODE_DLL)
248 -del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c \
249 $(OPCODE).c $(DYNALOADER).c
250 -del /f $(PODDIR)\*.html
251 -del /f $(PODDIR)\*.bat
255 install : ALL doc utils
256 if not exist $(INST_TOP) mkdir $(INST_TOP)
257 echo I $(INST_TOP) L $(LIBDIR)
258 $(XCOPY) $(PERLEXE) $(INST_BIN)\*.*
259 $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
260 $(XCOPY) $(PERLDLL) $(INST_BIN)\*.*
261 $(XCOPY) bin\*.* $(INST_BIN)\*.*
262 $(XCOPY) /e ..\lib $(INST_LIB)\*.*
263 $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.*
264 $(XCOPY) ..\pod\*.pod $(INST_POD)\*.*
265 $(XCOPY) ..\pod\*.html $(INST_HTML)\*.*
269 $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto"
270 $(XCOPY) /e ..\lib $(INST_LIB)\*.*
273 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
274 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
275 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)