This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5337delta: note that stadtx was removed
[perl5.git] / plan9 / mkfile
CommitLineData
396e9e6f
PP
1APE=/sys/src/ape
2< $APE/config
3<plan9/buildinfo
396e9e6f 4archname = plan9_$objtype
a123eb89
R
5privroot = /sys/lib/perl
6privlib = $privroot/$p9pvers
7archroot = /$objtype/lib/perl
8archlib = $archroot/$p9pvers
9sitelib = $privlib/site_perl
396e9e6f 10sitearch = $archlib/site_perl
a123eb89
R
11corelib = $archlib/CORE
12arpalib = $corelib/arpa
396e9e6f 13
a123eb89
R
14pwd=`{pwd}
15cpanlib=`{cd cpan; ls -ld * | grep '^d' | awk '{ print $10 }' | grep -v '^\.'}
16icpanlib=`{echo $pwd^/cpan/^$cpanlib^/lib}
17distlib=`{cd dist; ls -ld * | grep '^d' | awk '{ print $10 }' | grep -v '^\.'}
18idistlib=`{echo $pwd^/dist/^$distlib $pwd^/dist/^$distlib^/lib }
19extlib=`{cd ext; ls -ld * | grep '^d' | awk '{ print $10 }' | grep -v '^\.'}
20iextlib=`{echo $pwd^/ext/^$extlib $pwd^/ext/^$extlib/lib }
396e9e6f 21
a123eb89
R
22buildlibs=`{echo -I$pwd^/^(lib archlib privlib) -I^$icpanlib -I^$idistlib -I^$iextlib }
23miniperl=`{echo $pwd/miniperl $buildlibs }
24perl=`{echo $pwd/perl $buildlibs }
25xscmd=`{echo $pwd/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp -noprototypes -typemap $pwd/dist/ExtUtils-ParseXS/t/typemap}
26miniperlxs=`{echo $miniperl $xscmd}
27perlxs=`{echo $perl $xscmd}
396e9e6f 28
a123eb89
R
29BASECFLAGS=-B -D_SUSV2_SOURCE -D_POSIX_SOURCE -D_BSD_EXTENSION
30PERLCFLAGS =-DPERL_CORE $BASECFLAGS
31CFLAGS=-DPERL_IS_MINIPERL $PERLCFLAGS
396e9e6f 32
a123eb89
R
33CCCMD = $CC -c $CFLAGS
34PERLCCCMD= $CC -c $PERLCFLAGS
35XSCCCMD= $CC -c $BASECFLAGS
36
37perllib = archlib/CORE/libperl.a
38
39perlshr = archlib/CORE/libperlshr.a
396e9e6f
PP
40
41installman1dir = /sys/man/1
42installman3dir = /sys/man/2
43
82e1c0d9 44podnames = perl perlbook perldata perldebtut perldiag perldsc perlform perlfunc perlipc perllexwarn perllol perlmod perlmodlib perlmodinstall perlnewmod perlop perlootut perlopentut perlpacktut perlpod perlport perlrequick perlretut perlref perlreftut perlrequick perlrun perlsec perlstyle perlsub perlsyn perltie perltrap perlutil perlunifaq perluniintro perlvar
a83b6f46 45faqpodnames = perlfaq perlfaq1 perlfaq2 perlfaq3 perlfaq4 perlfaq5 perlfaq6 perlfaq7 perlfaq8 perlfaq9
5dd47fd4 46advpodnames = perlapi perlapio perlcall perlclib perlcompile perldebguts perldbmfilter perldebug perldelta perldiag perlebcdic perlembed perlfilter perlfork perlguts perlhack perlintern perliol perllocale perlnumber perlobj perlpodspec perlre perlthrtut perltodo perlunicode perlunicook perlxs perlxs perlxstut
a123eb89
R
47archpodnames = perlaix perlamiga perlbeos perlbs2000 perlce perlcygwin perldgux perldos perlfreebsd perlhpux perlhurd perlirix perlmacos perlmpeix perlnetware perlos2 perlos390 perlos400 perlplan9 perlqnx perlsolaris perltru64 perlvms perlvos perlwin32
48histpodnames = perl5004delta perl5005delta perl561delta perl56delta perl570delta perl571delta perl572delta perl573delta perl58delta perlhist
396e9e6f
PP
49
50libpods = ${podnames:%=pod/%.pod}
51
52perlpods = $libpods
53
a123eb89
R
54extensions = File::Glob IO Opcode DynaLoader Fcntl POSIX Cwd re B Devel::Peek attributes Hash::Util Hash::Util::FieldHash mro Storable Time::HiRes Unicode::Normalize List::Util
55ext_xs = Glob.xs IO.xs Opcode.xs dl_none.xs Fcntl.xs POSIX.xs Cwd.xs re.xs B.xs Peek.xs attributes.xs Util.xs FieldHash.xs mro.xs Storable.xs HiRes.xs Normalize.xs ListUtil.xs
396e9e6f 56ext_c = ${ext_xs:%.xs=%.c}
a123eb89
R
57ext_obj = ${ext_xs:%.xs=%.$O} bsd_glob.$O poll.$O re_comp.$O re_exec.$O
58
59# Socket requires a full version of Perl (one with IO to build).
60more_extensions = Socket Data::Dumper
61more_ext_xs = Socket.xs Dumper.xs
62more_ext_c = ${more_ext_xs:%.xs=%.c}
63more_ext_obj = ${more_ext_xs:%.xs=%.$O}
396e9e6f 64
a123eb89 65obj = av.$O caretx.$O deb.$O doio.$O doop.$O dquote.$O dump.$O globals.$O gv.$O hv.$O keywords.$O locale.$O malloc.$O mathoms.$O mg.$O mro_core.$O numeric.$O op.$O pad.$O perlapi.$O perlio.$O perly.$O pp.$O pp_ctl.$O pp_hot.$O pp_pack.$O pp_sort.$O pp_sys.$O reentr.$O regcomp.$O regexec.$O run.$O scope.$O sv.$O taint.$O time64.$O toke.$O universal.$O utf8.$O util.$O
396e9e6f 66
fffee6a2 67OBJS = perl.$O plan9.$O $obj
396e9e6f 68
a123eb89
R
69# TODO: what's this used for?
70testlist = `{cd t; echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t}
396e9e6f
PP
71
72install:V: perl preplibrary
a123eb89
R
73 cp perl /$objtype/bin/perl-$p9pvers
74 cp plan9/aperl /rc/bin/Perl-$p9pvers
396e9e6f 75
a123eb89
R
76 if (test ! -d $privroot) mkdir $privroot
77 if (test ! -d $privlib) mkdir $privlib
78 if (test ! -d $privlib/auto) mkdir $privlib/auto
79 if (test ! -d $sitelib) mkdir $sitelib
80 if (test ! -d $archroot) mkdir $archroot
81 if (test ! -d $archlib) mkdir $archlib
82 if (test ! -d $sitearch) mkdir $sitearch
83 if (test ! -d $corelib) mkdir $corelib
84 if (test ! -d $arpalib) mkdir $arpalib
85 cp *.h plan9/*.h $corelib
86 cp plan9/arpa/*.h $arpalib
87
88 # Populate library directories
89 {cd privlib ; tar c . } | {cd $privlib ; tar x }
90 {cd lib ; tar c . } | {cd $privlib ; tar x }
91 {cd archlib ; tar c . } | {cd $archlib ; tar x }
92 # mk man # don't make man pages now--resolve multiversion
93
94perl: perlnosocket more_extensions
95 $LD $PERLCFLAGS -o perl perlmain.$O perl.$O $perllib $perlshr $more_ext_obj
96
97perlnosocket: config.h miniperlmain.$O miniperl archlib/Config.pm perlmain.$O $perlshr
98 $LD $PERLCFLAGS -o perl perlmain.$O perl.$O $perllib $perlshr
396e9e6f
PP
99
100miniperl: config.h $perllib miniperlmain.$O
101 $LD $CFLAGS -o miniperl miniperlmain.$O $perllib
102
a123eb89
R
103preplibrary:V: miniperl archlib/Config.pm
104 mkdir -p privlib/auto
105 for (file in lib/*.pm lib/*/*.pm archlib/Config.pm) $miniperl -e 'use AutoSplit; autosplit(@ARGV)' $file privlib/auto
396e9e6f
PP
106
107$perllib(%):N: %
108$perllib: ${OBJS:%=$perllib(%)}
a123eb89 109 mkdir -p archlib/CORE
396e9e6f
PP
110 ar rv $perllib $OBJS
111 $RANLIB $perllib
112
a123eb89 113miniperlmain.$O: config.h uudmap.h
396e9e6f
PP
114 $CCCMD miniperlmain.c
115
116perlmain.$O: config.h perlmain.c
a123eb89
R
117 $PERLCCCMD perl.c
118 $PERLCCCMD perlmain.c
396e9e6f 119
a123eb89
R
120malloc.$O: malloc.c
121 # Does the PTRDIFF_MAX need to be set per architecture?
122 $CCCMD -DPTRDIFF_MAX^'='^9223372036854775807L malloc.c
123
124perlmain.c: miniperl extensions archlib/Config.pm
125 $miniperl -MExtUtils::Miniperl -e 'writemain(\q{perlmain.c}, @ARGV)' $extensions
396e9e6f 126
bb14ff96 127config.h: plan9/fndvers
760ac839 128 plan9/fndvers
a123eb89
R
129 mkdir -p archlib/CORE
130 cp config.h archlib/CORE
396e9e6f
PP
131
132$perlshr(%):N: %
133$perlshr: ${ext_obj:%=$perlshr(%)}
134 ar rv $perlshr $ext_obj
135 $RANLIB $perlshr
136
a123eb89
R
137uudmap.h: generate_uudmap.c
138 $CCCMD generate_uudmap.c
139 # This is currently a show-stopper for cross-compilation: find the true $objtype by looking at kernel?
140 $LD $CFLAGS -o generate_uudmap generate_uudmap.$O
141 chmod +x generate_uudmap
142 ./generate_uudmap uudmap.h bitcount.h mg_data.h
143
144extensions:V: miniperl archlib/Config.pm $ext_c dist/XSLoader/XSLoader.pm
145
146more_extensions:V: perlnosocket $more_ext_c $more_ext_obj
147 ext_obj=`{echo $ext_obj $more_ext_obj}
148
149Socket.$O: Socket.c
150 $XSCCCMD -I plan9 Socket.c
151
152attributes.$O: attributes.c
153 $XSCCCMD -I plan9 attributes.c
154
155mro.$O: mro.c
156 $XSCCCMD -I plan9 mro.c
157
158B.$O: B.c
159 $XSCCCMD -I plan9 B.c
160
161Peek.$O: Peek.c
162 $XSCCCMD -I plan9 Peek.c
163
164Util.$O: Util.c
165 $XSCCCMD -I plan9 Util.c
166
167FieldHash.$O: FieldHash.c
168 $XSCCCMD -I plan9 FieldHash.c
169
170re.$O: re.c
171 $XSCCCMD -DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT -I plan9 re.c
172
173re_comp.$O: re_comp.c
174 $XSCCCMD -DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT -I plan9 re_comp.c
175
176re_exec.$O: re_exec.c
177 $XSCCCMD -DPERL_EXT_RE_BUILD -DPERL_EXT_RE_DEBUG -DPERL_EXT -I plan9 re_exec.c
178
179Cwd.$O: Cwd.c IO.c
180 cp dist/IO/ppport.h dist/PathTools
181 $XSCCCMD -DDOUBLE_SLASHES_SPECIAL^'='^0 -I plan9 Cwd.c
182
183IO.$O: extensions
184 $XSCCCMD -I plan9 IO.c
185
186poll.$O: extensions
187 $XSCCCMD -I plan9 poll.c
188
189POSIX.$O: extensions
190 $XSCCCMD -I plan9 POSIX.c
191
192Glob.$O: extensions
193 $XSCCCMD -I plan9 Glob.c
194
195bsd_glob.$O: extensions
196 $XSCCCMD -I plan9 -I. bsd_glob.c
197
198Normalize.$O: extensions
199 $XSCCCMD -I plan9 -I. Normalize.c
200
201Dumper.$O: Dumper.c
202 $XSCCCMD -I plan9 -I. Dumper.c
203
204HiRes.$O: extensions
205 $XSCCCMD -I plan9 -I. HiRes.c
206
207Storable.$O: extensions
208 $XSCCCMD -I plan9 -I. Storable.c
209
210ListUtil.$O: extensions
211 $XSCCCMD -I plan9 -I. ListUtil.c
212
213Opcode.$O: extensions
214 $XSCCCMD -I plan9 Opcode.c
215
216Fcntl.$O: extensions
217 $XSCCCMD -I plan9 Fcntl.c
218
219dl_none.$O: extensions
220 $XSCCCMD -I plan9 dl_none.c
221
222Glob.c: archlib/Config.pm ext/File-Glob/Glob.xs
223 cd ext/File-Glob
224 $miniperl Makefile.PL # to write constants
225 cd $pwd
226 $miniperlxs ext/File-Glob/Glob.xs > $target
227 cp ext/File-Glob/bsd_glob.^(c h) $pwd
228 mkdir -p archlib/File
229 cp ext/File-Glob/Glob.pm archlib/File/Glob.pm
230
231ppport.h: archlib/Config.pm
232 if (test ! -f /bin/sh) bind -a /386/bin/ape /bin
233 # specify the list, otherwise suicide
234 $miniperl mkppport --list mkppport.lst
235
236Cwd.c: archlib/Config.pm dist/PathTools/Cwd.xs
237 $miniperlxs dist/PathTools/Cwd.xs > $target
238 cp dist/PathTools/Cwd.pm archlib
239 { cd dist/PathTools/lib; tar c . } | { mkdir -p archlib; cd archlib; tar x }
240
241IO.c: archlib/Config.pm dist/IO/IO.xs ppport.h
242 $miniperlxs dist/IO/IO.xs > $target
243 cp dist/IO/poll.^(c h) $pwd
244 cp dist/IO/IO.pm archlib
245 { cd dist/IO/lib; tar c . } | { mkdir -p archlib; cd archlib; tar x }
246
247dist/XSLoader/XSLoader.pm: archlib/Config.pm
248 cd dist/XSLoader
249 $miniperl XSLoader_pm.PL
250 cp XSLoader.pm $pwd/archlib
251
252ext/Errno/Errno.pm: perlnosocket
253 cd ext/Errno
254 $perl Makefile.PL
255 $perl Errno_pm.PL arch.txt
256 cp Errno.pm $pwd/archlib
257
258Socket.c: perlnosocket cpan/Socket/Socket.xs ext/Errno/Errno.pm
259 cd cpan/Socket
260 $perl Makefile.PL # to write const-xs.inc
261 cd $pwd
262 $perlxs cpan/Socket/Socket.xs > $target
263 cp cpan/Socket/Socket.pm archlib
264
265uni.data: archlib/Config.pm lib/unicore/mktables
266 $miniperl lib/unicore/mktables -C lib/unicore -makelist -p
267
268Normalize.c: archlib/Config.pm dist/Unicode-Normalize/Normalize.xs uni.data
269 $miniperl dist/Unicode-Normalize/mkheader
270 $miniperlxs dist/Unicode-Normalize/Normalize.xs > $target
271 mkdir -p archlib/Unicode
272 cp dist/Unicode-Normalize/Normalize.pm archlib/Unicode
273
274Dumper.c: perlnosocket dist/Data-Dumper/Dumper.xs
275 $perlxs dist/Data-Dumper/Dumper.xs > $target
276 mkdir -p archlib/Data
277 cp dist/Data-Dumper/Dumper.pm archlib/Data
278
279HiRes.c: archlib/Config.pm dist/Time-HiRes/HiRes.xs
280 cd dist/Time-HiRes
281 $miniperl Makefile.PL # to write const-xs.inc
282 cd $pwd
283 $miniperlxs dist/Time-HiRes/HiRes.xs > $target
284 mkdir -p archlib/Time
285 cp dist/Time-HiRes/HiRes.pm archlib/Time
286
287ListUtil.c: archlib/Config.pm cpan/Scalar-List-Utils/ListUtil.xs
288 cp cpan/Scalar-List-Utils/multicall.h $pwd
289 $miniperlxs cpan/Scalar-List-Utils/ListUtil.xs > $target
290 { cd cpan/Scalar-List-Utils/lib; tar c . } | { mkdir -p archlib; cd archlib; tar x }
291
292Storable.c: archlib/Config.pm dist/Storable/Storable.xs
293 $miniperlxs dist/Storable/Storable.xs > $target
294 cp dist/Storable/Storable.pm archlib
295
296Opcode.c: archlib/Config.pm ext/Opcode/Opcode.xs
297 $miniperlxs ext/Opcode/Opcode.xs > $target
298 cp ext/Opcode/^(Opcode ops)^.pm archlib
299
300Fcntl.c: archlib/Config.pm ext/Fcntl/Fcntl.xs
301 cd ext/Fcntl
302 $miniperl Makefile.PL # to write const-xs.inc
303 cd $pwd
304 $miniperlxs ext/Fcntl/Fcntl.xs > $target
305 cp ext/Fcntl/Fcntl.pm archlib
306
307POSIX.c: archlib/Config.pm ext/POSIX/POSIX.xs
308 cd ext/POSIX
309 $miniperl Makefile.PL # to write const-xs.inc
310 cd $pwd
311 $miniperlxs ext/POSIX/POSIX.xs > $target
312 cp ext/POSIX/lib/POSIX.pm archlib
313
314B.c: archlib/Config.pm ext/B/B.xs
315 cd ext/B
316 $miniperl Makefile.PL PERL_CORE^'='^1 # to write const-xs.inc
317 cd $pwd
318 $miniperlxs ext/B/B.xs > $target
319 cp ext/B/^(B O)^.pm archlib
320
321Peek.c: archlib/Config.pm ext/Devel-Peek/Peek.xs
322 $miniperlxs ext/Devel-Peek/Peek.xs > $target
323 cp ext/Devel-Peek/Peek.pm archlib
324
325attributes.c: archlib/Config.pm ext/attributes/attributes.xs
326 $miniperlxs ext/attributes/attributes.xs > $target
327 cp ext/attributes/attributes.pm archlib
328
329mro.c: archlib/Config.pm ext/mro/mro.xs
330 $miniperlxs ext/mro/mro.xs > $target
331 cp ext/mro/mro.pm archlib
332
333Util.c: archlib/Config.pm ext/Hash-Util/Util.xs
334 $miniperlxs ext/Hash-Util/Util.xs > $target
335 { cd ext/Hash-Util/lib; tar c . } | { cd archlib; tar x }
336
337FieldHash.c: archlib/Config.pm ext/Hash-Util-FieldHash/FieldHash.xs
338 $miniperlxs ext/Hash-Util-FieldHash/FieldHash.xs > $target
339 { cd ext/Hash-Util-FieldHash/lib; tar c . } | { cd archlib; tar x }
340
341re.c: archlib/Config.pm ext/re/re.xs
342 $miniperlxs ext/re/re.xs > $target
343 cp ext/re/re_^(comp top)^.h $pwd
344 cp ext/re/re.pm archlib
345
346re_comp.c: miniperl re.c regcomp.c
347 cp regcomp.c $target
348
349re_exec.c: miniperl re.c regexec.c
350 cp regexec.c $target
351
352dl_none.c: archlib/Config.pm ext/DynaLoader/dl_none.xs
353 cd ext/DynaLoader;
354 $miniperl DynaLoader_pm.PL
355 cd $pwd
356 $miniperlxs ext/DynaLoader/dl_none.xs > $target
357 cp ext/DynaLoader/DynaLoader.pm archlib
358
359preptest:Q: perl
360 # Bind the crap out of everything, as different tests expect different INCs
361 cp perl t/perl
362 cd t
363 mntpt=/$objtype/lib/perl
364 if (test ! -d $mntpt ) {
365 mkdir $mntpt
366 rmdir=1
367 }
368 ramfs -m $mntpt
369 mkdir -p $mntpt/5.32.0/site_perl
370 echo -n Binding directories
371 for (l in $pwd/lib $pwd/archlib $icpanlib $idistlib $iextlib ) {
372 if (test -d $l ) {
373 if (! ~ `{grep $l <{ns} >[1]/dev/null; echo $status} '') bind -a $l $mntpt/5.32.0/site_perl
374 echo -n .
375 }
376 }
377 bind $mntpt/5.32.0/site_perl $pwd/lib
378 echo done
379 echo Binding sh
380 if (! ~ `{grep /$objtype/bin/ape <{ns} >[1]/dev/null; echo $status} '') bind -a /$objtype/bin/ape /bin
381
382minitest:V: preptest
383 cd t
384 perl TEST $testlist
385 unmount $pwd/lib
386 unmount $mntpt
387 if (~ $rmdir 1) rm $mntpt
388 rm t/perl
389
390test:V: preptest
391 cd t
396e9e6f 392 perl TEST `{ ls */*.t | comm -23 - ../plan9/exclude }
a123eb89
R
393 unmount $pwd/lib
394 unmount $mntpt
395 if (~ $rmdir 1) rm $mntpt
396 rm t/perl
396e9e6f 397
a123eb89
R
398plan9.$O: config.h plan9/plan9.c
399 cp plan9/plan9.c plan9.c
396e9e6f
PP
400 $CCCMD plan9.c
401
402%.$O: config.h %.c
403 $CCCMD $stem.c
404
a123eb89
R
405archlib/Config.pm: config.sh
406 $miniperl make_patchnum.pl
407 $miniperl configpm
408 cp lib/Config.pm archlib/Config.pm
409 cp lib/Config_heavy.pl archlib/Config_heavy.pl
410 cp lib/Config_git.pl archlib/Config_git.pl
411
396e9e6f 412
a123eb89
R
413config.sh: miniperl
414 miniperl plan9/genconfig.pl $extensions $more_extensions
396e9e6f
PP
415
416installall:V:
a123eb89 417 for (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) mk install
396e9e6f
PP
418
419man:V: $perlpods pod/pod2man.PL perl
420 perl pod/pod2man.PL
421 for (i in $podnames) pod/pod2man pod/$i.pod > $installman3dir/$i
a83b6f46
JH
422 for (i in $faqpodnames) pod/pod2man pod/$i.pod > $installman3dir/$i
423 for (i in $advpodnames) pod/pod2man pod/$i.pod > $installman3dir/$i
424 for (i in $archpodnames) pod/pod2man pod/$i.pod > $installman3dir/$i
1ea052d6 425 for (i in $histpodnames) pod/pod2man pod/$i.pod > $installman3dir/$i
396e9e6f 426
760ac839 427nuke clean:V:
a123eb89
R
428 rm -f *.$O config.sh $perllib config.h $perlshr perlmain.c perl miniperl git_version.h $ext_c $more_ext_c generate_uudmap uudmap.h bitcount.h mg_data.h plan9.c plan9ish.h math.h bsd_glob.^(c h) poll.^(c h) re_*.^(c h) uni.data multicall.h
429 rm -rf privlib archlib
396e9e6f
PP
430
431deleteman:V:
432 rm -f $installman1dir/perl* $installman3dir/perl*