perl 5.003_04: Makefile.SH
[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
11CFLAGS = -B -D_POSIX_SOURCE -D_BSD_EXTENSION -DNO_EMBED
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
23podnames = perl perlbook perlbot perlcall perldata perldebug perldiag perldsc perlembed perlform perlfunc perlguts perlipc perllol perlmod perlobj perlop perlovl perlpod perlre perlref perlrun perlsec perlstyle perlsub perlsyn perltie perltoc perltrap perlvar perlxs perlxstut
24
25libpods = ${podnames:%=pod/%.pod}
26
27perlpods = $libpods
28
29extensions = IO Socket Opcode DynaLoader Fcntl FileHandle POSIX
30ext_xs = IO.xs Socket.xs Opcode.xs dl_none.xs Fcntl.xs FileHandle.xs POSIX.xs
31ext_c = ${ext_xs:%.xs=%.c}
32ext_obj = ${ext_xs:%.xs=%.$O}
33
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
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
42 cp plan9/aperl /rc/bin/aperl
43
44perl: config.h miniperlmain.$O miniperl $archlib/Config.pm perlmain.$O $perlshr
45 $LD $CFLAGS -o perl perlmain.$O $perllib $perlshr
46
47miniperl: config.h $perllib miniperlmain.$O
48 $LD $CFLAGS -o miniperl miniperlmain.$O $perllib
49
50preplibrary:V: miniperl $archlib/Config.pm
51 cd $privlib
52 for (file in *.pm */*.pm $archlib/Config.pm) $sourcedir/miniperl -e 'use AutoSplit; autosplit(@ARGV)' $file $privlib/auto
53
54$perllib(%):N: %
55$perllib: ${OBJS:%=$perllib(%)}
56 ar rv $perllib $OBJS
57 $RANLIB $perllib
58
59miniperlmain.$O: config.h
60 $CCCMD miniperlmain.c
61
62perlmain.$O: config.h perlmain.c
63 $CCCMD perlmain.c
64
65perlmain.c: miniperl vms/writemain.pl
66 ./miniperl vms/writemain.pl $extensions
67
68config.h: config.plan9 plan9/fndvers
760ac839 69 plan9/fndvers
396e9e6f 70 cp config.h $archlib/CORE
71
72$perlshr(%):N: %
73$perlshr: ${ext_obj:%=$perlshr(%)}
74 ar rv $perlshr $ext_obj
75 $RANLIB $perlshr
76
77IO.c: miniperl ext/IO/IO.xs
78 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/IO/IO.xs > $target
79 cp ext/IO/*.pm $privlib
760ac839 80 if (test !-d $privlib/IO) {
81 mkdir $privlib/IO
396e9e6f 82 cp ext/IO/lib/IO/*.pm $privlib/IO
760ac839 83 }
396e9e6f 84
85Socket.$O: config.h Socket.c
86 $CCCMD -I plan9 Socket.c
87
88Socket.c: miniperl ext/Socket/Socket.xs
89 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/Socket/Socket.xs > $target
90 cp ext/Socket/Socket.pm $privlib
91
92Opcode.c: miniperl ext/Opcode/Opcode.xs
93 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/Opcode/Opcode.xs > $target
94 cp ext/Opcode/*.pm $privlib
95
96Fcntl.c: miniperl ext/Fcntl/Fcntl.xs
97 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/Fcntl/Fcntl.xs > $target
98 cp ext/Fcntl/Fcntl.pm $privlib
99
100FileHandle.c: miniperl ext/FileHandle/FileHandle.xs
101 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/FileHandle/FileHandle.xs > $target
102 cp ext/FileHandle/FileHandle.pm $privlib
103
104POSIX.c: miniperl ext/POSIX/POSIX.xs
105 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/POSIX/POSIX.xs > $target
106 cp ext/POSIX/POSIX.pm $privlib
107
108dl_none.c: miniperl ext/DynaLoader/dl_none.xs
109 ./miniperl $privlib/ExtUtils/xsubpp -noprototypes -typemap $privlib/ExtUtils/typemap ext/DynaLoader/dl_none.xs > $target
110 cp ext/DynaLoader/DynaLoader.pm $privlib
111
112test:V:
113 bind -b $privlib $sourcedir/lib
114 bind -b $archlib $sourcedir/lib
115 cd $sourcedir/t
116 rm -f perl
117 cp /$objtype/bin/perl $sourcedir/t
118 perl TEST `{ ls */*.t | comm -23 - ../plan9/exclude }
119
120plan9.$O: config.h ./plan9/plan9.c
121 cp ./plan9/plan9.c ./plan9.c
122 $CCCMD plan9.c
123
124%.$O: config.h %.c
125 $CCCMD $stem.c
126
127$archlib/Config.pm: miniperl config.sh
128 ./miniperl configpm $archlib/Config.pm
129
130config.sh: miniperl config.h
131 ./miniperl ./plan9/genconfig.pl
132
133installall:V:
134 for (objtype in 386 mips 68020 sparc) mk install
135
136man:V: $perlpods pod/pod2man.PL perl
137 perl pod/pod2man.PL
138 for (i in $podnames) pod/pod2man pod/$i.pod > $installman3dir/$i
139 pod/pod2man plan9/perlplan9.pod > $installman3dir/perlplan9
140
760ac839 141nuke clean:V:
396e9e6f 142 rm -f *.$O $extensions^.pm config.sh $perllib config.h $perlshr perlmain.c perl miniperl $archlib/Config.pm $ext_c
760ac839 143 rm -rf $privlib/IO
396e9e6f 144
145deleteman:V:
146 rm -f $installman1dir/perl* $installman3dir/perl*