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 PERLIMPLIB=..\perl.lib
37 MINIPERL=..\miniperl.exe
40 GLOBEXE=..\perlglob.exe
44 XCOPY=xcopy /i /d /f /r
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
80 EXTENSIONS=DynaLoader Socket IO Fcntl Opcode SDBM_File
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
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
95 STATICLINKMODULES=DynaLoader
103 POD2HTML=$(PODDIR)\pod2html
104 POD2MAN=$(PODDIR)\pod2man
105 POD2LATEX=$(PODDIR)\pod2latex
106 POD2TEXT=$(PODDIR)\pod2text
108 ALL: $(PERLEXE) $(GLOBEXE) $(DYNALOADMODULES)
114 modules.lib : $(DYNALOADER).c
115 $(MAKE) -A -f modules.mak CFG="modules - Win32 $(CFG)"
118 $(MAKE) -f perlglob.mak CFG="perlglob - Win32 Release"
120 $(PERLLIB): $(CORE_C)
121 $(MAKE) -f libperl.mak CFG="libperl - Win32 $(CFG)"
123 $(MINIPERL): $(PERLLIB)
124 $(MAKE) -A -f miniperl.mak CFG="miniperl - Win32 $(CFG)"
125 copy config.w32 ..\config.sh
129 if exist lib\* $(XCOPY) /e lib\*.* ..\lib\$(NULL)
130 copy bin\test.bat ..\t
132 $(PERLDLL): $(MINIPERL) $(PERLLIB)
133 $(MINIPERL) -w makedef.pl > perldll.def
134 $(MAKE) -A -f perldll.mak CFG="perldll - Win32 $(CFG)"
136 $(PERLEXE): $(MINIPERL) modules.lib $(PERLDLL)
137 # $(MINIPERL) makemain.pl $(STATICLINKMODUES) > perlmain.c
138 # $(MINIPERL) makeperldef.pl $(STATICLINKMODUES) > perl.def
139 $(MINIPERL) makeperldef.pl $(NULL) > perl.def
140 copy runperl.c perlmain.c
141 $(MAKE) -A -f perl.mak CFG="perl - Win32 $(CFG)"
142 copy ..\_perl.exe $(PERLEXE)
146 $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto"
149 $(XCOPY) ..\*.h ..\lib\CORE\*.*
150 $(XCOPY) $(PERLIMPLIB) ..\lib\CORE
151 $(XCOPY) $(PERLLIB) ..\lib\CORE
152 $(XCOPY) *.h ..\lib\CORE
153 $(XCOPY) /S include ..\lib\CORE
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)
159 $(XSUBPP) dl_win32.xs > $(*B).c
162 $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
163 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
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)
170 $(XSUBPP) $(*B).xs > $(*B).c
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)
179 $(XSUBPP) $(*B).xs > $(*B).c
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)
187 $(XSUBPP) -typemap ./typemap $(*B).xs > $(*B).c
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)
195 $(XSUBPP) $(*B).xs > $(*B).c
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)
204 $(XSUBPP) $(*B).xs > $(*B).c
207 $(SOCKET_DLL): $(SOCKET).c $(PERLDLL)
208 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
210 $(IO_DLL): $(IO).c $(PERLDLL)
211 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
213 $(SDBM_FILE_DLL): $(SDBM_FILE).c $(PERLDLL)
214 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
216 $(FCNTL_DLL): $(FCNTL).c $(PERLDLL)
217 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
219 $(OPCODE_DLL): $(OPCODE).c $(PERLDLL)
220 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
224 nmake -f ../win32/pod.mak
229 nmake PERL=$(MINIPERL)
230 $(PERLEXE) ..\win32\$(PL2BAT) h2ph splain perlbug pl2pm c2ph \
232 $(XCOPY) *.bat ..\win32\bin\*.*
236 -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) $(PERLLIB) \
237 $(PERLIMPLIB) ..\miniperl.lib modules.lib
239 -del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) $(FCNTL_DLL) \
241 -del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c $(OPCODE).c \
243 -del /f $(PODDIR)\*.html
244 -del /f $(PODDIR)\*.bat
245 -rmdir /s /q ..\lib\auto
246 -rmdir /s /q ..\lib\CORE
250 install : ALL doc utils
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)\*.*
256 $(XCOPY) bin\*.* $(INST_BIN)\*.*
257 $(XCOPY) /e ..\lib $(INST_LIB)\*.*
258 $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.*
259 $(XCOPY) ..\pod\*.pod $(INST_POD)\*.*
260 $(XCOPY) ..\pod\*.html $(INST_HTML)\*.*
264 $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto"
265 $(XCOPY) /e ..\lib $(INST_LIB)\*.*
268 $(XCOPY) $(PERLEXE) ..\t\$(NULL)
269 $(XCOPY) $(PERLDLL) ..\t\$(NULL)
270 $(XCOPY) $(GLOBEXE) ..\t\$(NULL)