leak in change#4694 spotted by Larry
[p5sagit/p5-mst-13.2.git] / plan9 / mkfile
CommitLineData
396e9e6f 1APE=/sys/src/ape
2< $APE/config
3<plan9/buildinfo
4sourcedir = /sys/src/cmd/perl/$p9pvers
5archname = plan9_$objtype
6privlib=/sys/lib/perl
7archlib = /$objtype/lib/perl/$p9pvers
8sitelib = $privlib/site_perl
9sitearch = $archlib/site_perl
10
16da7c01 11CFLAGS = -B -D_POSIX_SOURCE -D_BSD_EXTENSION -DMY_UV_MAX=0x7fffffffUL
396e9e6f 12LDFLAGS = -B
13
14CCCMD = $CC -c $CFLAGS
15
16perllib = $archlib/CORE/libperl.a
17
18perlshr = $archlib/CORE/libperlshr.a
19
20installman1dir = /sys/man/1
21installman3dir = /sys/man/2
22
8ebc5c01 23podnames = perl perlbook perlbot perlcall perldata perldebug perldiag perldsc perlembed perlform perlfunc perlguts perlipc perllol perlmod perlobj perlop perlpod perlre perlref perlrun perlsec perlstyle perlsub perlsyn perltie perltoc perltrap perlvar perlxs perlxstut
396e9e6f 24
25libpods = ${podnames:%=pod/%.pod}
26
27perlpods = $libpods
28
774d564b 29extensions = IO Socket Opcode DynaLoader Fcntl POSIX
30ext_xs = IO.xs Socket.xs Opcode.xs dl_none.xs Fcntl.xs POSIX.xs
396e9e6f 31ext_c = ${ext_xs:%.xs=%.c}
32ext_obj = ${ext_xs:%.xs=%.$O}
33
bb14ff96 34obj = gv.$O toke.$O perly.$O op.$O regcomp.$O dump.$O util.$O mg.$O hv.$O av.$O run.$O pp_hot.$O sv.$O pp.$O scope.$O pp_ctl.$O pp_sys.$O doop.$O doio.$O regexec.$O taint.$O deb.$O globals.$O plan9.$O universal.$O perlio.$O
396e9e6f 35
36OBJS = perl.$O $obj
37
38testlist = base/*.t comp/*.t cmd/*.t io/*.t op/*.t
39
40install:V: perl preplibrary
41 cp perl /$objtype/bin/perl
eeb010ab 42 cp plan9/aperl /rc/bin/Perl
16da7c01 43 mk man
396e9e6f 44
45perl: config.h miniperlmain.$O miniperl $archlib/Config.pm perlmain.$O $perlshr
46 $LD $CFLAGS -o perl perlmain.$O $perllib $perlshr
47
48miniperl: config.h $perllib miniperlmain.$O
49 $LD $CFLAGS -o miniperl miniperlmain.$O $perllib
50
51preplibrary:V: miniperl $archlib/Config.pm
52 cd $privlib
53 for (file in *.pm */*.pm $archlib/Config.pm) $sourcedir/miniperl -e 'use AutoSplit; autosplit(@ARGV)' $file $privlib/auto
54
55$perllib(%):N: %
56$perllib: ${OBJS:%=$perllib(%)}
57 ar rv $perllib $OBJS
58 $RANLIB $perllib
59
60miniperlmain.$O: config.h
61 $CCCMD miniperlmain.c
62
63perlmain.$O: config.h perlmain.c
64 $CCCMD perlmain.c
65
66perlmain.c: miniperl vms/writemain.pl
67 ./miniperl vms/writemain.pl $extensions
68
bb14ff96 69config.h: plan9/fndvers
760ac839 70 plan9/fndvers
396e9e6f 71 cp config.h $archlib/CORE
72
73$perlshr(%):N: %
74$perlshr: ${ext_obj:%=$perlshr(%)}
75 ar rv $perlshr $ext_obj
76 $RANLIB $perlshr
77
78IO.c: miniperl ext/IO/IO.xs
79 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/IO/IO.xs > $target
80 cp ext/IO/*.pm $privlib
760ac839 81 if (test !-d $privlib/IO) {
82 mkdir $privlib/IO
396e9e6f 83 cp ext/IO/lib/IO/*.pm $privlib/IO
760ac839 84 }
396e9e6f 85
86Socket.$O: config.h Socket.c
87 $CCCMD -I plan9 Socket.c
88
89Socket.c: miniperl ext/Socket/Socket.xs
90 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/Socket/Socket.xs > $target
91 cp ext/Socket/Socket.pm $privlib
92
93Opcode.c: miniperl ext/Opcode/Opcode.xs
94 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/Opcode/Opcode.xs > $target
95 cp ext/Opcode/*.pm $privlib
96
97Fcntl.c: miniperl ext/Fcntl/Fcntl.xs
98 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/Fcntl/Fcntl.xs > $target
99 cp ext/Fcntl/Fcntl.pm $privlib
100
396e9e6f 101POSIX.c: miniperl ext/POSIX/POSIX.xs
102 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/POSIX/POSIX.xs > $target
103 cp ext/POSIX/POSIX.pm $privlib
104
105dl_none.c: miniperl ext/DynaLoader/dl_none.xs
106 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/DynaLoader/dl_none.xs > $target
107 cp ext/DynaLoader/DynaLoader.pm $privlib
108
109test:V:
110 bind -b $privlib $sourcedir/lib
111 bind -b $archlib $sourcedir/lib
112 cd $sourcedir/t
113 rm -f perl
114 cp /$objtype/bin/perl $sourcedir/t
115 perl TEST `{ ls */*.t | comm -23 - ../plan9/exclude }
116
117plan9.$O: config.h ./plan9/plan9.c
118 cp ./plan9/plan9.c ./plan9.c
119 $CCCMD plan9.c
120
121%.$O: config.h %.c
122 $CCCMD $stem.c
123
124$archlib/Config.pm: miniperl config.sh
125 ./miniperl configpm $archlib/Config.pm
126
127config.sh: miniperl config.h
128 ./miniperl ./plan9/genconfig.pl
129
130installall:V:
131 for (objtype in 386 mips 68020 sparc) mk install
132
133man:V: $perlpods pod/pod2man.PL perl
134 perl pod/pod2man.PL
135 for (i in $podnames) pod/pod2man pod/$i.pod > $installman3dir/$i
136 pod/pod2man plan9/perlplan9.pod > $installman3dir/perlplan9
137
760ac839 138nuke clean:V:
396e9e6f 139 rm -f *.$O $extensions^.pm config.sh $perllib config.h $perlshr perlmain.c perl miniperl $archlib/Config.pm $ext_c
760ac839 140 rm -rf $privlib/IO
396e9e6f 141
142deleteman:V:
143 rm -f $installman1dir/perl* $installman3dir/perl*