This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
xsubpp incorrectly handles 'class::newthing()'
[perl5.git] / win32 / Makefile
CommitLineData
68dc0745
PP
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
PP
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
20INST_TOP=C:\perl
21
22#################### do not edit below this line ########################
23#
24INST_BIN=$(INST_TOP)\bin
25INST_LIB=$(INST_TOP)\lib
26INST_POD=$(INST_TOP)\pod
27INST_HTML=$(INST_POD)\html
28LIBDIR=..\lib
0a753a76 29EXTDIR=..\ext
68dc0745 30PODDIR=..\pod
0a753a76 31EXTUTILSDIR=$(LIBDIR)\extutils
68dc0745
PP
32
33#
34# various targets
35PERLLIB=..\libperl.lib
54310121 36PERLIMPLIB=..\perl.lib
68dc0745
PP
37MINIPERL=..\miniperl.exe
38PERLDLL=..\perl.dll
39PERLEXE=..\perl.exe
40GLOBEXE=..\perlglob.exe
41
42PL2BAT=bin\PL2BAT.BAT
43MAKE=nmake /nologo
3fe9a6f1 44XCOPY=xcopy /i /d /f /r
68dc0745
PP
45NULL=
46
47#
48# filenames given to xsubpp must have forward slashes (since it puts
49# full pathnames in #line strings)
50XSUBPP=..\$(MINIPERL) ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes
51
52CORE_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
PP
79
80EXTENSIONS=DynaLoader Socket IO Fcntl Opcode SDBM_File
0a753a76 81
68dc0745
PP
82DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader
83SOCKET=$(EXTDIR)\Socket\Socket
84FCNTL=$(EXTDIR)\Fcntl\Fcntl
85OPCODE=$(EXTDIR)\Opcode\Opcode
86SDBM_FILE=$(EXTDIR)\SDBM_File\SDBM_File
87IO=$(EXTDIR)\IO\IO
88
89SOCKET_DLL=..\lib\auto\Socket\Socket.dll
90FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll
91OPCODE_DLL=..\lib\auto\Opcode\Opcode.dll
92SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll
93IO_DLL=..\lib\auto\IO\IO.dll
94
95STATICLINKMODULES=DynaLoader
96DYNALOADMODULES= \
97 $(SOCKET_DLL) \
98 $(FCNTL_DLL) \
99 $(OPCODE_DLL) \
100 $(SDBM_FILE_DLL)\
101 $(IO_DLL)
102
103POD2HTML=$(PODDIR)\pod2html
104POD2MAN=$(PODDIR)\pod2man
105POD2LATEX=$(PODDIR)\pod2latex
106POD2TEXT=$(PODDIR)\pod2text
107
108ALL: $(PERLEXE) $(GLOBEXE) $(DYNALOADMODULES)
0a753a76
PP
109
110!IF "$(CFG)" ==""
111CFG=Release
112!ENDIF
113
68dc0745
PP
114modules.lib : $(DYNALOADER).c
115 $(MAKE) -A -f modules.mak CFG="modules - Win32 $(CFG)"
0a753a76 116
68dc0745
PP
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
PP
123$(MINIPERL): $(PERLLIB)
124 $(MAKE) -A -f miniperl.mak CFG="miniperl - Win32 $(CFG)"
0a753a76
PP
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
PP
130 copy bin\test.bat ..\t
131
68dc0745
PP
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
PP
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
PP
141 $(MAKE) -A -f perl.mak CFG="perl - Win32 $(CFG)"
142 copy ..\_perl.exe $(PERLEXE)
0a753a76
PP
143 del ..\_perl.exe
144 del ..\*.exp
145 copy splittree.pl ..
68dc0745 146 $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto"
0a753a76
PP
147 attrib -r ..\t\*.*
148 copy test ..\t
68dc0745 149 $(XCOPY) ..\*.h ..\lib\CORE\*.*
54310121 150 $(XCOPY) $(PERLIMPLIB) ..\lib\CORE
68dc0745
PP
151 $(XCOPY) $(PERLLIB) ..\lib\CORE
152 $(XCOPY) *.h ..\lib\CORE
153 $(XCOPY) /S include ..\lib\CORE
0a753a76 154
68dc0745
PP
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
PP
160 cd ..\..\win32
161
68dc0745
PP
162$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
163 copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
0a753a76 164
68dc0745
PP
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
PP
171 cd ..\..\win32
172
68dc0745
PP
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
PP
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
PP
188 cd ..\..\win32
189
68dc0745
PP
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
PP
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
PP
205 cd ..\..\win32
206
68dc0745
PP
207$(SOCKET_DLL): $(SOCKET).c $(PERLDLL)
208 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
0a753a76 209
68dc0745
PP
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
PP
216$(FCNTL_DLL): $(FCNTL).c $(PERLDLL)
217 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
0a753a76 218
68dc0745
PP
219$(OPCODE_DLL): $(OPCODE).c $(PERLDLL)
220 $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
221
222doc: $(PERLEXE)
68dc0745 223 cd $(PODDIR)
5aabfad6 224 nmake -f ../win32/pod.mak
68dc0745
PP
225 cd ..\win32
226
3fe9a6f1
PP
227utils: $(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 235distclean:
54310121
PP
236 -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) $(PERLLIB) \
237 $(PERLIMPLIB) ..\miniperl.lib modules.lib
68dc0745 238 -del /f *.def
54310121
PP
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
PP
243 -del /f $(PODDIR)\*.html
244 -del /f $(PODDIR)\*.bat
54310121
PP
245 -rmdir /s /q ..\lib\auto
246 -rmdir /s /q ..\lib\CORE
68dc0745
PP
247 -rmdir /s /q release
248 -rmdir /s /q debug
249
3fe9a6f1 250install : ALL doc utils
68dc0745
PP
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
PP
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
262inst_lib :
263 copy splittree.pl ..
264 $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto"
265 $(XCOPY) /e ..\lib $(INST_LIB)\*.*
0a753a76 266
68dc0745
PP
267test : 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